dyld:库未加载:@ rpath/libgfortran.3.dylib [英] dyld: Library not loaded: @rpath/libgfortran.3.dylib

查看:180
本文介绍了dyld:库未加载:@ rpath/libgfortran.3.dylib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习Fortran编程语言,作为测试,我编写了一个简单的程序,如下所示:

I am trying to learn Fortran programming language, as a test I wrote a simple program like this:

!Fortran Program
program first
print *, "Hello World"
end program first

然后我将此代码文件放入mac终端并运行gfortran first.f95,然后按预期给了我a.out的输出. 但是,当我尝试通过导航到输出目录并键入./a.out在终端中运行输出时.它给了我这个错误输出:

Then I threw this code file in to mac terminal and run gfortran first.f95 which then gave me an output of a.out as expected. However, when I try to run the output in terminal by navigating into the output directory and typing ./a.out. It gave me this error output:

dyld: Library not loaded: @rpath/libgfortran.3.dylib
  Referenced from: /Users/liang/Desktop/Programs/Fortran/Test/a.out
  Reason: image not found

liang是我的用户名.

推荐答案

我的情况

我也在学习,并且在编译MUMPS库后出现了类似的错误消息( http://mumps-solver .org ).

在安装依赖项后,我手动编译了MUMPS的顺序版本.当我运行测试示例时,出现了同样的错误消息,即无法加载libgfortran.3.dylib.

I compiled the sequential version of MUMPS manually after brew installing the dependencies. When I ran the test examples, I got the same error message that libgfortran.3.dylib could not be loaded.

我的brew gnu编译器是gcc版本9,由gcc-9,g ++-9和gfortran-9(分别用于C,C ++和Fortran)调用.同时,gcc,g ++和gfortran调用anaconda安装的编译器.

My brew gnu compiler is gcc version 9 and it is invoked by gcc-9, g++-9 and gfortran-9 (for C, C++ and Fortran respectively). Meanwhile gcc, g++ and gfortran invoke the compilers installed by anaconda.

我使用gcc-9和gfortran-9(而不是gcc-9和gfortran)重新编译了MUMPS,现在一切正常.

I recompiled MUMPS using gcc-9 and gfortran-9 instead of gcc-9 and gfortran, and now everything works.

这篇关于dyld:库未加载:@ rpath/libgfortran.3.dylib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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