最快的安装是用下面的scalapack_installer,它将自动联网安装SCALAPACK以及所需要的BLAS, BLACS,LAPACK。
下面是简短说明:
INTRODUCTION
The ScaLAPACK installer is a set of python scripts developed to ease
the installation of the ScaLAPACK library. It can automatically
download, configure and compile the ScaLAPACK including all its
dependencies that are BLAS, LAPACK and BLACS libraries. All it needs
is the mpi C and FORTRAN compilers mpicc and mpif77 (note that the
names of these compilers may be different than mpicc and mpif77 on
some systems). Please note that this is an alpha version and, even if
it has been tested on a wide set of systems, may not work. In case you
encounter a problem, your feedback would be greatly appreaciated and
would be very useful to improve the quality of this installer.
Please submit your complaints and suggestions to [email protected]
or on the lapack/scalapack forum: http://icl.cs.utk.edu/lapack-forum/
Note: If you want use a proxy for downloading, the http_proxy environment variable has to be set.
If the required packages cannot be automatically downloaded (for
example, because no network connection is available on the system),
you can take them any way you like from the following URLs and place
them in the build directory (if the directory does not exist, create
it):
BLAS : http://netlib.org/blas/blas.tgz
LAPACK : http://netlib.org/lapack/lapack.tgz
BLACS : http://netlib.org/blacs/mpiblacs.tgz
ScaLAPACK : http://netlib.org/scalapack/scalapack-1.8.0.tgz
Please note that, in the case where the installer is asked to
automatically download and install the BLAS library, the reference
BLAS is installed and, thus, very low performance is to be expected.
It is strongly recommended that you use an highly optimized BLAS
library (like ATLAS, MKL, GotoBLAS, ESSL etc.) and provide a path to
its location through the --blaslib flag.
压缩包内带说明。
下载:
scalapack_installer.tgz
http://www.netlib.org/scalapack/scalapack_installer.tgz
需要注意的是,这个脚本安装工具会自动设置系统的BLAS链接,如果你需要一个更好的BLAS库,建议你安装优化的BLAS如ATLAS, MKL, GotoBLAS, ESSL等,并且将-blaslib参数指向该库位置。
tar xzvf
./setup.py
--prefix=/opt/mathlibs/scalapack /
--mpibindir=/opt/mpich/intel/bin /
--mpiincdir=/opt/mpich/intel/include /
--blaslib=/opt/mathlibs/gotolib/libgoto.a /
--f90=gfortran /
--downblacs /
--downlapack
root@node8:/softwareBAK/mathlibs/scalapack/scalapack_installer_0.96#./setup.py --prefix=/opt/mathlibs/scalapack --mpibindir=/opt/mpich/ch-p4/bin --mpiincdir=/opt/mpich/ch-p4/include --blaslib=/opt/mathlibs/gotolib/1.1.26/libgoto.a --f90=gfortran --downblacs --downlapack
========================================
Setting up the framework
Install directory is... /opt/mathlibs/scalapack
MPI bin dir is /opt/mpich/ch-p4/bin
MPI include dir is /opt/mpich/ch-p4/include
The Fortran 90/95 compiler is gfortran
mpicc : /opt/mpich/ch-p4/bin/mpicc
mpif77 : /opt/mpich/ch-p4/bin/mpif77
Checking if mpicc works... yes
Checking if mpif77 works... yes
Checking if the Fortran 90/95 compiler works... yes
Setting Fortran mangling... -DAdd_
Setting download command...
Checking availability of urllib... available
Testing urllib... not working
Checking availablility of wget... available
Testing wget... working
Setting ranlib command... /usr/bin/ranlib
Detecting Fortran 77 compiler... unknown
Detecting C compiler... unknown
Selected C compiler flags: -O3
Selected Fortran77 compiler flags: -O3
Selected loader flags (C main):
Selected loader flags (F77 main):
Selected NOOPT flags:
Checking loader... works
========================================
BLAS installation/verification
========================================
Checking if provided BLAS works... yes
========================================
Lapack installation/verification
========================================
Download and install LAPACK from netlib.org
Download LAPACK... done
Unzip and untar LAPACK... done
Installing lapack-3.2.1 ...
Setting ETIME... EXT_ETIME
Writing make.inc... done.
Compiling lapack-3.2.1 (this will take several minutes)... Installation of LAPACK successful.
(log is in /opt/mathlibs/scalapack/log/laplog )
========================================
BLACS installation/verification
========================================
Downloading BLACS... done
Unzip and untar BLACS... done
Setting TRANSCOMM... -DCSameF77
Writing Bmake.inc... done.
Compiling BLACS...done
(log is in /opt/mathlibs/scalapack/log/blacslog )
========================================
ScaLAPACK installer is starting now. Buckle up!
========================================
Installing scalapack-1.8.0 ...
Writing SLmake.inc... done.
Compiling ScaLAPACK... Installation of ScaLAPACK successful..
(log is in /opt/mathlibs/scalapack/log/scalog )
Compiling test routines...
done
done. ScaLAPACK is installed. Use it in moderation :-)
******************************************************
******************************************************
ScaLAPACK installation completed.
Your BLAS library is:
/opt/mathlibs/gotolib/1.1.26/libgoto.a
Your BLACS libraries are:
/opt/mathlibs/scalapack/lib/blacs.a
/opt/mathlibs/scalapack/lib/blacsC.a
/opt/mathlibs/scalapack/lib/blacsF77.a
Your LAPACK library is:
/opt/mathlibs/scalapack/lib/libreflapack.a
Your ScaLAPACK library is:
/opt/mathlibs/scalapack/lib/libscalapack.a
Log messages are in the
/opt/mathlibs/scalapack/log
directory.
The Scalapack testing programs are in:
/opt/mathlibs/scalapack/build/scalapack-1.8.0/TESTING
The
/opt/mathlibs/scalapack/build
directory contains the source code of the libraries
that have been installed. It can be removed at this time.
******************************************************
******************************************************
其他参考:
BLACS安装说明
http://www.netlib.org/blacs/.
Installing and testing BLACS and ScaLapack using gnu/pgi compilers
http://luke.eng.uci.edu/rmc3po/scalapack.notes
论坛:
http://icl.cs.utk.edu/lapack-forum
错误1:
COMMON: in check_linking: cannot link
Cannot link a C main program to a Fortran77 subroutine
Make sure that the appropriate flags are passed to the linker.
command is: /opt/mpich/intel/bin/mpif77 -o lnk tmpf.o tmpc.o
error is:
****************************************
tmpc.o: In function `main':
tmpc.c:(.text+0x0): multiple definition of `main'
/opt/intel/Compiler/11.1/059/lib/intel64/for_main.o:/export/users/nbtester/efi2linux_nightly/branch-11_1/20091013_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x0): first defined here
ld: Warning: size of symbol `main' changed from 80 in /opt/intel/Compiler/11.1/059/lib/intel64/for_main.o to 64 in tmpc.o
/opt/intel/Compiler/11.1/059/lib/intel64/for_main.o: In function `main':
/export/users/nbtester/efi2linux_nightly/branch-11_1/20091013_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x38): undefined reference to `MAIN__'
解决方法:
mpich是用intel编译器编译的,用gcc重新编译一个即可。
错误2:
ScaLAPACK: error building ScaLAPACK test routines
stderr:
****************************************
/opt/mathlibs/gotolib/1.1.26/libgoto.a(sgemm_incopy.o): In function `sgemm_incopy':
../kernel/x86_64/../generic/gemm_ncopy_8.c:(.text+0x9a9): undefined reference to `_intel_fast_memcpy'
collect2: ld returned 1 exit status
make[1]: *** [/opt/mathlibs/scalapack/build/scalapack-1.8.0/TESTING/xspblas1tst] Error 1
make: *** [pblasexe] Error 2
解决:
libgoto.a是用intel编译器编译的,换成gcc编译即可