marblestation / iSpec

Download input files from https://www.cfa.harvard.edu/~sblancoc/iSpec/dev/input.tar.gz
http://www.blancocuaresma.com/s/
GNU Affero General Public License v3.0
29 stars 6 forks source link

Library not found for -lSystem when compiling `turbospectrum` and `moog` #4

Closed ladsantos closed 3 years ago

ladsantos commented 3 years ago

Hi! I just tried to install iSpec in my MacBook Pro with macOS Big Sur 11.4, and I got the following error when I try to compile turbospectrum:

ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
make[1]: *** [babsma_lu] Error 1
make: *** [synthesizer/turbospectrum/bin/babsma_lu] Error 2

And the same when I compile moog:

ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
make[1]: *** [MOOGSILENT] Error 1
make: *** [synthesizer/moog/MOOGSILENT] Error 2

I already installed the Python dependencies with Anaconda and the Xcode command line tools. GCC and Gfortran are where they should be, with the following versions:

Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.5.0
GNU Fortran (GCC) 6.3.0

Any idea what it could be?

marblestation commented 3 years ago

Hi @ladsantos! According to https://github.com/ponylang/ponyc/issues/3684#issuecomment-745475370, it looks like every XCode update deletes the command line tools and we need to run xcode-select --install again. You may need to also accept the license with sudo xcodebuild -license accept. Could you try that?

marblestation commented 3 years ago

I could finally reproduce and fix with the steps detailed above.

ladsantos commented 3 years ago

Thanks for looking at this, @marblestation. I already have the Command Line Tools installed and updated, and I ran sudo xcodebuild -license accept, but I still have the same problem. I did a little bit of digging, and it seems that, on macOS Big Sur, we need to provide the exact path to the lib when compiling, like so /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem.