The problem with installing RHbase / thrift

I am trying to install RHbase on R 3.1.1 on Mac OSX 10.10.

I installed thrift through Homebrew, and yet, I get the following when I try to install Hbase from a source through R:

install.packages("~/Downloads/rhbase_1.2.1.tar.gz", repos = NULL, type = "source") * installing *source* package 'rhbase' ... ** libs clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I. -g -DHAVE_UINTPTR_T -DHAVE_NETDB_H=1 -fpermissive -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -I./gen_cpp `pkg-config --cflags thrift` -Wall -fPIC -Wall -mtune=core2 -g -O2 -c Hbase.cpp -o Hbase.o /bin/sh: pkg-config: command not found In file included from Hbase.cpp:7: ./Hbase.h:10:10: fatal error: 'TProcessor.h' file not found #include <TProcessor.h> ^ 1 error generated. make: *** [Hbase.o] Error 1 ERROR: compilation failed for package 'rhbase' * removing '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rhbase' Warning in install.packages : installation of package '/Users/halloran/Downloads/rhbase_1.2.1.tar.gz' had non-zero exit status 

Presumably, is there a link to the required library?

EDIT: See what pkg-config returns.

 pkg-config --cflags thrift -I/usr/local/Cellar/thrift/0.9.1/include 
+5
source share
1 answer

I think I figured it out. My configuration starts the same as yours and I get the same errors:

 % pkg-config --cflags thrift -I/usr/local/Cellar/thrift/0.9.2/include 

I made two changes to /usr/local/lib/pkgconfig/thrift.pc :

 % cd /usr/local/lib/pkgconfig % perl -pi -e 's{(^includedir=.*/include$)}{$1/thrift}' thrift.pc % perl -pi -e 's{(^Cflags:.*)}{$1 -std=c++11}' thrift.pc 

The first adds /thrift to the end of the line includedir= . The second adds the -std=c++11 argument to Cflags to solve the next problem you are facing, namespace problem.

Then your configuration should look like the one shown below, and rhbase installation should succeed, albeit with a lot of warnings.

 % pkg-config --cflags thrift -std=c++11 -I/usr/local/Cellar/thrift/0.9.2/include/thrift 
+8
source

Source: https://habr.com/ru/post/1206365/


All Articles