#!/bin/bash

COMPILER=intel-13
LOCAL=$(pwd)
DST=$( echo ${LOCAL}/../.. )
module load intel szip craype cray-hdf5 netcdf4/4.3.2 udunits
DIR_UUID=$DST
DIR_UDUNITS=/usr/local/apps/udunits/2.2.17
DIR_NETCDF=/usr/local/apps/netcdf4/4.3.2/INTEL/150
DIR_HDF5=/usr/local/apps/hdf5/1.8.17
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'


cd ../uuid-1.6.2
./configure --prefix=$DST
make
make install
cd -
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
