Created
April 5, 2020 10:31
-
-
Save yatsu/47bdde35e8abbe7d14bbe730342aa9e0 to your computer and use it in GitHub Desktop.
Install numpy with enabling openblas using pip on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup HomeBrew: https://brew.sh/ | |
brew install openblas | |
pip download --no-binary :all: --no-deps numpy | |
unzip numpy-1.18.2.zip # (you may have newer version) | |
cd numpy-1.18.2 | |
cat > site.cfg <<EOF | |
[openblas] | |
libraries = openblas | |
library_dirs = $(brew --prefix openblas)/lib | |
include_dirs = $(brew --prefix openblas)/include | |
runtime_library_dirs = $(brew --prefix openblas)/lib | |
EOF | |
pip install . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check the installed numpy config | |
# (Note that you must leave the numpy source directory to run this) | |
python3 -c "import numpy; numpy.show_config()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test the performance with test_numpy.py (https://gist.github.com/alimuldal/eb0f4eea8af331b2a890) | |
OMP_NUM_THREADS=1 python test_numpy.py | |
OMP_NUM_THREADS=8 python test_numpy.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably you have lost or broken libbz2 which had been used by Python.
Try this gist to reinstall Python.
https://gist.github.com/yatsu/9ae2dc633511d6d97efccd4fcfa8c8b1