在 ubuntu 上编译 R 包,ELF 无效 header

compiling R package on ubuntu, invalid ELF header

我无法再从源代码编译 R 包,在今天之前这从来都不是问题。这是发生了什么:

R CMD build BAMMtools
* checking for file ‘BAMMtools/DESCRIPTION’ ... OK
* preparing ‘BAMMtools’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a ‘data/datalist’ file should be added
* building ‘BAMMtools_2.1.0.tar.gz’


R CMD INSTALL BAMMtools
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘BAMMtools’ ...
** libs
make: Nothing to be done for 'all'.
installing to /usr/local/lib/R/site-library/BAMMtools/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/usr/local/lib/R/site-library/BAMMtools/libs/BAMMtools.so':
  /usr/local/lib/R/site-library/BAMMtools/libs/BAMMtools.so: invalid ELF header
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/BAMMtools’
* restoring previous ‘/usr/local/lib/R/site-library/BAMMtools’

这似乎不是这个 R 包的问题,​​因为我可以从 R 中安装该包,如:

> install.packages('BAMMtools_2.1.0.tar.gz', repos=NULL)
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘BAMMtools’ ...
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c cohort_matrix.c -o cohort_matrix.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c dtrates.c -o dtrates.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c jenksBrks.c -o jenksBrks.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c treetraverse.c -o treetraverse.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o BAMMtools.so cohort_matrix.o dtrates.o jenksBrks.o treetraverse.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/BAMMtools/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (BAMMtools)

我是 运行ning R v3.2.2,在 Ubuntu v15.10 wily 下。除了使用 sudo apt-get update/upgrade.

更新我的系统外,我想不出我在过去 24 小时内所做的任何事情都会产生这种效果

虽然这对于安装包来说不是什么大问题,但我也无法运行 R CMD 检查命令,这对于开发来说是一个问题。

如有任何建议或建议,我们将不胜感激!谢谢!

正如在问题的评论中发现的那样,感谢 Jack Wasey,问题只是我在源目录的名称上 运行 R CMD INSTALL,而不是在构建的 .tar.gz 文件上。