Petsc需要blas, lapack, mpi。blas和lapack可以用atlas+lapack整合的方式,mpi(mpich2或者openmpi)必须用源程序编译安装。
configure -prefix=/opt/mpich2 |& tee c.txt
make 2>&1 | tee m.txt
atlas+lapack的方法在ATLAS Installation Guide可以找到。
目前在Petsc上配置的软件包:
./configure –with-blas-lapack-dir=/opt/atlas/lib –with-mpi-dir=/opt/mpich2 –with-scalar-type=complex –with-clanguage=c –with-fortran-kernels=generic –download-scalapack=1 –download-mumps=1 –download-superlu=1 –download-plapack=1 –with-debugging=0 –download-fftw=1 –download-blacs=1 –download-parmetis=1 –download-blopex=1
目前FFTW包的路径与petsc中用的不相符,需要手动下载,然后以–download-fftw=/home/……/fftw-3.3.2.tar.gz参数告诉configure
problem in configuring slepc: not working with –prefix=…
Work-around:
1. Compile Petsc with –prefix=…(for example /opt/petsc)
2. configure SLEPC with simply ./configure (no options, although we want it to be at /opt/slepc)
3. Edit the slepcvariables file under the “PETSC_ARCH” directory so that the SLEPC_DESDIR=/opt/slepc
4. Build SLEPC and then install, the whole lib and include files will be moved to the proper place, which here is /opt/slepc
5. Replace those /$PETSC_ARCH/ in configuration files under /opt/slepc with /, i.e. get rid of such extra level of directory.
6. Test and done.
Final question, why cann’t those programmers of Slepc solve this problem for us, or maybe there are ways to do so but I just don’t know.
看起来问题已经解决了。
export PETSC_DIR=/opt/petsc
unset PETSC_ARCH
cd $SLEPC_DIR
./configure –prefix=/opt/slepc
make PETSC_ARCH=arch-installed-petsc
make PETSC_ARCH=arch-installed-petsc install
export SLEPC_DIR=/opt/slepc
atlas+lapack的方法: install first gcc, build-essential and gfortran
1、在atlas目录下获取优化参数:
mkdir bogus
cd bogus
../configure -b 64 -D c -DPentiumCPS=2933 -Fa alg -fPIC
fgrep “F77 =” Make.inc
${Fortran}
fgrep “F77FLAGS =” Make.inc
${Opts}
2、修改lapack下的make.inc文件,取gfortran那个,按照上面获得的参数
gedit make.inc
FORTRAN = ${Fortran}
OPTS = ${Opts}
DRVOPTS = $(OPTS)
NOOPT = ${OPTS} – O
LOADER = $(FORTRAN)
LOADOPTS = $(OPTS)
TIMER = INT_ETIME
3、安装lapack
make lib
4、配置与安装atlas
mkdir build
cd build
../configure -b 64 -D c -DPentiumCPS=2933 -Fa alg -fPIC –prefix=/opt/atlas –with-netlib-lapack=/home/…/lapack/lapack_LINUX.a
make
make check
make time
sudo make install
make shared
Move the .so files if one wishes
把CPU频率控制关掉
sudo apt-get install rcconf dialog
sudo rcconf