繁体   English   中英

在R中安装Acumos软件包

[英]install Acumos package in R

当我尝试在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

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

sudo apt-get install libprotoc-dev

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

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

RProtoBuf维护者: 在这个Dockerfile中(在该包的Travis CI测试中现在已经清楚地列举了(在Debian / Ubuntu系统上)要求:

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文件,则无需编译器就可以.proto

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM