Search code examples
symlinkgfortrancc

ld: library not found for -lgfortran - Mac Symlink issue?


I am trying to install ObsPy with pip.

The installation fails on the cc command below:

cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.8-x86_64-2.7/obspy/taup/src/emdlv.o build/temp.macosx-10.8-x86_64-2.7/obspy/taup/src/libtau.o build/temp.macosx-10.8-x86_64-2.7/obspy/taup/src/ttimes_subrout.o -lgfortran -o build/lib.macosx-10.8-x86_64-2.7/obspy/lib/libtaup.so

ld: library not found for -lgfortran

This SO question is similar: lgfortran not found, but the solution there was to change the makefile. I don't know how to do that when unsing pip install. I have installed gfortran using homebrew.

Is there a way that I can place a symlink to the existing gfortran lib folder in the location that this command is searching?

Would that location be /usr/local/lib?


Solution

  • Heyhey,

    there are some solutions. The easiest is to set the LD_LIBRARY_PATH to where the gfortran shared library is located.

    locate libgfortran.a

    Other then that you can also install the latest git version of ObsPy which should have solved this problem. Go to http://www.obspy.org to get the git URL.

    Cheers!