Back to home page

MITgcm

 
 

    


Warning, /tools/build_options/linux_amd64_pgf77 is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit 3d93c0a0 on 2022-04-13 15:21:38 UTC
21b2fdfa03 Cons*0001 #!/bin/bash
                0002 #
                0003 #
b5e9ff1a88 Jean*0004 # Build options for PGI compiler on Linux AMD64 platform
21b2fdfa03 Cons*0005 #
b5e9ff1a88 Jean*0006 # tested with PGI version 10.9 on baudelaire (Linux 2.6.34.7-61.fc13.x86_64), using:
                0007 #   -  sh,bash:
                0008 #     > export PGI=/srv/software/pgi/pgi-10.9
                0009 #     > export PATH=$PGI/linux86-64/10.9/bin:$PATH
                0010 #     > export MANPATH=$MANPATH:$PGI/linux86-64/10.9/man
                0011 #     > export LM_LICENSE_FILE=$PGI/license.dat
                0012 #   - csh,tcsh:
                0013 #     > setenv PGI /srv/software/pgi/pgi-10.9
                0014 #     > set path=($PGI/linux86-64/10.9/bin $path)
                0015 #     > setenv MANPATH "$MANPATH":$PGI/linux86-64/10.9/man
                0016 #     > setenv LM_LICENSE_FILE $PGI/license.dat
856b9b1eb1 Jean*0017 #
                0018 # and tested also with MPI on acesgrid (Fedora Core 15), using:
                0019 #       module load pgi     (Version 11.7)
                0020 #   and with mpich2:
                0021 #       module load mvapich2
bf33f90720 Jean*0022 #   or  with openmpi: (support also OpenMP to run mpi+mth)
856b9b1eb1 Jean*0023 #       module load openmpi
bf33f90720 Jean*0024 
                0025 #-------
                0026 # compile (genmake2 -omp) and run with OpenMP: needs to set environment var.
                0027 #    OMP_NUM_THREADS and generally, needs to increase the thread stack-size:
                0028 #   -  sh,bash:
                0029 #     > export OMP_NUM_THREADS=2
                0030 #     > export OMP_STACKSIZE=400m
                0031 #   - csh,tcsh:
                0032 #     > setenv OMP_NUM_THREADS 2
                0033 #     > setenv OMP_STACKSIZE 400m
b5e9ff1a88 Jean*0034 #-------
21b2fdfa03 Cons*0035 
856b9b1eb1 Jean*0036 if test "x$MPI" = xtrue ; then
                0037   CC=mpicc
                0038   FC=mpif77
cedeab88a7 Jean*0039   F90C=mpif90
856b9b1eb1 Jean*0040 else
                0041   CC=pgcc
                0042   FC=pgf77
cedeab88a7 Jean*0043   F90C=pgf90
856b9b1eb1 Jean*0044 fi
d568843b75 Jean*0045 
cedeab88a7 Jean*0046 DEFINES="-DWORDLENGTH=4"
                0047 if test "x$ALWAYS_USE_F90" = x1 ; then
                0048     FC=$F90C
                0049 else
3d93c0a01e Ou W*0050     DEFINES="$DEFINES -DNML_EXTENDED_F77 -DEXCLUDE_OPEN_ACTION"
cedeab88a7 Jean*0051 fi
b5e9ff1a88 Jean*0052 CPP='cpp -traditional -P'
409053c384 Jean*0053 F90FIXEDFORMAT='-Mfixed'
d568843b75 Jean*0054 EXTENDED_SRC_FLAG='-Mextend'
b5e9ff1a88 Jean*0055 GET_FC_VERSION="-V"
bf33f90720 Jean*0056 OMPFLAG='-mp'
d568843b75 Jean*0057 
                0058 NOOPTFLAGS='-O0'
856b9b1eb1 Jean*0059 NOOPTFILES=''
                0060 
                0061 FFLAGS="$FFLAGS -byteswapio -Ktrap=fp"
                0062 #- might want to use '-r8' for fizhi pkg:
                0063 #FFLAGS="$FFLAGS -r8"
d568843b75 Jean*0064 
856b9b1eb1 Jean*0065 if test "x$IEEE" = x ; then     #- with optimisation:
b5e9ff1a88 Jean*0066     FOPTIM='-tp k8-64 -pc=64 -O2 -Mvect=sse'
                0067    #FOPTIM="$FOPTIM -fastsse -O3 -Msmart -Mvect=cachesize:1048576,transform"
856b9b1eb1 Jean*0068 else                            #- no optimisation + IEEE :
                0069    #FFLAGS="$FFLAGS -Mdclchk"  #- pkg/zonal_filt does not pass with declaration-check
b5e9ff1a88 Jean*0070     FOPTIM='-pc=64 -O0 -Kieee'
21b2fdfa03 Cons*0071 fi
                0072 
409053c384 Jean*0073 F90FLAGS=$FFLAGS
                0074 F90OPTIM=$FOPTIM
                0075 
856b9b1eb1 Jean*0076 INCLUDEDIRS=''
                0077 INCLUDES=''
                0078 LIBS=''
                0079 
d15ddcf60a Jean*0080 if [ "x$NETCDF_ROOT" != x ] ; then
                0081     INCLUDEDIR="${NETCDF_ROOT}/include"
                0082     INCLUDES="-I${NETCDF_ROOT}/include"
                0083     LIBDIR="${NETCDF_ROOT}/lib"
                0084     LIBS="-L${NETCDF_ROOT}/lib"
                0085 elif [ "x$NETCDF_HOME" != x ]; then
                0086     INCLUDEDIR="${NETCDF_HOME}/include"
                0087     INCLUDES="-I${NETCDF_HOME}/include"
                0088     LIBDIR="${NETCDF_HOME}/lib"
                0089     LIBS="-L${NETCDF_HOME}/lib"
                0090 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
                0091     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
                0092     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
                0093     INCLUDEDIR="${NETCDF_INC}"
                0094     INCLUDES="-I${NETCDF_INC}"
                0095     LIBDIR="${NETCDF_LIB}"
                0096     LIBS="-L${NETCDF_LIB}"
                0097 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
                0098     INCLUDEDIR="${NETCDF_INCDIR}"
                0099     INCLUDES="-I${NETCDF_INCDIR}"
                0100     LIBDIR="${NETCDF_LIBDIR}"
                0101     LIBS="-L${NETCDF_LIBDIR}"
                0102 fi
                0103 
856b9b1eb1 Jean*0104 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
                0105     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
                0106     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0107     #- used for parallel (MPI) DIVA
856b9b1eb1 Jean*0108     MPIINCLUDEDIR="$MPI_INC_DIR"
15978f0412 Jean*0109    #MPI_HEADER_FILES='mpif.h mpiof.h'
856b9b1eb1 Jean*0110 fi