问题描述
我正在尝试安装软件包Lars. Ubuntu 11.04 Natty 64位.从建筑物中我得到:
I'm trying to install the package lars. Ubuntu 11.04 Natty 64-bit. From building I get:
* installing *source* package âlarsâ ...
** libs
gfortran -fpic -O3 -pipe -g -c delcol.f -o delcol.o
gcc -shared -o lars.so delcol.o -lgfortran -lm -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: ld returned 1 exit status
make: *** [lars.so] Error 1
ERROR: compilation failed for package âlarsâ
gfortran已安装,当我运行gfortran --version
时,我得到
gfortran is installed and when I run gfortran --version
I get
sudo ldconfig -v
给出错误
我已经删除并重新安装了gfortran.我该如何解决?
I have already removed and reinstalled gfortran. What do I need to fix this?
推荐答案
对于Debian/Ubuntu系列,我们通常建议
For the Debian / Ubuntu family, we usually recommend
$ sudo apt-get install r-base-dev
,因为它提取了编译通常需要的所有软件包.而且,由于自动化的软件包构建器依赖于此方法(以及其他基于软件包的Build-Depends),因此该方法一直受到测试. gfortran
软件包也在此处列出;也许您以前的安装中的链接断开了,所以我也尝试dpkg --purge gfortran; apt-get install gfortran
.也就是说,数十个R程序包(和R本身)都使用Fortran,因此这里不应该有任何魔术.
as it pulls in all packages commonly needed for compiling. And this approach gets tested all the time as the automated package builders rely on this (as well as additional per-package Build-Depends). The gfortran
package is listed here too; maybe you have a broken link from a prior installation so I'd also try dpkg --purge gfortran; apt-get install gfortran
. That said, dozens of R packages (and R itself) use Fortran so there should not be any magic here.
这篇关于构建R程序包,并显示错误"ld:找不到-lgfortran".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!