CLAPACK for Windows

What do you need?

To download CLAPACK libraries for Windows?
Please refer to the install section

To run a program calling a CLAPACK routine under Windows?
Please follow the step-by-step guide .

To build CLAPACK under Windows?
Please refer to the build section

Prebuilt libraries

Information: Those libraries were built under Visual Studio 2008. They currently corresponds to the 3.2.1 release of CLAPACK.

Include

clapack.h f2c.h
Reference
BLAS
F2C CLAPACK

No debug

blas.lib libf2c.lib lapack.lib

Debug

blasd.lib libf2cd.lib lapackd.lib

Running CLAPACK under Windows

Part 1: Getting a BLAS library

Preamble
For reference purposes, the LAPACK installation provides a(n untuned) version of the BLAS which is not optimized for any architecture. This reference BLAS implementation may be orders of magnitude slower than optimized implementations, for matrix factorizations and other computationally intensive matrix operations. Optimized implementations the BLAS are available from a number of vendors and projects such as: Intel (commercial), AMD, ATLAS, and GotoBLAS.

Part 1-a: Using the Reference BLAS

The Reference BLAS for Windows can be downloaded here . If you decide to build CLAPACK, the Reference BLAS is included in the CLAPACK package.

Part 1-b: Using the MKL BLAS

MKL - http://software.intel.com/en-us/intel-mkl/

Part 1-b: Using the ACML BLAS

AMD (AMCL) -- http://developer.amd.com/cpu/Libraries/ ... fault.aspx

Part 1-c: Using ATLAS BLAS (requires compilation)

ATLAS is aim to, by self-discovery, automatically generate an optimized BLAS library. (-- Cygwin or MinGW required -- ) For a step by step procedure please refer to the ALTAS Forum

Part 1-c: Using GotoBLAS (requires compilation)

(-- Cygwin or MinGW required -- )

The GotoBLAS source is available from here (there's short registration form to fill), and can be compiled for Windows with Cygwin. No changes need to be made to GotoBLAS' config file Makefile.rule, unless a particular compiler is preferred. Happily, the config file automatically enables multithreading if more than one processor is available.

  1. Download and extract the GotoBLAS source to any directory of choice, and make any desired changes to the config file (the default option should also work well).
  2. In Cygwin, "cd" to the top-level directory containing the source, and type "make"
  3. The result of this process should be a file libgoto_-r.a, and a (symbolic) link libgoto.a pointing to this file. (For example, libgoto_banias-r1.26.a) but also the Windows library (*.lib) and dll are generated by default, they are in the exports folder .

Part 2: Using CLAPACK subroutines in a Visual (Studio) C/C++ Project

  1. Download the CLAPACK precompiled libraries: libf2c.lib, lapack.lib plus blas.lib if you decide to go for the Reference BLAS File names of the precomputed debug libraries end with the letter "d" e.g. BLASd.lib and lapackd.lib.
  2. Locate your BLAS libraires for your machine. (You may want to choose the Debug config if you choose GOTOBLAS)
  3. Download the CLAPACK-EXAMPLE Visual Studio project and unzip
  4. Move the libraries from step 1 in the lib folder.
  5. If you are not using the Reference blas, you will need to modify change the properties "Linker > General > Additional Library Directory" to tell Visual Studio where the libraries are, and also add the name of your BLAS library in "Linker > Input > Additional Dependencies"
  6. Compile the project and run the resulting executable. You should get the output: The solution is
    -0.661082 9.456125 -16.014625

Easy Windows Build

Build Instructions for CLAPACK 3.2.1 for Windows with Visual Studio

Requirements: Visual Studio, CMAKE
  1. Download clapack-3.2.1-CMAKE.tgz and unzip.
  2. Download cmake and install it on your machine.
  3. Open CMAKE
    • Point to your CLAPACK-3.2.1-CMAKE folder in the source code folder
    • Point to a new folder where you want the build to be (not the same is better)
    • Click configure, check the install path if you want to have the libraries and includes in a particular location.
    • Choose Visual Studio Solution. You can also choose nmake or any other platform.
    • You may have to click again configure until everything becomes white
    • Click generate, that will create the Visual Studio for CLAPACK and you are done.
    • Close CMAKE
  4. Look in your "build" folder, you have your CLAPACK Visual Studio Solution, just open it.
  5. Build the "ALL_BUILD" project, it will build the solution and create the librarires
  6. Build the "INSTALL". This will put the libraries and include in your install folder.
  7. Build the "RUN_TESTS". The BLAS and CLAPACK testings will be run.

Support and Feedback

We are working hard to improve the CLAPACK Windows support but it seems that users still have problems. We would like to know how we are doing, and how we could further help you. Your post on the forum will be appreciated.