#!/bin/csh

# modules loaded (Pleiades)
#
# module load comp-intel/2016.2.181
# module load mpi-sgi/mpt.2.12r26

setenv CC mpicc
setenv FC mpif90
setenv CFLAGS "-O3"
setenv FCFLAGS "-O3"

grep -q "1.10" ./configure.ac
if ( $? == 0 ) then
  set CONFIG_OPT = "--enable-build-mode=production --enable-fortran"
  set VERS = "1_10"
else
  set CONFIG_OPT = "--enable-production --enable-fortran --enable-fortran2003"
  set VERS = "1_8"
endif
./configure --without-pthread --disable-shared --enable-parallel $CONFIG_OPT --disable-direct-vfd --with-zlib=$HOME/packages/zlib-1.2.8/lib --prefix=$HOME/packages/phdf5-$VERS
make
make install
