linux无法打开共享对象文件或目录,加载共享库时出错:libgfortran.so.1:无法打开共享对象文件:没有这样的文件或目录(error while loading shared librar...

加载共享库时出错:libgfortran.so.1:无法打开共享对象文件:没有这样的文件或目录(error while loading shared libraries: libgfortran.so.1: cannot open shared object file: No such file or directory)

我的任务是将程序放到docker环境中,我使用的是ubuntu容器。 该程序由Fortran编写。 当我运行该程序时,我得到了这个错误

./cscheck.out: error while loading shared libraries: libgfortran.so.1: cannot open shared object file: No such file or directory

我几乎读了所有的搜索页面。 我已经尝试过命令ldconfig -v ,但它不起作用。 而且我知道这个错误是因为错过了libgfortran.so.1,但是在ubuntu软件包搜索页面中,libgfortran的最低版本是3.所以我找不到版本1。

你能否给我线索,我需要继续努力。

My task is to put the program to docker environment, I use ubuntu container. and the program is written by fortran. When I run the program, I got this error

./cscheck.out: error while loading shared libraries: libgfortran.so.1: cannot open shared object file: No such file or directory

I have almost read all the search pages. I have tried the command ldconfig -v, but it doesn't work. And I learned that this error is because the missed libgfortran.so.1 , but in ubuntu package search page, the lowest version of libgfortran is 3. So I can't find the version 1.

Can you give me clue, I need to keep trying.

原文:https://stackoverflow.com/questions/49167665

更新时间:2019-12-22 06:32

最满意答案

你从哪里得到这个节目? 如果您有源代码,或者您需要查找旧的libgfortran,请使用当前的gfortran重新构建它。 它将在GCC的旧版本中发布。 尝试安装GCC 4.1或类似的。 这样的旧版本不会出现在当前版本库中,您必须手动安装它。

Where did you get this program? Rebuild it with the current gfortran if you have the source or you need to find the old libgfortran. It will be in an old release of GCC. Try to install GCC 4.1 or similar. Such an old version will not be present in current repositories, you must install it manually.

2018-03-08

相关问答

在Ubuntu 11.10上安装OpenStack时出现同样的错误。 运行定位显示我只有版本1.0.0而不是0.9.8 $ locate libssl.so /lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 我使用以下方法修复它 $ sudo apt-get install libssl0.9.8 I had the same error installing OpenStack on U

...

幸运的是,我偶然发现了这个类似的问题 ,我能够看到我需要做的就是查看我正在使用的buildpack中的bin / release文件,并确保将正确的PATH和LD_LIBRARY_PATH设置为匹配config_vars in那个文件。 我使用heroku config:set命令设置它们。 显然,config_vars仅取自首次部署的应用程序。 无论如何,希望这会在一段时间内拯救别人。 Fortunately, I stumbled across this similar question, a

...

更新虽然我以下写的是一个关于共享库的一般答案,但我觉得这些消息最常见的原因是因为你已经安装了一个包,而没有安装该包的“-dev”版本。 那么这不是说谎 - 那个列表中没有libpthread_rt.so.1 。 您可能需要重新配置和重新构建它,以便它取决于您拥有的库,或安装任何提供libpthread_rt.so.1 。 通常,.so之后的数字是版本号,你经常会发现它们是彼此的符号链接,所以如果你有1.1版本的libfoo.so,你将有一个真正的文件libfoo.so.1.0,和符号链接foo.s

...

你从哪里得到这个节目? 如果您有源代码,或者您需要查找旧的libgfortran,请使用当前的gfortran重新构建它。 它将在GCC的旧版本中发布。 尝试安装GCC 4.1或类似的。 这样的旧版本不会出现在当前版本库中,您必须手动安装它。 Where did you get this program? Rebuild it with the current gfortran if you have the source or you need to find the old libgfortr

...

此错误意味着程序加载程序无法找到cmocka共享库文件。 您需要将存在共享库(如libmocka.so.x)的目录添加到文件“/etc/ld.so.conf”中。 将它包含在LD_LIBRARY_PATH变量中也是可行的。 实际上,将库(共享和静态)安装到“标准”文件夹(如/ usr / lib或/ usr / local / lib)会更好,除非您有某些特定的原因不这样做。 This error means that the program loader cannot find the cmoc

...

我猜测运行时错误是因为路径“/home/admin/Github/casablanca/Release/build.debug/Binaries/”未包含在LD_LIBRARY_PATH环境变量中。 如果你在shell中运行“echo $ LD_LIBRARY_PATH”,它应该确认。 I'm guessing the runtime error is because the path "/home/admin/Github/casablanca/Release/build.debug/Binar

...

问题是,默认情况下,非标准位置中任何动态链接库的绝对路径不包含在最终构建中。 假设您使用的是Linux和gcc,您也可以 通过将其他标志传递给链接器以存储完整路径来解决编译时的问题:在上面的configure命令前加上LDFLAGS="-Wl,-rpath,$HOME/Downloads/serf_install/lib"./configure... ,要么 通过在每次使用svn之前执行export LD_LIBRARY_PATH="$HOME/Downloads/serf_install/lib

...

如果要在群集上发送批处理作业,请添加如下命令 echo $LD_LIBRARY_PATH

ldd ./your_app

到您的批处理脚本。 这应该有助于调试问题。 还要确保在mpirun中导出环境变量。 例如,在OpenMPI中,您将运行您的代码 mpirun -x LD_LIBRARY_PATH ...

If you are sending a batch job on a cluster, please add commands like echo $LD_LIBRARY_PATH

...

在crontab中的命令之前添加了.bash_profile。 # .---------------- minute (0 - 59)

# | .------------- hour (0 - 23)

# | | .---------- day of month (1 - 31)

# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...

# | | | | .---- day of week (0 - 6) (Sunday=0

...

我遇到了这个问题,因为我的共享库依赖于另一个不正常工作的共享库。 I got this problem because my shared libraries depends on another shared library which works improperly.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值