Back to home page

MITgcm

 
 

    


Warning, /tools/build_options/linux_amd64_sunf90 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
a55812cda4 Cons*0001 #!/bin/bash
                0002 #
70359a3597 Jean*0003 # Build options for the Sun fortran compiler (with and without MPI)
                0004 #            on Linux AMD64 platform
                0005 # MPI : need to set environment variable MPI_INC_DIR to the include
                0006 #       directory of your MPI implementation
                0007 
                0008 if test "x$MPI" = xtrue ; then
                0009   CC=${CC:=mpicc}
                0010   FC=${FC:=mpif77}
                0011   F90C=${F90C:=mpif90}
                0012   LINK=${F90C}
                0013 else
                0014   CC='cc'
                0015   FC='f77'
                0016   F90C='f90'
                0017   LINK=${F90C}
                0018 fi
                0019 
8cfe52d849 Cons*0020 FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _"
a55812cda4 Cons*0021 DEFINES='-DWORDLENGTH=4'
                0022 CPP='cpp  -traditional -P'
8cfe52d849 Cons*0023 EXTENDED_SRC_FLAG='-e'
                0024 OMPFLAG='-xopenmp'
a55812cda4 Cons*0025 
70359a3597 Jean*0026 NOOPTFLAGS='-O0 -g'
                0027 NOOPTFILES=''
                0028 
                0029 FFLAGS="$FFLAGS -m64 -xfilebyteorder=big16:%all -u"
                0030 #FFLAGS="$FFLAGS -r8const"
                0031 # for big objects:
                0032 FFLAGS="$FFLAGS -Kpic"
                0033 
a55812cda4 Cons*0034 if test "x$DEVEL" != x ; then
70359a3597 Jean*0035     FFLAGS="$FFLAGS -g -xs -C -xcommonchk -xcheck=init_local -fpover"
                0036     OMPFLAG='-xopenmp=noopt'
a55812cda4 Cons*0037 fi
                0038 
70359a3597 Jean*0039 if test "x$IEEE" = x ; then     #- with optimisation:
                0040     FOPTIM='-fast -xvector=simd -xpad=local'
                0041     LIBS="$LIBS -lmopt"   #- but get overwritten during NETCDF libs setting below
                0042 else                            #- no optimisation + IEEE :
                0043 #   FOPTIM='-O0'
                0044     FOPTIM='-fast -xpad=local -fsimple=1'
a55812cda4 Cons*0045 fi
70359a3597 Jean*0046 
a55812cda4 Cons*0047 F90FLAGS=$FFLAGS
                0048 F90OPTIM=$FOPTIM
70359a3597 Jean*0049 CFLAGS='-O0 -m64 -Kpic'
                0050 
                0051 INCLUDEDIRS=''
                0052 INCLUDES=''
                0053 #LIBS=''
a55812cda4 Cons*0054 
                0055 if [ "x$NETCDF_ROOT" != x ] ; then
                0056     INCLUDEDIR="${NETCDF_ROOT}/include"
                0057     INCLUDES="-I${NETCDF_ROOT}/include"
                0058     LIBDIR="${NETCDF_ROOT}/lib"
                0059     LIBS="-L${NETCDF_ROOT}/lib"
                0060 elif [ "x$NETCDF_HOME" != x ]; then
                0061     INCLUDEDIR="${NETCDF_HOME}/include"
                0062     INCLUDES="-I${NETCDF_HOME}/include"
                0063     LIBDIR="${NETCDF_HOME}/lib"
                0064     LIBS="-L${NETCDF_HOME}/lib"
                0065 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
                0066     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
                0067     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
                0068     INCLUDEDIR="${NETCDF_INC}"
                0069     INCLUDES="-I${NETCDF_INC}"
                0070     LIBDIR="${NETCDF_LIB}"
                0071     LIBS="-L${NETCDF_LIB}"
                0072 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
                0073     INCLUDEDIR="${NETCDF_INCDIR}"
                0074     INCLUDES="-I${NETCDF_INCDIR}"
                0075     LIBDIR="${NETCDF_LIBDIR}"
                0076     LIBS="-L${NETCDF_LIBDIR}"
                0077 elif test -d /usr/include/netcdf-3 ; then
                0078     INCLUDES='-I/usr/include/netcdf-3'
                0079     LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
                0080 elif test -d /usr/include/netcdf ; then
                0081     INCLUDES='-I/usr/include/netcdf'
                0082 elif test -d /usr/local/netcdf ; then
                0083     INCLUDES='-I/usr/local/netcdf/include'
                0084     LIBS='-L/usr/local/netcdf/lib'
                0085 elif test -d /usr/local/include/netcdf.inc ; then
                0086     INCLUDES='-I/usr/local/include'
8cfe52d849 Cons*0087     LIBS='-L/usr/local/lib64 -L/usr/local/lib'
a55812cda4 Cons*0088 fi
                0089 
70359a3597 Jean*0090 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
                0091     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
                0092     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0093     #- used for parallel (MPI) DIVA
70359a3597 Jean*0094     MPIINCLUDEDIR="$MPI_INC_DIR"
15978f0412 Jean*0095    #MPI_HEADER_FILES=${MPI_HEADER_FILES:='mpif.h mpiof.h'}
70359a3597 Jean*0096 fi
                0097 
                0098