#!/bin/bash
# $Id: grib_configure_sunf95_linux-suncc 4998 2016-07-08 20:28:24Z frdo $
#
# GRIB shell script for a local configure for ROPP
# USERS SHOULD MODIFY THIS SCRIPT AS REQUIRED FOR LOCAL INSTALL
#
# Compiler: sunf95 / Linux
#
PREFIX=${1-$ROPP_ROOT/sunf95}
echo
echo "Platform:"
uname -a
echo
echo "Fortran compiler:"
sunf95 -V
echo
echo "C compiler:"
suncc --version
echo
echo "Installation target:"
echo "$PREFIX"
echo
#
# The following is needed so that configure can find where
# libmtsk.so lives. This assumes suncc is directly in PATH and
# is not found via a softlink. Modify 'sunroot' and/or 'sunlibs'
# if this bit of code doesn't work for you.
sunpath=$(which suncc)
sunroot=${sunpath%/bin/suncc}
sunlibs=$sunroot/prod/lib/compilers/rtlibs/usr/lib/amd64
#
CC=suncc     CFLAGS="-O2 -w -fPIC -m64 -DsunFortran -L$sunlibs" \
FC=sunf95   FCFLAGS="-O  -w -L$sunlibs" \
F77=sunf95   FFLAGS="-O  -w -L$sunlibs" \
              FLIBS="" LDFLAGS="" \
  ./configure --prefix=$PREFIX --disable-jpeg --disable-shared

# NOTE: suncc / sunf95  cannot build shared libaries,
# hence the --disable-shared flag.
