找不到链接库文件的解决办法:/usr/bin/ld: 找不到 -lgfortran: 没有那个文件或目录

sudo apt-get update #更新库
sudo apt-get install libgfortran-11-dev #下载链接文件
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/11/libgfortran.so /usr/lib/libgfortran.so #链接到/usr/lib/下

载入需要的程辑包:nloptr 试开URL’http://cran.us.r-project.org/src/contrib/nloptr_2.2.1.tar.gz' Content type 'application/x-gzip' length 2253853 bytes (2.1 MB) ================================================== downloaded 2.1 MB * installing *source* package ‘nloptr’ ... ** 成功将‘nloptr’程序包解包并MD5和检查 ** using staged installation checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C++... yes checking whether x86_64-conda-linux-gnu-c++ -std=gnu++11 accepts -g... yes checking for x86_64-conda-linux-gnu-c++ -std=gnu++11 option to enable C++11 features... unsupported checking for x86_64-conda-linux-gnu-c++ -std=gnu++11 option to enable C++98 features... unsupported checking how to run the C++ preprocessor... x86_64-conda-linux-gnu-c++ -std=gnu++11 -E checking whether the compiler supports GNU C++... (cached) yes checking whether x86_64-conda-linux-gnu-c++ -std=gnu++11 accepts -g... (cached) yes checking for x86_64-conda-linux-gnu-c++ -std=gnu++11 option to enable C++11 features... (cached) unsupported checking for x86_64-conda-linux-gnu-c++ -std=gnu++11 option to enable C++98 features... (cached) unsupported checking for pkg-config... /usr/bin/pkg-config checking if pkg-config knows NLopt... yes checking for pkg-config checking NLopt version... >= 2.7.0 Copying headers found in /usr/include into inst/include configure: creating ./config.status config.status: creating src/Makevars ** libs x86_64-conda-linux-gnu-c++ -std=gnu++11 -I"/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -I/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -Wl,-rpath-link,/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib -fpic -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base_1621283253293/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats=/usr/local/src/conda-prefix -c dummy.cpp -o dummy.o x86_64-conda-linux-gnu-cc -I"/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -I/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -Wl,-rpath-link,/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base_1621283253293/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats=/usr/local/src/conda-prefix -c init_nloptr.c -o init_nloptr.o x86_64-conda-linux-gnu-cc -I"/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -I/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -Wl,-rpath-link,/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base_1621283253293/work=/usr/local/src/conda/r-base-3.6.3 -fdebug-prefix-map=/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats=/usr/local/src/conda-prefix -c nloptr.c -o nloptr.o x86_64-conda-linux-gnu-c++ -std=gnu++11 -shared -L/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib -Wl,-rpath-link,/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib -L/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib -Wl,-rpath-link,/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib -o nloptr.so dummy.o init_nloptr.o nloptr.o -llapack -lblas -lgfortran -lm -lgomp -lquadmath -lpthread -lnlopt -L/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib/R/lib -lR /mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/bin/../lib/gcc/x86_64-conda-linux-gnu/9.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lnlopt: 没有那个文件目录 collect2: error: ld returned 1 exit status make: *** [/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib/R/share/make/shlib.mk:6: nloptr.so] Error 1 ERROR: compilation failed for package ‘nloptr’ * removing ‘/mnt/940660EA0660CEB4/rmats_turbo_v4_1_2/conda_envs/rmats/lib/R/library/nloptr’ 下载的程序包在 ‘/tmp/RtmpZ3TSeH/downloaded_packages’里 更新'.Library'里的HTML程序包列表 Making 'packages.html' ... 做完了。 载入需要的程辑包:nloptr 错误: could not install nloptr 此外: Warning messages: 1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : 不存在叫‘nloptr’这个名字的程辑包 2: In install.packages(package$name, repos = repos) : 安装程序包‘nloptr’时退出狀態的值不是0 3: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : 不存在叫‘nloptr’这个名字的程辑包 停止执行
06-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值