#!/bin/bash

LOCAL=$(pwd)
DST=$( echo ${LOCAL}/../.. )
DIR_UUID=/home/pabretonniere/transfer/specs2cmor-1.0/libs
DIR_NETCDF=/opt/software/netCDF/4.3.1.1-ictce-6.1.5
DIR_HDF5=/opt/software/HDF5/1.8.12-ictce-6.1.5-zlib-1.2.8

module load ictce/6.1.5
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'


export LDFLAGS="-ludunits2"
set +e

make clean
set -e

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

make
make install

date
