I wanted instructions/websites from where I could download LAPACK and BLAS libraries for use in my C programs. I also wanted to know how I could link these to the gcc compiler from terminal.
Lapack is actually included in Accelerate library provided by Apple. You can include it in the header file of your C++ source code.
The first step is to determine where is the BLAS library on your system. Use the command "locate libblas.so" to find the library. If several results are reported, look for the version under /usr/lib/ or /usr/lib64 or something similar to that path.
Newer versions of macOS, including 10.11, ship with an implementation of LAPACK included in vecLib, which is included in macOS. So if your software is vecLib-aware, you may not need to install LAPACK at all. If you need to install a separate LAPACK, it's now available as a Homebrew formula in Homebrew core.
Congratulation, you’ve installed BLAS and LAPACK on your systems! Note: when using C++, do not forget to point out your search directory for header files with option “-I”, and add your library path with “-L” for libraries with “-l” if the search paths for the header files and libraries are not included. Any comment or question is welcome.
So if your software is vecLib-aware, you may not need to install LAPACK at all. If you need to install a separate LAPACK, it's now available as a Homebrew formula in Homebrew core. So brew install lapack will work now.
# # Note: During a regular execution, LAPACK might create NaN and Inf # and handle these quantities appropriately. As a consequence, one # should not compile LAPACK with flags such as -ffpe-trap=overflow.
You can use Homebrew to take care of this for you. Just install Homebrew and then:
brew install openblas
brew install lapack
But you don't even need that: macOS already ships with BLAS and LAPACK implementations in its vecLib framework. So if your software is vecLib-aware, or you pass it the right compiler options, you don't even need to install a separate BLAS and LAPACK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With