This page is a guide to building the LAPACK linear algebra package and running its testing and timing programs as part of GCC integration testing.
The LAPACK distribution, available from the netlib repository at lapack.tgz, is a 5 MB file. The uncompressed LAPACK distribution comprises some 35 MB of source files. Building the libraries, test and timing programs adds between 80 and 100 MB of objects, libraries and executables to this.
On a 750 Mhz Pentium III laptop, building and testing LAPACK takes about 30 minutes. Building and running the timing programs takes a lot longer.
To prepare the LAPACK distribution, do the following:
tar zxf lapack.tgz
, orgunzip -c lapack.tgz | tar xf -
cd LAPACK
make.inc
):
PLAT = G77
FORTRAN = <path_to_GCC_installation>/bin/g77
OPTS = -g -O2 -funroll-loops
NOOPT = -g
LOADER = $(FORTRAN)
LOADOPTS = -Wl,-rpath=<path_to_GCC_installation>/lib
RANLIB = ranlib
BLASLIB = ../../blas$(PLAT).a
GCC_DIR = /path/to/gcc/build/directory
FORTRAN = $(GCC_DIR)/gcc/g77 -B$(GCC_DIR)/gcc/
LOADER = $(FORTRAN) -L$(GCC_DIR)/<target>/libf2c
<target>
is the target triple for your system (e.g.
mips-sgi-irix6.5
)
A final note: On 64-bit targets, LAPACK cannot be built using GCC 2.95.2
without specifying the -femulate-complex
flag. Building it
using GCC 3.x should not need that flag.
On Alphas it is necessary to add the flag -mieee
to OPTS,
NOOPT and LOADOPTS.
The LAPACK Makefile assumes that you have the current directory in your path. If this is not the case in your shell setup, use the following command line:
(PATH=$PATH:. export PATH;
make install blaslib lapacklib tmglib testing blas_testing)
If the main memory in your machine is 512 Mbyte or larger, you are able to run the timing programs in addition to the testing programs that are run with the command above. In that case, issue the command:
(PATH=$PATH:. export PATH;
make install blaslib lapacklib tmglib
testing blas_testing timing blas_timing)
The output of the testing programs is written into files with
extension .out
in the TESTING
subdirectory of
the main LAPACK directory. Use the command grep -i fail *.out
to find the number of failing tests.
GCC 3.1 should not result in more failures than GCC 3.0.4
The make targets testing
and blas_testing
build tests that use libraries built for the previous targets. LAPACK
can be used to test interoperability of two compilers by first editing
the make.inc
file to use one compiler and building all of
the libraries with that, and then modifying make.inc
to
specify a second compiler and making the testing targets.
TBD
Cleanup (to prepare the directory for a fresh run, e.g. with another version of the compiler), has to be done as follows:
(PATH=$PATH:. export PATH; make clean;
rm `find . -name '*.SUMM' -print`)
The reason for this is that the LAPACK programs leave files
behind with the extension .SUMM, which are opened with
STATUS='NEW'
- this will result in an abort if the files
already exist.
Copyright (C) Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
These pages are maintained by the GCC team. Last modified 2023-02-01.