How to compile ARPACK


Jump to: navigation, search

In Linux/UNIX, you compile ARPACK with the following commands:

cd $HOME
wget -O - | tar xzvf -
wget -O - | tar xzvf -
make FC=gfortran FFLAGS= MAKE=/usr/bin/make ARPACKLIB=$HOME/ARPACK/libarpack.a lib

Replace gfortran by the name of your compiler. This is tested with gfortran:

$ gfortran --version
GNU Fortran 95 (GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5))

and g95:

$ g95 --version
G95 (GCC 4.0.3 (g95 0.90!) Jul 27 2006)

It seems that when a compiler optimization is enabled (FFLAGS=-O) with g95, ARPACK enters in an infinite loop on some platforms (x86 but not on x86_64 (!?)). Compiler optimization flags should therefore be used with caution.

GNU make is used:

$ make --version
GNU Make 3.81beta4

Finally you should have the library $HOME/ARPACK/libarpack.a

If, when compiling DINEOF, you find the following error:

/home/user/ARPACK/libarpack.a(second.o): In function `second_':
second.f:(.text+0x16): undefined reference to `etime_'
collect2: ld returned 1 exit status
make: *** [dineof] Error 1

you will need to edit file 'second.f' located in your $HOME/ARPACK/UTIL folder. There, you should comment the following line by adding an asterisk at the beginning:



* EXTERNAL           ETIME

Finally, you also need Lapack and BLAS libraries, that you can install in Ubuntu with the following commands:

sudo apt-get install liblapack-dev
sudo apt-get install libblas-dev
Personal tools