In this document, we describe how to compile pimc++ program on su-ahpcrc.stanford.edu (Linux parallel cluster) and other systems.
The style of this wiki follows that of How to compile Qbox, so that you could in principle copy and paste the code part in your terminal. Custom files are linked from this wiki and can be downloaded from the command line with 'wget'.
Contents |
General Remarks
Based on the pimc++ installation page we will give some additional details. Before installing pimc++, we need to first build and install the dependence libraries. In particular
- blitz++: http://www.oonumerics.org/blitz/download/
- gmp: ftp://ftp.gnu.org/gnu/gmp/gmp-4.2.4.tar.gz
- sprng-2.0: http://sprng.fsu.edu/Version2.0/sprng2.0b.tar.gz
- gsl: http://ftp.gnu.org/gnu/gsl/gsl-1.9.tar.gz
- hdf5: see Install HDF5
- fftw3: see Install FFTW3
these libraries will have to be installed in your user space directory. To achieve this I use to create a directory called ~/usr-intel where libraries and header files will stay:
mkdir -p $HOME/usr-intel
I also use to download software packages to ~/soft. All these are consistent with the wiki page How to compile Qbox.
mkdir $HOME/soft
This document does not cover the usage of pimc++ but just the compilation, a manual of pimc++ is provided in the pimc++ main page.
First step is to choose a compiler and stick to it for compiling the different libraries and the final pimc++ executable. In this tutorial, we will use intel compilers. On su-ahpcrc, this is selected by,
mpi-selector --set openmpi14_intel-1.4.1
Pimc++ is known to have issues with mpich2 [1]. That's why we choose the openmpi version here.
Install blitz++
Simply download it from sourceforge and decompress it:
cd ~/soft wget http://sourceforge.net/projects/blitz/files/blitz/Blitz%2B%2B%200.9/blitz-0.9.tar.gz/download tar -zxvf blitz-0.9.tar.gz cd blitz-0.9
Then do the usual configure and make install procedure, indicating that we want a private installation in our ~/usr-intel directory
./configure --prefix=$HOME/usr-intel CC=icc CXX=icpc F77=ifort make clean make lib make check-testsuite make check-examples make check-benchmarks rm -rf ~/usr-intel/lib/libblitz* ~/usr-intel/include/blitz/* make install
This will install the blitz++ libraries in ~/usr-intel/include and ~/usr-intel/lib.
Install gmp
The gmp libraries are needed for sprng2. Download gmp from the gmp download page and decompress it:
cd ~/soft wget ftp://ftp.gnu.org/gnu/gmp/gmp-4.2.4.tar.gz tar -zxvf gmp-4.2.4.tar.gz cd gmp-4.2.4
Then do the usual configure and make install procedure, indicating that we want a private installation in our ~/usr-intel directory
./configure --prefix=$HOME/usr-intel CC=icc CXX=icpc F77=ifort make clean make make check rm ~/usr-intel/lib/libgmp.* ~/usr-intel/include/gmp.h make install
This will install the gmp libraries in ~/usr-intel/include and ~/usr-intel/lib.
Install sprng2
Download the sprng2 libraries from the sprng2 download page and decompress it:
cd ~/soft wget http://sprng.fsu.edu/Version2.0/sprng2.0b.tar.gz tar -zxvf sprng2.0b.tar.gz cd sprng2.0
The sprng2 libraries do not have a configure utility. To compile, you need to modify the make.CHOICES file to specify your platform (PLAT = SU_AHPCRC), turn off MPI (#MPIDEF = -DSPRNG_MPI), and create your own SRC/make.SU_AHPCRC file.
wget http://micro.stanford.edu/sprng2.0.SRC.make.SU_AHPCRC make realclean make ./checksprng rm ~/usr-intel/lib/libsprng* cp lib/libsprng* ~/usr-intel/lib rm -rf ~/usr-intel/include/sprng2 mkdir -p ~/usr-intel/include/sprng2 cp include/*.h ~/usr-intel/include/sprng2
If after make you don't see the checksprng executable, it means something is wrong. This is usually because some library paths are not specified correctly in the makefile, e.g. SRC/make.SU_AHPCRC. Note that there is no make install utility, so that we need to manually copy the library and header files to ~/usr-intel/lib and ~/usr-intel/include.
Install gsl
Download gsl from the gsl download page and decompress it:
cd ~/soft wget http://ftp.gnu.org/gnu/gsl/gsl-1.9.tar.gz tar -zxvf gsl-1.9.tar.gz cd gsl-1.9
Then do the usual configure and make install procedure, indicating that we want a private installation in our ~/usr-intel directory
./configure --prefix=$HOME/usr-intel CC=icc CXX=icpc F77=ifort make clean make rm ~/usr-intel/lib/libgsl* ~/usr-intel/include/gsl/* make install
This will install the gsl libraries in ~/usr-intel/include and ~/usr-intel/lib.
Install lib-common
After all the supporting libraries (blitz++, gmp, sprng2, gsl, hdf5, fftw3) are installed, we are ready to install pimc++. The pimc++ source are separated into two parts: libcommon-0.5 and pimc++-0.5. In this section, we first install libcommon-0.5.
Download libcommon from sourceforge and decompress it. You may want to modify the location to decompress the code through the $CODES variable.
export CODES=$HOME/group/`whoami`/Codes mkdir -p $CODES/pimc++ cd $CODES/pimc++ wget http://sourceforge.net/projects/pimcpp/files/pimcpp/Development%20Version%200.5/libcommon-0.5.tar.gz/download tar -zxvf libcommon-0.5.tar.gz cd libcommon-0.5
Then do the usual configure and make install procedure, indicating that we want a private installation in our ~/usr-intel directory
./configure --prefix=$HOME/usr-intel CC=icc CXX=icpc F77=ifort make clean make rm ~/usr-intel/lib/libgsl* ~/usr-intel/include/gsl/* make install
This will install the libcommon-0.5 libraries in ~/usr-intel/include and ~/usr-intel/lib.