LAPACK, BLAS, ATLAS on Mac book pro 2017, Mojave
I want to know if and where LAPACK, BLAS, ATLAS packages are installed. I have been reading that these libraries speed up data crunching with numpy(python).
How can it find the location of these packages (if they are installed) and turn them off?
on linux you can do this
apt-cache policy liblapack3
apt-cache policy libblas3
apt-cache policy libatlas-base-dev
and for the lapack, you will get
liblapack3:
Installed: (none)
Candidate: 3.7.1-4ubuntu1
Version table:
3.7.1-4ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
For clarity, the original post is asking about mathematical (linear algebra) libraries (usually in FORTRAN or C) that are included with macOS Mojave, specifically LAPACK (Linear Algebra PACKage), BLAS (Basic Linear Algebra Subprograms), and ATLAS (Automatically Tuned Linear Algebra Software). These libraries are included in the Accelerate framework, documentation can be found here: Apple BLAS documentation
On my machine, these are located here: /System/Library/Frameworks/Accelerate.Framework
These libraries are also included in many FORTRAN compiler packages vis-à-vis Intel iFort and the like. They are also available here: LAPACK and BLAS and ATLAS
The OP is also curious about which libraries are linked in python and how to change them. I am amending my answer to provide context on this as it is relevant to those in the Apple community who use their machines for computational intensive tasks.
To determine which libraries numpy is linked, open up terminal and type:
python
import numpy as np
np.__config__.show()
This will yield how numpy is linked. On my machine this is:
mkl_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/wjid/anaconda3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/wjid/anaconda3/include']
blas_mkl_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/wjid/anaconda3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/wjid/anaconda3/include']
blas_opt_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/wjid/anaconda3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/wjid/anaconda3/include']
lapack_mkl_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/wjid/anaconda3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/wjid/anaconda3/include']
lapack_opt_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/wjid/anaconda3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/wjid/anaconda3/include']
If you are concerned about computational efficiency and are using an Intel processor, you'll probably want to use the MKL libraries that ship with Anaconda or Miniconda (what I am using). If you want something else, you will likely have to build from source.