Warning, /tools/build_options/linux_amd64_gfortran_greenplanet is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
0f0f7746ea Yun *0001 #!/bin/bash
0002 #
0003 #
0004 # tested on greenplanet.ps.uci.edu
0005 # Linux greenplanet.ps.uci.edu 2.6.18-128.el5 #1 SMP Wed Jan 21 10:41:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
0006 # GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
0007 # Copyright (C) 2007 Free Software Foundation, Inc.
0008
0009 FC=gfortran
0010 F90C=gfortran
0011 CC=gcc
0012 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
0013 CPP='cpp -traditional -P'
0014 NOOPTFLAGS='-O0'
0015 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
0016 OMPFLAG='-fopenmp'
0017
0018 if test "x$DEVEL" != x ; then
0019 FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
0020 else
0021 FFLAGS=''
0022 fi
0023
0024 # Requires gfortran from 2006 onwards for -fconvert=big-endian
0025 FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
0026
0027 if test "x$IEEE" = x ; then
0028 # No need for IEEE-754
0029 FOPTIM='-O3 -funroll-loops'
0030 else
0031 # Try to follow IEEE-754
0032 # these may also be useful, but require specific gfortran versions:
0033 # -Wnonstd-intrinsics for gfortran <= 4.3
0034 # -Wintrinsics-std for gfortran >= 4.4
0035 # -Wno-tabs for gfortran >= 4.3
0036 FFLAGS="$FFLAGS -Waliasing -Wampersand -Wsurprising -Wline-truncation"
0037 # to get plenty of warnings :
0038 # FFLAGS="$FFLAGS -Wconversion -Wimplicit-interface -Wunused-labels"
0039 FOPTIM='-O0'
0040 # for automatic testing with testreport (but no relation with IEEE arithmetic):
0041 FOPTIM="$FOPTIM -g -ffpe-trap=invalid,zero,overflow -fbounds-check"
0042 fi
0043 F90FLAGS=$FFLAGS
0044 F90OPTIM=$FOPTIM
0045 CFLAGS=$FOPTIM
0046
0047 if [ "x$NETCDF_ROOT" != x ] ; then
0048 INCLUDEDIR="${NETCDF_ROOT}/include"
0049 INCLUDES="-I${NETCDF_ROOT}/include"
0050 LIBDIR="${NETCDF_ROOT}/lib"
0051 LIBS="-L${NETCDF_ROOT}/lib"
0052 elif [ "x$NETCDF_HOME" != x ]; then
0053 INCLUDEDIR="${NETCDF_HOME}/include"
0054 INCLUDES="-I${NETCDF_HOME}/include"
0055 LIBDIR="${NETCDF_HOME}/lib"
0056 LIBS="-L${NETCDF_HOME}/lib"
0057 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
0058 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
0059 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
0060 INCLUDEDIR="${NETCDF_INC}"
0061 INCLUDES="-I${NETCDF_INC}"
0062 LIBDIR="${NETCDF_LIB}"
0063 LIBS="-L${NETCDF_LIB}"
0064 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
0065 INCLUDEDIR="${NETCDF_INCDIR}"
0066 INCLUDES="-I${NETCDF_INCDIR}"
0067 LIBDIR="${NETCDF_LIBDIR}"
0068 LIBS="-L${NETCDF_LIBDIR}"
0069 elif test -d /sopt/netcdf/netcdf3-gcc-serial; then
0070 INCLUDES='-I/sopt/netcdf/netcdf3-gcc-serial/include'
0071 LIBS='-L/sopt/netcdf/netcdf3-gcc-serial/lib'
0072 elif test -d /usr/include/netcdf ; then
0073 INCLUDES='-I/usr/include/netcdf'
0074 elif test -d /usr/local/netcdf ; then
0075 INCLUDES='-I/usr/local/netcdf/include'
0076 LIBS='-L/usr/local/netcdf/lib'
0077 elif test -d /usr/local/include/netcdf.inc ; then
0078 INCLUDES='-I/usr/local/include'
0079 LIBS='-L/usr/local/lib64'
0080 fi