Skip to content

Instantly share code, notes, and snippets.

@WarFox
Created August 15, 2022 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WarFox/2e21ba9aac781c89a86986dac363b6d1 to your computer and use it in GitHub Desktop.
Save WarFox/2e21ba9aac781c89a86986dac363b6d1 to your computer and use it in GitHub Desktop.
Installing lapack and openblas for building scipy on MacOS
#!/usr/env bash
brew install openblas
brew install lapack
# Set the following environment variables so that the build tools can find the libraries.
# openblas
export LDFLAGS="-L/usr/local/opt/openblas/lib $LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/openblas/include $CPPFLAGS"
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig $PKG_CONFIG_PATH"
# lapack
export LDFLAGS="-L/usr/local/opt/lapack/lib $LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/lapack/include $CPPFLAGS"
export PKG_CONFIG_PATH="/usr/local/opt/lapack/lib/pkgconfig $PKG_CONFIG_PATH"
## tell compiler not to error out for implicit function declarations
export CFLAGS=-Wno-error=implicit-function-declaration
export LAPACK=/usr/local/opt/lapack/lib/liblapack.dylib
export BLAS=/usr/local/opt/openblas/lib/libopenblas.dylib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment