#!/bin/bash
# $Id: ropp_configure_pgf11_linux 3752 2013-07-09 18:55:03Z frdo $
#
# ROPP shell script for a local configure.
# USERS SHOULD MODIFY THIS SCRIPT AS REQUIRED FOR LOCAL INSTALL
#
# Compiler: pgf11 / Linux
# 
PREFIX=${1-$ROPP_ROOT/pgf11}
echo
echo "Platform:"
uname -a
echo
echo "Fortran compiler:"
version=$(pgf11 --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=pgf11    FFLAGS="-O2 -Mbackslash -I$PREFIX/include -I$pgfinc" \
FC=pgf11    FCFLAGS="-O2 -Mbackslash -I$PREFIX/include -I$pgfinc" \
            LDFLAGS="-L$PREFIX/lib   -L$PREFIX/lib64   -L$pgflib" \
  ./configure --prefix=$PREFIX
