RHbase/thrift安装问题

Bri*_*ran 5 hadoop r osx-yosemite

我正在尝试在Mac OSX 10.10上将RHbase安装到R 3.1.1上.

我通过Homebrew安装了thrift,然而,当我尝试从源代码安装Hbase到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
Run Code Online (Sandbox Code Playgroud)

据推测,它缺少指向所需库的链接?

编辑:看看pkg-config返回什么..

pkg-config --cflags thrift
-I/usr/local/Cellar/thrift/0.9.1/include 
Run Code Online (Sandbox Code Playgroud)

Ken*_*ams 8

我想我明白了.我的配置与你的配置一样,我得到同样的错误:

% pkg-config --cflags thrift
-I/usr/local/Cellar/thrift/0.9.2/include
Run Code Online (Sandbox Code Playgroud)

我做了两处修改/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
Run Code Online (Sandbox Code Playgroud)

第一个只是添加/thrift到行的末尾includedir=.第二个添加-std=c++11参数Cflags,以解决您将遇到的下一个问题,即命名空间问题.

然后您的配置应如下所示,安装rhbase应该会成功,但仍然会有很多警告.

% pkg-config --cflags thrift
-std=c++11 -I/usr/local/Cellar/thrift/0.9.2/include/thrift
Run Code Online (Sandbox Code Playgroud)