构建R程序包,并显示错误"ld:找不到-lgfortran". [英] Building R package and error "ld: cannot find -lgfortran"

查看:133
本文介绍了构建R程序包,并显示错误"ld:找不到-lgfortran".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装软件包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

gfortran --version GNU Fortran (Ubuntu/Linaro 4.5.2-8ubuntu4)4.5.2

gfortran --version GNU Fortran (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2

sudo ldconfig -v给出错误

/sbin/ldconfig.real:无法统计/usr/lib/libgfortran.so:没有此类文件或目录

/sbin/ldconfig.real: Cannot stat /usr/lib/libgfortran.so: No such file or directory

我已经删除并重新安装了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".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆