Skip to content
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

Unable to Use BLAS Implementation on macOS Catalina #73

Open
stefano-tronci opened this issue Aug 26, 2020 · 1 comment
Open

Unable to Use BLAS Implementation on macOS Catalina #73

stefano-tronci opened this issue Aug 26, 2020 · 1 comment

Comments

@stefano-tronci
Copy link

Hi!

I am working on a little project where I will need to run many simulations with simulateDSM and it would be very beneficial for me to minimise execution time. Unfortunately I am stuck with the slowest implementation:

>>> import deltasigma as ds
/usr/local/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /usr/local/lib/python3.8/site-packages/deltasigma/_simulateDSM_cblas.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
/usr/local/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /usr/local/lib/python3.8/site-packages/deltasigma/_simulateDSM_scipy_blas.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
>>> ds.simulation_backends
{'CBLAS': False, 'Scipy_BLAS': False, 'CPython': True}

Environment Information

I am on macOS Catalina 10.15.6 (19G2021) and running python3:

$ uname -a
Darwin MacBook-Pro-10.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
$ python3
Python 3.8.5 (default, Jul 21 2020, 10:48:26)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin

I installed openblas and lapack as follows:

brew install openblas lapack

While I installed deltasigma as follows:

pip3 install deltasigma

In order to prevent warnings due to headers not being found upon importing deltasigma in python I made the following symlinks:

sudo ln -s /usr/local/Cellar/openblas/0.3.10_1/include/cblas.h /usr/local/include/cblas.h
sudo ln -s /usr/local/Cellar/openblas/0.3.10_1/include/openblas_config.h /usr/local/include/openblas_config.h

Unfortunately I cannot get deltasigma to use BLAS:

>>> ds.simulation_backends
{'CBLAS': False, 'Scipy_BLAS': False, 'CPython': True}

Any idea?

@stefano-tronci stefano-tronci changed the title Unable to Use BLAS Implementation Unable to Use BLAS Implementation on macOS Catalina Aug 26, 2020
@michto01
Copy link

michto01 commented May 5, 2024

For me the following export worked:

export BLAS_H=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/cblas.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants