在R中安装Acumos软件包

时间:2018-09-25 14:35:55

标签: r acumos

当我尝试在R中安装Acumos软件包时,我失败了。看来这是由于protobuf,尤其是common.h文件所致。我使用R版本3.5.1。

install.packages("acumos",,c("http://r.research.att.com","http://rforge.net"))
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependency ‘RProtoBuf’

trying URL 'http://r.research.att.com/src/contrib/RProtoBuf_0.4.12.tar.gz'
Content type 'application/x-gzip' length 1263377 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'http://rforge.net/src/contrib/acumos_0.2-7.tar.gz'
Content type 'application/x-gzip' length 9383 bytes
==================================================
downloaded 9383 bytes

* installing *source* package ‘RProtoBuf’ ...
** package ‘RProtoBuf’ successfully unpacked and MD5 sums checked

- checking for g++... g++
- checking whether the C++ compiler works... yes
- checking for C++ compiler default output file name... a.out
- checking for suffix of executables...
- checking whether we are cross compiling... no
- checking for suffix of object files... o
- checking whether we are using the GNU C++ compiler... yes
- checking whether g++ accepts -g... yes
- checking how to run the C++ preprocessor... g++ -E
- checking for gcc... gcc
- checking whether we are using the GNU C compiler... yes
- checking whether gcc accepts -g... yes
- checking for gcc option to accept ISO C89... none needed
- checking whether we are using the GNU C++ compiler... (cached) yes
- checking whether g++ accepts -g... (cached) yes
- checking for pkg-config... no
- checking for protoc... yes
- checking for grep that handles long lines and -e... /bin/grep
- checking for egrep... /bin/grep -E
- checking for ANSI C header files... yes
- checking for sys/types.h... yes
- checking for sys/stat.h... yes
- checking for stdlib.h... yes
- checking for string.h... yes
- checking for memory.h... yes
- checking for strings.h... yes
- checking for inttypes.h... yes
- checking for stdint.h... yes
- checking for unistd.h... yes
- checking google/protobuf/stubs/common.h usability... no
- checking google/protobuf/stubs/common.h presence... no
- checking for google/protobuf/stubs/common.h... no
- configure: WARNING: Protobuf headers not found with default CXXFLAGS and 
- CPPFLAGS, manually trying /usr/local/include
- configure: WARNING: Unsetting ac_cv_header_google_protobuf_stubs_common_h
- checking google/protobuf/stubs/common.h usability... no
- checking google/protobuf/stubs/common.h presence... no
- checking for google/protobuf/stubs/common.h... no
- configure: error: ERROR: ProtoBuf headers required; use '-Iincludedir' in 
CXXFLAGS for unusual locations.
- ERROR: configuration failed for package ‘RProtoBuf’
* removing ‘/usr/local/lib/R/site-library/RProtoBuf’
- ERROR: dependency ‘RProtoBuf’ is not available for package ‘acumos’
* removing ‘/usr/local/lib/R/site-library/acumos’

- The downloaded source packages are in 
        ‘/tmp/RtmpdARWMZ/downloaded_packages’
- Warning messages:
- 1: In install.packages("acumos", , c("http://r.research.att.com", "http://rforge.net")) :

- installation of package ‘RProtoBuf’ had non-zero exit status
- 2: In install.packages("acumos", , c("http://r.research.att.com", "http://rforge.net")) :
- installation of package ‘acumos’ had non-zero exit status

2 个答案:

答案 0 :(得分:1)

我相信R正在寻找libprotoc-dev软件包中的Google协议缓冲区头文件,将其像这样在Ubuntu上安装:

sudo apt-get install libprotoc-dev

我之前曾将您指向命令行软件包,对此感到抱歉。

如果其他所有方法均失败,请强行使用并从https://github.com/protocolbuffers/protobuf下载源代码。

答案 1 :(得分:1)

RProtoBuf的维护者:(在Debian / Ubuntu系统上)需求已被明确枚举in this Dockerfile,我们现在将该软件包用于Travis CI测试:

RUN apt-get update \
        && apt-get install -y --no-install-recommends \
                r-cran-rcpp \
                r-cran-rcurl \
                r-cran-runit \
                r-cran-rmarkdown \
                r-cran-knitr \
                protobuf-compiler \
                protobuf-c-compiler \
                libprotobuf-c-dev \
                libprotobuf-dev \
                libprotoc-dev \
        && install.r pinp 

这结合了R和ProtocolBuffer的要求,因此,如果您“只是”想要构建软件包,则至少需要

protobuf-compiler protobuf-c-compiler libprotobuf-c-dev libprotobuf-dev libprotoc-dev

如果您从不想编译.proto文件,则可以不用编译器。