Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dyld: Library not loaded: /usr/local/gfortran/lib/libgfortran.3.dylib Reason: image not found

I have tried many workarounds (brew upgrade/update, brew doctor, reinstalling gcc and gfortran, exporting libraries path etc.) to solve this issues, but none of them succeeded. When I try to execute a Fortran executable I get the same error message:

dyld: Library not loaded: /usr/local/gfortran/lib/libgfortran.3.dylib Referenced from: /Users/... Reason: image not found

I have read many different suggestions, is there a set of steps to follow to solve this problem?

Thank you.

More info: MacOS Mojave 10.14.5

which gcc returns /usr/bin/gcc

which gfortran returns /usr/local/bin/gfortran

like image 317
Angela Avatar asked Jul 25 '19 17:07

Angela


1 Answers

SOLVED!

You need first to locate the library:

locate libgfortran.3.dylib 

You should get something like

/usr/local/Cellar/gcc@5/5.5.0_3/lib/gcc/5/libgfortran.3.dylib

Then you can link the library to the right folder:

ln /usr/local/Cellar/gcc@5/5.5.0_3/lib/gcc/5/libgfortran.3.dylib /usr/local/lib/libgfortran.3.dylib
like image 57
Angela Avatar answered Oct 17 '22 04:10

Angela