Installing MPB

I wanted to try MPB also, it’s a photonic bandgap simulator by MIT. So I downloaded the package and tried to install in my office workstation. The config stage couldn’t pass since it didn’t find the FFTW library, though I have one installed. It turns out that mine is fftw3 while MPB is not compatible with fftw3 yet. So I have to installed fftw2 into my local directory. The installation for fftw2 is pretty straightforward. Now I need to specify both fftw2, libctl and HDF5 location into the configure of MPB (you may want to refer to Meep installation also, it’s quite similar). This is what I typed to configure MPB.

./configure --prefix=/scratch/kurniawano/local LDFLAGS="-L/scratch/kurniawano/local/fftw2/lib -L/scratch/kurniawano/Download/hdf5/lib" CPPFLAGS="-I/scratch/kurniawano/local/fftw2/include -I/scratch/kurniawano/Download/hdf5/include" --with-libctl=/scratch/kurniawano/local/share/libctl

However, when I typed make, it gives me an error, from this page, I found out that the problem is that I am using HDF5 version 1.8, so I needed to pass through the option -DH5_USE_16_API=1 in the CPPFLAGS. After adding this, my installation works fine 🙂


Compiling ARPACK++

I have had difficulties in compiling the examples code provided by ARPACK++. After some googling, it turns out that ARPACK++ is not compatible with newer version of GCC. Luckily, I found a page that provide a patch. So let me provide the steps to compile ARPACK++ .

1. First you have to install ARPACK, UMFPACK, and SuperLU.

2. To install ARPACK, download the files from ( make sure to download the “patch” file as well. Then simply extract the two files:

        zcat arpack96.tar.gz | tar -xvf -
        zcat patch.tar.gz    | tar -xvf -
3. In the ARPACK folder, modify It is better to use the BLAS and LAPACK provided by ARPACK. Sometimes using other libraries creates problem. And for my case, I need to modify the location of the ARPACK source tree and the location for "make" program.
4. type make lib. This should compile arpack for your platform, copy the library to your local library locations. You should test also the EXAMPLES codes provided to make sure everything went well.
5. Now install SuperLU, downlaod the source code from (
6. Modify This is the one that I use:
SuperLUroot     = /scratch/kurniawano/Download/SuperLU_3.1
SUPERLULIB      = $(SuperLUroot)/lib/libsuperlu_3.1.a
BLASLIB         = /usr/lib64/libblas.a
TMGLIB          = libtmglib.a
LIBS            = $(SUPERLULIB) $(BLASLIB)
CDEFS        = -DAdd_
with "one" underscore after "-DAdd"
7. Then type make, if there is an error due to the timer, just type make again and it will continue compiling.
8. Now UMFPACK is installed from the SuiteSparse package. I have written some other posts on this package installation. Just search on this blog.
9. So now download Arpack++ from (, and its patch from (
10. extract Arpack++ and copy the patch file to the arpack++ folder, and type 
patch -p1 < arpack++1.2.patch.diff
11. After that modify, especially the path to the Arpack++ and the following libraries:

ARPACK_LIB   = /scratch/kurniawano/local/lib/libarpack.a
LAPACK_LIB   = -llapack
UMFPACK_LIB  = /scratch/kurniawano/local/lib/libumfpack.a
SUPERLU_LIB  = /scratch/kurniawano/local/lib/libsuperlu.a
BLAS_LIB     = -lblas
FORTRAN_LIBS = /scratch/kurniawano/local/lib/libg2c.a

Guide to available mathematical libraries

I just found an interesting site to help you find the required mathematical libraries for computation.