R 重新编译包失败,因为失败 [英] R recompile packages failing because failing
问题描述
在我的 linux 集群上,我无法重新编译需要重新编译的 R 包在最新版本中删除了 libRcpp.so
.最终目标是让 R 包 DEseq2 运行.我们安装了新版本/opt/bin
目录下的 g++ 在 /opt/lib64
中有新的库.我有还创建了具有以下指令的 .R/Makevars
:
On my linux cluster, I am having trouble recompiling R packages that need to be recompiled
with the removal of libRcpp.so
in the latest release. The end goal is
to get the R package DEseq2 running. We have installed a new version
of g++ in /opt/bin
directory have new libraries in /opt/lib64
. I have
also created .R/Makevars
that has these directives:
CXX=/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64
-Wl,-llibstdc++ CC=/opt/bin/c++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++
SHLIB_OPENMP_CXXFLAGS= -fopenmp
<小时>
各种版本的 Makevars 都失败了,这只是我最近的一次尝试克服了链接时找不到 libstdc++ 的加载程序问题犰狳如您所见,它正在查找 /usr/lib64
而不是/opt/lib64
.就好像我的 -Wl
指令被忽略了.我是以 sudo 身份运行 R.
"Various versions of Makevars fail, this is just my latest attempt to
overcome a loader problem of it not finding libstdc++ when it links
armadillo. As you can see, it is looking in /usr/lib64
instead of
/opt/lib64
. It is as if my -Wl
directives are ignored. I am
running R as sudo.
我的 .bashrc 也有:
Also my .bashrc has:
LD_LIBRARY_PATH=/opt/lib64:/opt/lib64/R/library/Rcpp/libs:$LD_LIBRARY_PATH:~/lib:~/perl/lib:~/lib/bamtools
LD_RUN_PATH=/opt/lib64:$LD_RUN_PATH:~/lib
export LD_LIBRARY_PATH
export LD_RUN_PATH
<小时>
这是我尝试在 R 中编译需要的新包时得到的结果重新编译:
Here is what I get when I try to compile in R the new packages needing recompilation:
install.packages(onCRAN, lib=lib, repos=rep)
trying URL 'http://cran.rstudio.com/src/contrib/RcppArmadillo_0.4.000.2.tar.gz'
Content type 'application/x-gzip' length 892941 bytes (872 Kb)
opened URL
==================================================
downloaded 872 Kb
* installing *source* package âRcppArmadilloâ ...
** package âRcppArmadilloâ successfully unpacked and MD5 sums checked
* checking LAPACK_LIBS divide-and-conquer complex SVD unavailable via R-supplied LAPACK
* divide-and-conquer algorithm for complex SVD will be redirected to default
** libs
/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ -I/opt/lib64/R/include -DNDEBUG -I/usr/local/include -I"/opt/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o
/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ -I/opt/lib64/R/include -DNDEBUG -I/usr/local/include -I"/opt/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o
/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ -I/opt/lib64/R/include -DNDEBUG -I/usr/local/include -I"/opt/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c fastLm.cpp -o fastLm.o
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/opt/lib64/R/library/Rcpp/libs/Rcpp.so':
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/lib64/R/library/Rcpp/libs/Rcpp.so)
Calls: ::: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64 -Wl,-llibstdc++ -shared -L/usr/local/lib64 -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -L/opt/lib64/R/lib -lRlapack
-L/opt/lib64/R/lib -lRblas -lgfortran -lm
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/opt/lib64/R/library/Rcpp/libs/Rcpp.so':
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/lib64/R/library/Rcpp/libs/Rcpp.so)`
Calls: ::: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
/usr/bin/ld: cannot find -llibstdc++
collect2: error: ld returned 1 exit status
make: *** [RcppArmadillo.so] Error 1
ERROR: compilation failed for package âRcppArmadilloâ
* removing â/opt/lib64/RcppArmadilloâ
下载的源码包在
/tmp/RtmpZty35f/downloaded_packages
警告信息:
In install.packages(onCRAN, lib = lib, repos = rep) :
installation of package RcppArmadillo had non-zero exit code
推荐答案
两个快速评论:
CXX中
有点不寻常,因为它混合了链接器指令(对于CXX
的定义=/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64ld
二进制文件).我会再试一次.
The definition of
CXX
inCXX=/opt/bin/g++ -Wl,-rpath,/opt/lib64 -Wl,-L,/opt/lib64
is a little, ahem, unusual as it mixes linker instructions (for theld
binary). I would try again without.
编译 RcppArmadillo 的错误意义不大,它应该尝试加载 libRcpp.so
.并且 'GLIBCXX_3.4.9' not found
表明您可能设置了路径.
The errors in compiling RcppArmadillo make little sense, it should try to load libRcpp.so
. And 'GLIBCXX_3.4.9' not found
suggests that you may have a path setup.
我会尝试更简单的设置,更少的花里胡哨,然后从内到外工作:重建/重新安装 Rcpp,然后是 RcppArmadillo,依此类推.它适用于使用更标准设置的很多人.
I would try a simpler setup, fewer bells and whistles, and then work from the inside out: Rebuild / reinstall Rcpp, then RcppArmadillo and so on. It works for a lot of people using more standard setups.
这篇关于R 重新编译包失败,因为失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!