问题描述
设置: R 版本 4.0.5 (2021-03-31)——“摇一摇” 平台:x86_64-pc-linux-gnu(64 位) Ubuntu 16.04
问题:
无法安装 phylosmith 软件包。
命令:devtools::install_github('schuyler-smith/phylosmith',lib = "/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/")
输出:
Downloading GitHub repo schuyler-smith/phylosmith@HEAD
✓ checking for file ‘/tmp/RtmpOU4qAW/remotes570e65639b36/schuyler-smith-phylosmith-2bd9c9b/DESCRIPTION’ ...
─ preparing ‘phylosmith’:
✓ checking DESCRIPTION Meta-information ...
─ cleaning src
─ running ‘cleanup’
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘phylosmith_1.0.5.tar.gz’
* installing *source* package ‘phylosmith’ ...
** using staged installation
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++ -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++11 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -std=gnu++11 accepts -g... (cached) yes
checking whether g++ version is sufficient... (5.4.0) yes
checking for macOS... not found as on Linux
checking for OpenMP... found
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppParallel/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppArmadillo/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppProgress/include' -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppParallel/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppArmadillo/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppProgress/include' -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c correlations_Rcpp.cpp -o correlations_Rcpp.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o phylosmith.so RcppExports.o correlations_Rcpp.o -fopenmp -DARMA_64BIT_WORD -L/usr/lib/R/lib -lR
installing to /home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-phylosmith/00new/phylosmith/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load Failed for ‘phylosmith’ in dyn.load(file,DLLpath = DLLpath,...):
unable to load shared object '/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-phylosmith/00new/phylosmith/libs/phylosmith.so':
/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-phylosmith/00new/phylosmith/libs/phylosmith.so: undefined symbol: _ZN3tbb10interface58internal9task_base7destroyERNS_4taskE
Error: loading Failed
Execution halted
ERROR: loading Failed
* removing ‘/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/phylosmith’
Warning message:
In i.p(...) :
installation of package ‘/tmp/RtmpOU4qAW/file570e27910aa/phylosmith_1.0.5.tar.gz’ had non-zero exit status'
附加信息:我看过其他帖子有类似问题,但未定义符号不同。我相信此错误特定于我给定的未定义符号 (_ZN3tbb10interface58internal9task_base7destroyERNS_4taskE),但我不确定这与它有什么关系或如何解决它。
我尝试更改库并直接从 .tar.gz 文件安装它。我有 GDAL 版本 2.2.2,我认为它也是我唯一的安装。
我什至尝试在完成安装之前复制 finsihed 文件夹,并将其粘贴到库中。包文件夹看起来完整。然后,当我运行命令 library(phylosmith)
时,我得到输出:
Error: package or namespace load Failed for ‘phylosmith’ in dyn.load(file,...):
unable to load shared object '/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/phylosmith/libs/phylosmith.so':
/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/phylosmith/libs/phylosmith.so: undefined symbol: _ZN3tbb10interface58internal9task_base7destroyERNS_4taskE
我也按照指示预先运行了 linux 命令:
sudo apt install libMysqLclient-dev libgdal-dev libudunits2-dev
我使用终端命令 apt install libtbb-dev
和 R devtools::install_package("jjallaire/TBB")
中的 TBB 包安装了 TBB。即使在重新启动 Linux 和 RStudio 后,这两种尝试都没有改变错误输出。
此时,我知道它必须与 .so 文件中包含 tbb 的符号有关。任何帮助故障排除将不胜感激!
解决方法
作者修复了它! Phylosmith 现在应该可以在 Linux 上安装了,没问题。详情请参阅 github.com/schuyler-smith/phylosmith/issues/15。