ApCoCoALib:NumBlasLapack

From ApCoCoAWiki

Opening remarks

This document describes how to compile the optional numerical libraries needed by CoCoALib if you would like to use ABM or the Lapack functions. Hopefully this document will be improved in time, but somewhat cryptic and elliptic documentation should be better than no documentation. In case this documentation appears to be incomplete or incorrect please complain via the CoCoA forum or even better write a patch and send it to the CoCoATeam.

Building Lapack and its dependencies

Here is a list of the different options available on the most popular platforms we support:

On MacOSX/PPC: Use the Accelerate Framework. You can also compile your own Lapack and BLAS, but why bother in that case because you are unlikely to improve performance noticebly.

On MacOSX/Intel: One could use the the Accelerate Framework or the Intel Math Kernel Library. The Math Kernel Library should be more efficient, we are currently investigating by how much. Obviousy the Intel Math Kernel Library is not free, so one needs a license.

Linux/Windows with Cygwin/any UNIX:

- compile ATLAS (for BLAS, we do not use the Lapack portion of ATLAS) - compile lapack 3.1.0. That one builds right out of the box on Linux,

 otherwiese you need to edit make.inc.

- compile clapack 3.0.0: Read the README first :) and edit make.inc

 then as needed. We only need the libraries libI77.a libF77.a build 
 in f2lib, but if you want to you can build the whole clapack.

In case ATLAS is not available one can always compile BLAS. For large problems the performace will be rather bad, but it will get the job done.

An alternative for the above set of libraries is obviously the Intel Math Kernel Library for Linux x86, x86-64 and on Itanium.

Windows with MSVC 2003/2005: Use the Intel Math Kernel Library. You can theoretically build some combination of ATLAS, BLAS, Lapack & CLapack as described above. This isn't difficult, but certainly more work and the performance will be worse.

Linking

We are currently working on a system that makes linking CoCoALib against numerical libraries easy. Because there is a myriad of different combinations this might take a while to get close to prefect. Hence here are some combinations that are known to work if your build your own version of BLAS or ATLAS, Lapack and CLapack:

# Standard F77 Blas
NUMLIBS     = lapack.a blas.a libI77.a libF77.a
# ATLAS Blas 
NUMLIBS     = lapack.a libI77.a libF77.a libcblas.a libatlas.a

Depending on your toolchain link order might be important and/or different from the above. I strongly recommend to link statically, but your preference may vary. You should obviously be aware that your highly optimized numerical libraries might just blow up on older CPUs, think P4 with SSE3 vs. an older P3.