OpenBLAS: Make error if gfortran installed on Apple M1 machine
Numpy needs OpenBLAS for building.
make
gfortran -O2 -Wall -frecursive -fno-optimize-sibling-calls -march=armv8-a -o sblat1 sblat1.o ../libopenblas_armv8p-r0.3.12.dev.a -lpthread -lgfortran -lpthread -lgfortran -L/usr/local/lib -lto_library -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a
ld: library not found for -lm
collect2: error: ld returned 1 exit status
make[1]: *** [sblat1] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [tests] Error 2
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 32 (5 by maintainers)
Commits related to this issue
- Fix broken gfortran in macOS wheel build It appears that gfortran has a somewhat-well-known issue in that it hard-codes the SDK path that was used to build it, which results in it falling flat on its... — committed to mwoehlke-kitware/drake by mwoehlke-kitware 4 years ago
- Fix broken gfortran in macOS wheel build (#17360) It appears that gfortran has a somewhat-well-known issue in that it hard-codes the SDK path that was used to build it, which results in it falling ... — committed to RobotLocomotion/drake by mwoehlke-kitware 4 years ago
It looks like gfortran was compiled with
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdkand gfortran saves this location into its binary. You have/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdkwhich becomes a problem. A workaround is to doexport SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk. This is not an issue with openblas, but rather gfortran.