#!/bin/bash

TOOL=cmor-2.7.1-specs_update
COMPILER=intel-13
LOCAL=$(pwd)
DST=$( echo ${LOCAL}/../.. )
DIR_UUID=/apps/UUID/1.6.2
DIR_UDUNITS=/gpfs/projects/ecm86/opt/udunits-2.1.24/$COMPILER
DIR_NETCDF=/gpfs/projects/ecm86/opt/netcdf-4.1.3/$COMPILER
DIR_HDF5=/apps/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'

set +e
#rm -rf $DST
#mkdir -p $DST
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 check
make install

date
