How to install Lapack on Mac OS?

less than 1 minute read

This is a question I get asked a lot. Lapack is actually included in Accelerate library provided by Apple. You can include it in the header file of your C++ source code. Refer to this post for more information on how to use Lapack included in Accelerate.

If you like to use the latest version of Lapack, you can easily install it using Homebrew. Enter the following command in a terminal window to install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

To install Lapack libraries, you should first install GFortran which is included as a part of GCC. Run the following command in a terminal window:

brew install gcc

Now, you can simply install Lapack by typing the following command in a terminal window:

brew install lapack

Please let me know your questions in the comment section.