BLD: macOS OpenBLAS contains GCC libs#13191
BLD: macOS OpenBLAS contains GCC libs#13191tylerjereddy wants to merge 1 commit intonumpy:masterfrom
Conversation
* Azure CI macOS build now uses an OpenBLAS build statically-linked to GCC runtime dependencies; we are no longer chained to a specific version of gcc/ gfortran toolchain libraries at NumPy runtime
tylerjereddy
left a comment
There was a problem hiding this comment.
The CI result for MacOS on Azure looks good to me. If there's general preference for removing runtime OpenBLAS dylib dependence on libgfortran and libquadmath libraries I could try to move the effort from my repo for local builds to the actual repo for OpenBLAS builds in the MacPython ecosystem.
| # strictly enforce lack of runtime deps | ||
| # libgfortran & libquadmath should be statically linked | ||
| ! otool -L ./usr/local/lib/libopenblasp-r0.3.5.dev.dylib | grep -q 'libgfortran' | ||
| ! otool -L ./usr/local/lib/libopenblasp-r0.3.5.dev.dylib | grep -q 'libquadmath' |
There was a problem hiding this comment.
These one-liners should be made slightly more robust. They are working as intended for now, but if the object file being parsed doesn't exist the return code inversion specified by ! will allow for silent failure.
Probably have to bite the bullet and use if statements in bash or whatever.
|
In general I am in favor of static linking, especially on windows it will solve many of our "cannot import" problems. Are the wheels smaller? |
|
Haven't check the wheel sizes for NumPy proper, but informally the zip archive with the static OpenBLAS build seemed to be within ~1 MB of the version that still had runtime GCC deps, I think |
|
Closing -- this works fine for Mac OS, but doesn't seem to be much interest here. For Linux we'd have to use a custom build of gcc from source to avoid libgfortran and libquadmath deps, which we probably don't want to deal with anyway. |
This is a demonstration of an OpenBLAS build with statically-linked GCC runtime dependencies I did locally for MacOS--it should run through Azure CI just fine without any need for runtime
libgfortranorlibquadmathInspired by discussion with @carlkl for Windows stuff, but figured it may be useful for mac portability too