#!/bin/bash
# $Id: ropp_configure_pgf15_linux 4626 2015-10-27 14:14:28Z frdo $
#
# ROPP shell script for a local configure.
# USERS SHOULD MODIFY THIS SCRIPT AS REQUIRED FOR LOCAL INSTALL
#
# Compiler: pgf15 / Linux
# 
PREFIX=${1-$ROPP_ROOT/pgf15}
echo
echo "Platform:"
uname -a
echo
echo "Fortran compiler:"
version=$(pgf15 --version)
echo $version
ver=$(echo $version | cut -d" " -f4)
ver=${ver:0:4}
bits=$(echo $version | cut -d" " -f5)
if [[ $bits == "64-bit" ]]; then
  bits="-64"
else
  bits=""
fi
pgfinc=/opt/pgi/linux86$bits/$ver/include
pgflib=/opt/pgi/linux86$bits/$ver/lib
echo
echo "C compiler:"
gcc --version
echo
echo "Installation target:"
echo "$PREFIX"
echo
#
CC=gcc \
F77=pgf15    FFLAGS="-O2 -tp penryn-64 -Mbackslash -I$PREFIX/include -I$pgfinc" \
FC=pgf15    FCFLAGS="-O2 -tp penryn-64 -Mbackslash -I$PREFIX/include -I$pgfinc" \
            LDFLAGS="-L$PREFIX/lib   -L$PREFIX/lib64   -L$pgflib" \
  ./configure --prefix=$PREFIX
