krischer / mtspec

Python library for multitaper spectral estimations
http://krischer.github.io/mtspec/
GNU General Public License v3.0
69 stars 44 forks source link

Error installing on macOs 10.13.3 #19

Closed kjancsi closed 6 years ago

kjancsi commented 6 years ago

Hi, I've got all the prerequisites installed as per instructions (gfortran, numpy), and when running "pip install mtspec", I get things like:

"... ld: library not found for -lgfortran clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang' failed with exit status 1


Failed building wheel for mtspec Running setup.py clean for mtspec Failed to build mtspec Installing collected packages: mtspec Running setup.py install for mtspec ... error ... .7/mtspec/src/src/xint.o build/temp.macosx-10.13-x86_64-2.7/mtspec/src/src/yule.o build/temp.macosx-10.13-x86_64-2.7/mtspec/src/src/zqrfac.o -lgfortran -o build/lib.macosx-10.13-x86_64-2.7/mtspec/lib/mtspec.so -m64 ld: library not found for -lgfortran clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang' failed with exit status 1 "

Any idea what might be going on? Thanks.

krischer commented 6 years ago

Looks like it cannot find libgfortran. How did you install gfortran? It should be added to your compilers default linking include directories.

If you know where the shared libgfortran is located you should able to install with:

LDFLAGS="-L/path/to/libgfortran/folder" pip install mtspec

Please not that we also offer conda packages which make a lot of things easier. So if you have conda, just do:

$ conda install -c conda-forge mtspec
kjancsi commented 6 years ago

Thanks for the quick response and suggestion. I just needed to use LDFLAGS. Thanks!

krischer commented 6 years ago

Good to know :-) Please note that you might to set every time you run mtspec so a more permanent solution might be to set LD_LIBRARY_PATH in your .bashrc.

dbpodrasky commented 4 years ago

Wow! This took me forever to find. Had the same issue and this solution worked.