Skip to content

BLD: macOS OpenBLAS contains GCC libs#13191

Closed
tylerjereddy wants to merge 1 commit intonumpy:masterfrom
tylerjereddy:macos_openblas_local_work
Closed

BLD: macOS OpenBLAS contains GCC libs#13191
tylerjereddy wants to merge 1 commit intonumpy:masterfrom
tylerjereddy:macos_openblas_local_work

Conversation

@tylerjereddy
Copy link
Copy Markdown
Contributor

@tylerjereddy tylerjereddy commented Mar 26, 2019

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 libgfortran or libquadmath

Inspired by discussion with @carlkl for Windows stuff, but figured it may be useful for mac portability too

* 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
Copy link
Copy Markdown
Contributor Author

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mattip
Copy link
Copy Markdown
Member

mattip commented Mar 26, 2019

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?

@tylerjereddy
Copy link
Copy Markdown
Contributor Author

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

@tylerjereddy
Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants