Skip to content

How to Install LAPACK on Mac OS

Using Apple's Accelerate Framework

This is a question I get asked a lot. LAPACK is actually included in the 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.

Installing the Latest LAPACK via Homebrew

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)"

Installing GCC and GFortran

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

Installing LAPACK

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.