R包安装:ld:警告:没有找到'-Lusrlocalgfortranlib'选项的目录。

问题描述 投票:0回答:1

我正试图从源头安装一个R包。

igraph

这是我的命令。

install.packages('igraph_1.2.4.tar.gz', repos = NULL, type="source")

但我得到了以下错误。

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/igraph’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/igraph’
r igraph
1个回答
1
投票

在重新安装了R之后,我不得不手动修改了 FLIBS 中的变量 /Library/Frameworks/R.framework/Resources/etc/Makeconf 来指向gcc库。

另外,这里的帖子也有帮助。https:/medium.comiosyntaxfollowing-up-library-dependency-when-compiling-r-packages-89f191b9f227。

© www.soinside.com 2019 - 2024. All rights reserved.