我正在尝试安装一个R包,代码如下:
> install.packages("mnormt")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/mnormt_1.5-5.tar.gz'
Content type 'application/x-gzip' length 37169 bytes (36 KB)
==================================================
downloaded 36 KB
* installing *source* package ‘mnormt’ ...
** package ‘mnormt’ successfully unpacked and MD5 sums checked
** libs
gfortran -fpic -g -O2 -fstack-protector-strong -c biv-nt.f -o biv-nt.o
gfortran -fpic -g -O2 -fstack-protector-strong -c sadmvnt.f -o sadmvnt.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o mnormt.so biv-nt.o sadmvnt.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'mnormt.so' failed
make: *** [mnormt.so] Error 1
ERROR: compilation failed for package ‘mnormt’
* removing ‘/usr/local/lib/R/site-library/mnormt’
The downloaded source packages are in
‘/tmp/RtmpQnOaAx/downloaded_packages’
Warning message:
In install.packages("mnormt") :
installation of package ‘mnormt’ had non-zero exit status
但是我已经安装了gfortran库。仍然出现这个错误。