#!/bin/bash

COMPILER=intel-13
LOCAL=$(pwd)
DST=$( echo ${LOCAL}/../.. )
module purge
module load intel szip hdf5 netcdf UDUNITS
DIR_UUID=/apps/UUID/1.6.2
DIR_UDUNITS=/apps/UDUNITS/2.1.24
DIR_NETCDF=/apps/NETCDF/4.1.3
DIR_HDF5=/gpfs/apps/MN3/HDF5/1.8.10
export CC=icc
export CFLAGS='-fpic -O3 -ip -no-prec-div -static'

export CPP='icc -E'
export CPPFLAGS='-DpgiFortran'
export CXXCPP='icpc -E'

export F77=ifort
export FC=ifort
export FFLAGS='-fpic -O3 -ip -no-prec-div -static'

make clean
set -e

./configure --prefix=$DST --with-netcdf=$DIR_NETCDF --with-hdf5=$DIR_HDF5 --with-udunits2=$DIR_UDUNITS --with-uuid=$DIR_UUID

make
make install

date
