The deal.II Readme on interfacing to ARPACK
Keywords: deal.II

## Installation of ARPACK

ARPACK is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems. ARPACK should be readily packaged by most Linux distributions. Don't forget to install a development version of the library.

Since ARPACK has not been maintained by Rice university for some years, Debian, Octave and Scilab developers gathered their own modifications and bug fixes in the library ARPACK-NG. Furthermore, ARPACK-NG equips ARPACK with a CMake build system.

Below is a short summary of instructions on how to compile and install ARPACK or ARPACK-NG by hand (for the case you wish to do so).

### How to compile and install ARPACK by hand

After you downloaded the Fortran version of ARPACK and the patch, unzip the files you got. That will create a directory named ARPACK. If you need further instructions please read the README file or the instructions. We will explain here in a few steps what has to be done to be able to compile ARPACK.

- edit `ARmake.inc`

- change home to the correct directory
- choose which BLAS and LAPACK you would like to use

- change the file second.f in the UTIL directory
- do `make lib` in the current directory to build the standard library `libarpack_$(PLAT).a`

Note: For compilation of ARPACK we emphasize adding the compiler flag `-fPIC`. This is a definite requirement if we are compiling deal.II with shared libraries (which is the default). If we had preferred to be compiling deal.II without shared libraries, that's ok too; in that case we would do exactly the same thing as described above, but this time omitting the `-fPIC` flag from the scheme.

Try to run one of the examples and compare the output. How the output should look like is stated in the README that can be found in the `EXAMPLES` directory.

If that output you produced looks like it should you can proceed to compile deal.II with ARPACK.

### How to compile and install ARPACK-NG

First clone the ARPACK-NG repository. The following commands will set up an appropriate configuration:

            cd arpack-ng
            mkdir build
            cd build

            cmake                                       \
            -DEXAMPLES=ON                               \
            -DMPI=ON                                    \
            -DBUILD_SHARED_LIBS=ON                      \
            -DCMAKE_INSTALL_PREFIX:PATH=$HOME/ARPACK-NG \
            ../

            make

You will need to adjust the path into which you want to install ARPACK-NG in the CMAKE_INSTALL_PREFIX line. If you do not have MPI installed, you should use `-DMPI=OFF` instead.

Afterwards run

            make check
            make test
            make install

to test that the build of ARPACK-NG works correctly and to install the library finally.

## Interfacing deal.II to ARPACK

Support for ARPACK will be enabled automatically if a system wide installation of ARPACK can be found. To use a self compiled version, specify

        -DARPACK_DIR=/path/to/arpack

when invoking `cmake`.

You can override the autodetection by manually setting

        -DDEAL_II_WITH_ARPACK=OFF|ON

.