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

3

7

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?

Burger answered 23/3, 2013 at 17:56 Comment(0)
C
6

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!

Carpenter answered 24/3, 2013 at 18:54 Comment(1)
Thanks, it took me a while to get back to this project, but this did the trick. I added LIBRARY_PATH to my bash_profile. I edited your answer because I first tried to add LD_LIBRARY_PATH, which did not work for me.Burger
B
3

You can also find the location of the lib using:

sudo find /usr -iname 'libgfortran*.a' | xargs shasum
Brassbound answered 12/11, 2014 at 11:58 Comment(0)
C
0

For me, what solved was setting this in the .pro file:

QMAKE_LIBDIR += /path/to/lib
Chunk answered 6/11, 2013 at 3:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.