(Instructions for parallel build at bottom of this page.)
wgms3d is written in C++ and needs to be compiled on a Unix-like system (e.g., Linux). The installation follows the more or less standard method of configure / make / make install. However, before installing wgms3d, several other libraries need to be installed on your system; just follow the order on this page.
If you have trouble installing wgms3d, contact the contact the author including the shell output of the compilation process in your mail.
wgms3d expects a shared library libsuperlu.so.4.0.0 as well as SuperLU header files during compilation. This shared library is based on the original SuperLU 4.0 distribution, on a patch (by Sébastien Fabbro) that adds the GNU autotools build system, and on patch by myself that restricts the amount of symbols that are exported by the library to the absolute minimum required by wgms3d.
The quickest way of installing is simply following the instructions in the "Installation" section below. The "Ingredients" section below lists the individual sources, in case you are interested.
This is how to reproduce the version of SuperLU that I offer for direct download above (superlu-4.0mk05.tar.gz):
Install arpack-ng. I have used version 3.1.5.
Some Linux distributions have pre-compiled packages for this, e.g. Fedora brings an arpack package which is based on arpack-ng. If you are not sure, compile it yourself, it's not difficult.
The instructions above were assuming you are linking to a BLAS library that is installed on your system in the form of a single file with a name such as libblas.so.
The MKL contains a highly optimized version of BLAS/LAPACK. If you want to link against MKL, forget about the '--with-blas' configure option described above. The automatic detection will not work either. Instead, before configuring and compiling SuperLU / ARPACK / wgms3d, set the environment variable BLAS_LIBS. Using the MKL link line advisor page I figured out the following link options for an Intel 64 system:
export BLAS_LIBS='-L/path/to/MKL/11.0/069/mkl/lib/em64t -Wl,--start-group -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread'
Replace the /path/to/MKL with your actual path here. If you're not using bash as your shell, the command would be setenv BLAS_LIBS '...' or similar. After this, the configure scripts for SuperLU / ARPACK / wgms3d should no longer complain about a missing BLAS library.
Finally, when executing wgms3d, the dynamic linker path should point to the directory containing the MKL libraries.
To build wgms3d with SLEPc, you don't need SuperLU and ARPACK as described above. Instead, the build involves essentially these steps:
Build PETSc. Note: you must decide during configuration whether you want a real or a complex build. While the classical ARPACK-based wgms3d executable decides automatically at run-time whether a complex solver needs to be used or the real (faster) one is sufficient, for the PETSc-based build you need to decide this in advance. If you know that you only simulate straight waveguides with lossless materials, choose the real PETSc; otherwise build a complex one. The complex build can handle all waveguides, but uses more resources (time and memory) than necessary for straight waveguides and lossless materials.
I used the following to build an optimized complex PETSc 3.4.3: ./configure --with-mpi --download-scalapack --download-metis --download-parmetis --download-mumps --download-superlu_dist --with-clanguage=c++ --with-debugging=0 COPTFLAGS='-O3 -march=native' FOPTFLAGS='-O3 -march=native' CXXOPTFLAGS='-O3 -march=native' --with-scalar-type=complex
Build SLEPc. Set the environment variable SLEPC_DIR to the directory where you unpacked the SLEPc sources (I used v3.4.3); set PETSC_DIR to the directory where you compiled PETSc in the previous step; set PETSC_ARCH to arch-linux2-cxx-opt (or whatever is adequate for your machine). Then a simple "./configure" in the SLEPc source directory should find everything automatically.
Build wgms3d. Set the environment variables as described in the previous step for SLEPc, then run CPPFLAGS="-O3 -march=native" ./configure --with-mpi --with-petsc --with-slepc.