LAPACK on Windows

(Building LAPACK using the "native windows" (mingw) gfortran. ) Updated 13 April 2012


This applies to users of the "native Windows" gfortran who seek to create working LAPACK libraries from source. This procedure was developed and tested on on Windows XP and Windows 7 using using gcc-4.6.2.

The binary distribution of gfortran (presently) includes a version of the GNU make.exe , but certain instructions in the LAPACK makefiles may not properly execute. The make process for creating and testing the libraries may then fail completely, leaving the novice struggling, and the undetermined unfulfilled. In such case, DO NOT PANIC!, this article should help you with a "workaround" to create and test the LAPACK linear analysis libraries for your "native Windows" gfortran.


LAPACK is not a gcc project, but works with gfortran and is freely available from Netlib . The gfortran "native Windows" (mingw) build is available as a binary [see GFortranBinaries#Windows ] and is presently provided with a courtesy versions of some minimum Mingw tools like make.exe.

Problem/Solution Outline

Makefiles are textfiles which are scripts (programs) telling a "make" interpreter how to create a project, such as creating the LAPACK libraries and test routines [see ]. LAPACK provides makefiles with their distribution, and these generally work fine under LINUX. Under DOS/Windows the same cannot always be said. Instruction in the LAPACK makefiles may fail, resulting in the make process failing to a dead stop at an early stage, generating errors and anguished hand-wringing.

By combining windows batch files with modified makefiles it is possible to bypass the lapack makefile problems and compile and test the lapack libraries. Using this approach it is not necessary to install a full Mingw or Cmake implementation.


Download and unzip the file provided below, which contains instructions, two modified LAPACK makefiles, a for gfortran, and two batch files. Follow the instructions.


Lapack 3.2.1 :

Lapack 3.4.0 :


Lapack 3.2.1 :

Lapack 3.2.1 :

None: LAPACK on Windows (last edited 2012-04-14 07:34:18 by 76)