Compiling Code_Saturne 4.0.3 on ARCHER (Cray XC30)
Source Modification
A call to getpwuid() was removed in the supplied source package. This is to work around the crash issue with this function when used on ARCHER compute nodes due to the unavailability of the nscd daemon (see https://sourceware.org/bugzilla/show_bug.cgi?id=12491).
File diff follows:
$ diff code_saturne-4.0.3/src/base/cs_system_info.c code_saturne-4.0.3-ARCHER/src/base/cs_system_info.c 275c275 < pwd_user = getpwuid(geteuid()); --- > pwd_user = NULL; /* getpwuid(geteuid()); */
Following install, change file lib/python2.7/site-packages/code_saturne/cs_exec_environment.py to allow running on MOM/compute nodes:
$ diff cs_exec_environment.py.bak cs_exec_environment.py 1251a1252,1254 > # DSM EPCC Edit 12-11-2015 (broken mpiexec on ARCHER mom nodes workaround) > self.type = 'MPICH2' > 1439,1442c1442,1447 < launcher_names = ['mpiexec.mpich', 'mpiexec.mpich2', 'mpiexec', < 'mpiexec.hydra', 'mpiexec.smpd', < 'mpiexec.gforker', 'mpiexec.remshell', < 'mpirun.mpich2', 'mpirun.mpich', 'mpirun'] --- > # DSM EPCC Edit 12-11-2015: ARCHER mom mpiexec issue > #launcher_names = ['mpiexec.mpich', 'mpiexec.mpich2', 'mpiexec', > # 'mpiexec.hydra', 'mpiexec.smpd', > # 'mpiexec.gforker', 'mpiexec.remshell', > # 'mpirun.mpich2', 'mpirun.mpich', 'mpirun'] > launcher_names = [] 1468a1474,1477 > # DSM EPCC Edit 12-11-2015: ARCHER mom mpiexec issue > self.mpiexec = 'aprun' > basename = 'aprun' > 1512,1522c1521,1535 < if not self.mpiexec_n: < if launcher_base[:7] == 'mpiexec': < self.mpiexec_n = ' -n ' < elif launcher_base[:6] == 'mpirun': < self.mpiexec_n = ' -np ' < < if not self.mpmd: < if launcher_base[:7] == 'mpiexec': < self.mpmd = MPI_MPMD_mpiexec | MPI_MPMD_configfile | MPI_MPMD_script < elif launcher_base[:6] == 'mpirun': < self.mpmd = MPI_MPMD_script --- > > # DSM EPCC Edit 12-11-2015: ARCHER mom mpiexec issue > self.mpiexec_n = ' -n ' > self.mpmd = MPI_MPMD_mpiexec | MPI_MPMD_configfile | MPI_MPMD_script > # if not self.mpiexec_n: > # if launcher_base[:7] == 'mpiexec': > # self.mpiexec_n = ' -n ' > # elif launcher_base[:6] == 'mpirun': > # self.mpiexec_n = ' -np ' > # > # if not self.mpmd: > # if launcher_base[:7] == 'mpiexec': > # self.mpmd = MPI_MPMD_mpiexec | MPI_MPMD_configfile | MPI_MPMD_script > # elif launcher_base[:6] == 'mpirun': > # self.mpmd = MPI_MPMD_script
Environment
A dynamically linked build is recommended to enable use of user subroutines.
module swap PrgEnv-cray PrgEnv-gnu module load cray-tpsl module load python-compute module load cray-hdf5-parallel module load cmake module load qt # Can be skipped if building without GUI export CXX=CC export CC=cc export FC=ftn export F77=ftn export F90=ftn export CRAYPE_LINK_TYPE=dynamic export PREFIX_DIR=/path/to/install/dir
Compilation
Assuming prerequisites are installed in $PREFIX_DIR:
export METISPATH=$CRAY_TPSL_PREFIX_DIR export SCOTCHPATH=$CRAY_TPSL_PREFIX_DIR export CGNSPATH=$PREFIX_DIR export LIBXML2=$PREFIX_DIR export BLASPATH=$CRAY_LIBSCI_PREFIX_DIR ./configure --host=x86_64-unknown-linux-gnu --without-modules --disable-rpath --disable-sockets --without-salome --with-mpi --disable-dlloader --enable-long-gnum --disable-mei --with-libxml2=$LIBXML2 --with-libxml2-lib=$LIBXML2/lib --with-libxml2-include=$LIBXML2/include --with-metis=$METISPATH --with-metis-include=$METISPATH/include --with-metis-lib=$METISPATH/lib --with-scotch=$SCOTCHPATH --with-scotch-include=$SCOTCHPATH/include --with-scotch-lib=$SCOTCHPATH/lib --with-cgns=$CGNSPATH --with-cgns-include=$CGNSPATH/include --with-cgns-lib=$CGNSPATH/lib --with-blas=$BLASPATH --with-blas-include=$BLASPATH/include --with-blas-lib=$BLASPATH/lib --with-blas-libs=-lsci_gnu --prefix=$PREFIX_DIR make make install
Testing
After making, from the source directory:
make check
To rerun tests against installed version:
make installcheck
Prerequisites
libxml2-2.9.2
mkdir -p $PREFIX_DIR/lib/python2.7/site-packages LDFLAGS=-L/work/y07/y07/cse/python/2.7.6/lib ./configure --prefix=$PREFIX_DIR --with-python-install-dir=$PREFIX_DIR/lib/python2.7/site-packages make make install
cgns-3.2.1
cd CGNS-3.2.1 mkdir build cd build cmake .. \ -DCGNS_ENABLE_FORTRAN=ON -DFORTRAN_NAMING=LOWERCASE_ \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=YES -DBUILD_SHARED_LIBS=ON \ -DCGNS_ENABLE_HDF5=ON -DHDF5_NEED_MPI=ON \ -DHDF5_LIBRARY=$HDF5_DIR/lib/libhdf5.so -DHDF5_INCLUDE_PATH=$HDF5_DIR/include \ -DCMAKE_INSTALL_PREFIX=$PREFIX_DIR make make install
sip-4.1.7 and PyQt4-4.11.4
Can be skipped if building without GUI.
sip-4.1.7:
cd sip-4.17 python configure.py --bindir=$PREFIX_DIR/bin --destdir=$PREFIX_DIR/lib/python2.7/site-packages --incdir=$PREFIX_DIR/include/python2.7 --sipdir=$PREFIX_DIR/share/sip make make install
PyQt4-4.11.4:
export PYTHONPATH=$PREFIX_DIR/lib/python2.7/site-packages:$PYTHONPATH export PATH=$PREFIX_DIR/bin:$PATH cd PyQt-x11-gpl-4.11.4 python configure-ng.py --sip-incdir=$PREFIX_DIR/include/python2.7 --bindir=$PREFIX_DIR/bin --destdir=$PREFIX_DIR/lib/python2.7/site-packages --sipdir=$PREFIX_DIR/share/sip make make install