Build Instructions on NERSC-7 and above

Set enviroment

setenv PREFIX specify_install_dir
module swap PrgEnv-intel PrgEnv-gnu
module load git
module load cmake/2.8.11.2
module load cray-trilinos # load zoltan
module load cray-tpsl # load parmetis/metis

<TO COLLECT PERF DATA>
module unload darshan
module load perftools-lite

If you want to Install 3rd-Party Libraries (SKIP THIS IF YOU USE EXISTING ONE)

1. Install ParMETIS
obtain parmetis-4.0.3.tar from http://glaros.dtc.umn.edu/gkhome/metis/parmetis/download
cd parmetis-4.0.3
make config cc=cc cxx=CC prefix=$PREFIX
make install
setenv PARMETIS_HOME

2. Install Metis
cd metis
make config cc=cc cxx=CC prefix=$PREFIX
make install
setenv METIS_HOME

3. Install Zoltan
obtain zoltan from http://www.cs.sandia.gov/~web1400/1400_download.html
cd Zoltan_v3.8
mkdir build
cd build
../configure -prefix="$PREFIX"-with-parmetis -with-parmetis-incdir="$PREFIX/include" -with-parmetis-libdir="$PREFIX/lib" CC=cc CXX=CC
make everything
make install
setenv ZOLTAN_HOME

For more information on Zoltan installation, see http://www.cs.sandia.gov/zoltan/ug_html/ug_usage.html#Building%20the%20Library

4. Install PETSC

install SCOREC libraries

git clone https://github.com/SCOREC/core.git
cd $PREFIX/core
modify config.sh as needed

cmake .. \
  -DCMAKE_C_COMPILER="cc" \
  -DCMAKE_CXX_COMPILER="CC" \
  -DCMAKE_C_FLAGS="-O2 -g -Wall" \
  -DCMAKE_CXX_FLAGS="-O2 -g -Wall" \
  -DENABLE_THREADS=ON \
  -DENABLE_ZOLTAN=ON \
  -DZOLTAN_INCLUDE_DIR="$CRAY_TRILINOS_PREFIX_DIR/include" \
  -DZOLTAN_LIBRARY="$CRAY_TRILINOS_PREFIX_DIR/lib" \
  -DPARMETIS_INCLUDE_DIR="$CRAY_TPSL_PREFIX_DIR/include" \
  -DPARMETIS_LIBRARY="$CRAY_TPSL_PREFIX_DIR/lib" \
  -DMETIS_LIBRARY="$CRAY_TPSL_PREFIX_DIR/lib" \
  -DCMAKE_INSTALL_PREFIX="$PREFIX" \
  -DCMAKE_BUILD_TYPE=Debug

mkdir build
cd build
../config.sh
make -j
make install

Install m3dc1_scorec

module load cray-hdf5-parallel
module load cray-petsc
module load superlu

setenv CRAY_HDF5_PREFIX_DIR "/opt/cray/hdf5-parallel/default/gnu/49"
setenv PETSC_FC_INCLUDES "-I$CRAY_TPSL_PREFIX_DIR/include -I$CRAY_TRILINOS_PREFIX_DIR/include -I$CRAY_HDF5_PREFIX_DIR/include -I$CRAY_PETSC_PREFIX_DIR/include"
setenv FUSIONINCLUDE "-L$PREFIX/include $PETSC_FC_INCLUDES"

setenv CC "cc -g -O2 -Wall -DDEBUG -fPIC $FUSIONINCLUDE"
setenv CXX "CC -g -O2 -Wall -DDEBUG -fPIC $FUSIONINCLUDE"
setenv FC "ftn -g -O2 -Wall -fPIC -fdefault-real-8 -fbounds-check -fstack-protector-all -ffree-line-length-none"
module unload darshan

svn co http://redmine.scorec.rpi.edu/svn/pafs/trunk m3dc1_scorec
cd m3dc1_scorec
svn co http://redmine.scorec.rpi.edu/svn/buildutil/trunk/GNUautoTools/m4Macros m4
autoreconf -fi
./configure --enable-dependency-tracking --prefix=$PREFIX
make -j
make install

Compile and run the test program

setenv PUMI_LIBS "-lapf -lgmi -lmds -lpcu -lspr -lapf_zoltan -lma -lparma -lph"
setenv SCOREC_LIBS "-L$PREFIX/lib -Wl,--start-group -lm3dc1_scorec $PUMI_LIBS -Wl,--end-group -lzoltan"

setenv PETSC_EXTERNAL_LIB_BASIC "-Wl,-rpath,$CRAY_TPSL_PREFIX_DIR/lib -lHYPRE -lsuperlu -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lml -lsuperlu_dist -lparmetis -lmetis -lpthread -lssl -lcrypto -Wl,-rpath,$CRAY_HDF5_PREFIX_DIR/lib -
L$CRAY_HDF5_PREFIX_DIR/lib -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -ldl -lstdc++ -Wl,-rpath,$CRAY_PETSC_PREFIX_DIR/lib -L$CRAY_PETSC_PREFIX_DIR/lib -lcraypetsc_real"

export CC="cc -g -DDEBUG $FUSIONINCLUDE $FUSIONFLAG"
export CXX="CC -g -DDEBUG $FUSIONINCLUDE $FUSIONFLAG"

cd test/solver
$CXX main.cc -o main -I/usr/include -I$PREFIX/include -I$PREFIX/m3dc1_scorec/include -L$PREFIX/lib -Wl,--start-group -lm3dc1_scorec -lapf -lgmi -lma -lparma -lph -lapf_zoltan -lmds -lpcu -lspr -Wl,--end-group