r - 在 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
解决方案
RProtoBuf
这里的维护者:要求(在 Debian/Ubuntu 系统上)在我们现在用于该包的 Travis CI 测试的Dockerfile中明确列举:
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
如果你不想编译文件,你可能会在没有编译器的情况下逃脱。
推荐阅读
- node.js - 开玩笑:在 setupTestFrameworkScriptFile 中,我可以访问当前正在执行的测试文件的名称/文件名吗
- gpu - OPENACC 函数等价于 CUDA 的 cudaError_t cudaMemGetInfo
- c# - 第二层嵌套automapper c# unflatten
- android - 单击片段中的编辑文本会导致工具栏滑出屏幕
- postgresql - 通过在 postgresql 中添加约束和使用索引来更改表,在 "("IDX_emp_PK 或附近出现错误语法错误
- angular - 如何在不违反 HTML 规则的情况下在表格中编写嵌套的 formGroups?
- javascript - 有没有办法在文本后添加伪元素
- python-3.x - 当需要使用替代签名进行实例化时,如何扩展 PyGobject 类?
- python - PyQt Windows 没有出现
- angular - Angular 异步管道和 http/delayed observable