-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kluge to get the gfortran linker to work correctly for SciPy on Big Sur. #20367
Conversation
I think the flake8 failure is a false positive, see PyCQA/pycodestyle#373. |
It does indeed look like a false-positive. Can you remove the spacing around |
Out of curiosity, what is the fix? Maybe we could backport that patch instead. |
The fix to what? The SciPy package.py, or gcc? |
Ah nvm, you linked to the fix in your initial comment. I wonder if we should be setting this globally for all packages that use the GCC compiler on macOS 11. This seems to be the only package that breaks so far, but if it's a GCC bug I imagine there will be many others. I'm actually surprised to see someone using GCC on macOS, as Python can't even be built with GCC on macOS. You might be the only user who encounters this problem. For now, I'm going to merge this. |
Isn’t GCC (the |
Ah, I see. Yes, I'm using Apple Clang + GFortran too. I haven't hit this yet because my laptop is too old to update to Big Sur, but I'm sure this will become a big issue if it affects Fortran builds. |
…ur. (spack#20367) * Kluge to get the gfortran linker to work correctly on Big Sur. * Fixed formatting error; stetting the other. * Removed spaces. * Added comment, mainly to re-trigger Spack CI.
…ur. (spack#20367) * Kluge to get the gfortran linker to work correctly on Big Sur. * Fixed formatting error; stetting the other. * Removed spaces. * Added comment, mainly to re-trigger Spack CI.
On Big Sur,
gcc
can’t detect the macOS version correctly. This causes a linker invocation withgfortran
to try to link tolibgcc_s.10.4
, which isn’t present on the system. This apparently only happens whengfortran
is used to link a.so
library, so it doesn’t affect SciPy’s dependencies: OpenBLAS usesgfortran
to link, but is producing a.dylib
; NumPy usesclang
to link. It looks like the SciPy build system injects the-mmacosx-version-min
flag (in_build_utils/compiler_helper.py
) for the C++ compiler, but not for the Fortran compiler.This PR gets around that by setting the
MACOSX_DEPLOYMENT_TARGET
to 10.15 (Catalina) when on Big Sur. This is incorrect, since it causesgfortran
to identify the OS as Catalina, but at least it’s close enough that it gets the linked library right. It looks like thegfortran
behavior is updated for Big Sur in this commit to the gcc codebase, but that’s not available in a gcc release yet.