【发布时间】:2018-05-19 17:51:22
【问题描述】:
使用 Linux Mint 18.3 (Ubuntu 16.04)
我在 Anaconda 环境中使用 R studio 1.1.383 和 R 3.4.2,在尝试安装多个不同的库时出现编译器错误。
例如,当尝试安装“lmtest”(“tidyquant”的依赖项,它可以毫不费力地安装在我的 Windows 机器上)时,我收到以下错误。由于 tidyquant 有如此多的依赖项,我想省去您的多个错误消息。
install.packages('lmtest')
trying URL 'https://cran.rstudio.com/src/contrib/lmtest_0.9-35.tar.gz'
Content type 'application/x-gzip' length 183575 bytes (179 KB)
==================================================
downloaded 179 KB
installing *source* package ‘lmtest’ ...
package ‘lmtest’ successfully unpacked and MD5 sums checked
libs
/home/mikejames/anaconda3/bin/x86_64-conda_cos6-linux-gnu-gfortran -fpic -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I/home/mikejames/anaconda3/include -L/home/mikejames/anaconda3/lib -c pan.f -o pan.o
/home/mikejames/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -shared -L/home/mikejames/anaconda3/lib/R/lib -Wl,-O2,--sort-common,--as-needed,-z,relro,-z,now -L/home/mikejames/anaconda3/lib -o lmtest.so pan.o -lgfortran -lm -lgomp -lquadmath -lpthread -L/home/mikejames/anaconda3/lib/R/lib -lR
/home/mikejames/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.2.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lgomp
/home/mikejames/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.2.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lquadmath
/home/mikejames/anaconda3/lib/R/share/make/shlib.mk:6: recipe for target 'lmtest.so' failed
make: *** [lmtest.so] Error 1
ERROR: compilation failed for package ‘lmtest’
* removing ‘/home/mikejames/anaconda3/lib/R/library/lmtest’
Warning in install.packages :
installation of package ‘lmtest’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpBzLASQ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
我所有错误消息中的常见错误消息似乎是:找不到-lgomp和-lquadmath
/home/mikejames/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.2.0 /../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lgomp
/home/mikejames/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.2.0 /../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lquadmath
任何帮助将不胜感激!
【问题讨论】:
-
简答:不要混合使用 anaconda 和 CRAN。
-
你能解释一下吗?感谢您的快速回复
-
仅基于我在此处回答的一些先前问题,以及我认识的一个 R 高级用户使用它的事实。 R确实有效。对于 Python,Conda 可能也是如此。两者混合,没有那么多。在基于
.deb的系统上也不需要它。
标签: r linux ubuntu linux-kernel ubuntu-16.04