first reference to https://help.ubuntu.com/community/Arpack%2B%2B
1.apt-get install libarpack2-dev (gfortran已安装)
注意:不安装libsuperlu3-dev, because it will hapen "segment fault", such like running arpack++.examples.nonsym.lnsymgsh although they can be compiled successfully.
Because ARPACK++ only support superlu 2.0.
2. compile superlu 2.0
download superlu 2.0 source code.
Because my system is ubuntu, so I have to modify make.inc of superlu.Because I already install blas library , so as README says, set BLASDEF = -DUSE_VENDOR_BLAS BLASLIB = <your blas path>.
PLAT = LINUX CFLAGS = -02 -g(just simple setting, you can search CFLAGS information or refer
http://blog.chinaunix.net/u3/94102/showart_1922415.html, you can set more, then make superlu better work)
3. install ARPACK++
download arpack++ 1.2 (beta version) at http://www.ime.unicamp.br/~chico/arpack++/ and the patch for arpac++ 1.2 at http://reuter.mit.edu/index.php/software/arpackpatch/ in the same directory
open with an editor the patch file arpack++1.2.patch.diff
gedit arpack++1.2.patch.diff
and change the (should be 9362th) line
+FORTRAN_LIBS = -lg2c
into
+FORTRAN_LIBS = -lgfortran -lgfortranbegin -lnsl
then untar arpack++
tar -zxvf arpack++.tar.gz
and check that it is version 1.2 with the command
head -1 arpack++/README
that should return the string
ARPACK++ version 1.2. Feb 20, 2000.
now apply the patch
cp arpack++1.2.patch.diff arpack++/cd arpack++patch -p 1 < arpack++1.2.patch.diff
Compiling with ARPACK++
at this point arpack++ should be working: as it is only a c++ interface to arpack, there are no libraries but only header files to be included into your c++ code; therefore you need to compile with
-I $whereisarpack/arpack++/include
where you should substitute to $whereisarpack the place where arpack++.tar.gz has been untarred
4. test
cd $whereisarpack/arpack++/examples/superlu/sym
make
(note: you must modify make.inc of arpack++: link your supelu 2.0 library)