Warning, /tools/build_options/linux_ia32_g77 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
f10e3a8bdd Ed H*0001 #!/bin/bash
0002 #
0003 #
71dccd8c1e Jean*0004 # tested on faulks with gcc-g77 v3.4.6 (with FC 6)
0005 # tested with MPI on (old) aces cluster (gcc-g77 3.3.3, FC 2), using:
0006 # module add mpich/gnu
0007 # export MPI_INC_DIR=/usr/local/pkg/mpich/mpich-gcc/include
0008
0009 if test "x$MPI" = xtrue ; then
0010 CC='mpicc'
0011 FC='mpif77'
0012 LINK=$FC
0013 else
0014 CC='gcc'
0015 FC='g77'
0016 LINK=$FC
0017 fi
f10e3a8bdd Ed H*0018
3d93c0a01e Ou W*0019 DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4 -DNML_EXTENDED_F77 -DEXCLUDE_OPEN_ACTION'
0020 DEFINES="$DEFINES -DAUTODIFF_USE_MDSFINDUNITS -DPROFILES_USE_MDSFINDUNITS"
f10e3a8bdd Ed H*0021 CPP='cpp -traditional -P'
881ea683bc Jean*0022 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
ede1bd7ab5 Jean*0023 GET_FC_VERSION="--version"
f10e3a8bdd Ed H*0024
71dccd8c1e Jean*0025 NOOPTFLAGS='-O0'
0026 NOOPTFILES=''
0027
0028 has_sse2=f
0029 grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t
9a8f206051 Jean*0030
0031 FFLAGS="$FFLAGS -Wimplicit -Wunused"
71dccd8c1e Jean*0032
0033 if test "x$IEEE" = x ; then #- with optimisation:
9a8f206051 Jean*0034 #- note(jmc): on aces, sse & sse2 are faster; -O3 is not always faster than -O2
0035 if test "x$has_sse2" = xt ; then
0036 FFLAGS="$FFLAGS -mfpmath=sse -msse -msse2"
0037 fi
71dccd8c1e Jean*0038 #FOPTIM='-O3 -malign-double -funroll-loops'
9a8f206051 Jean*0039 # Problems with "-funroll-loops" for some set-up, e.g. tutorial_held_suarez_cs
71dccd8c1e Jean*0040 FOPTIM='-O3 -malign-double'
0041 else #- no optimisation + IEEE :
9a8f206051 Jean*0042 if test "x$has_sse2" = xt ; then
0043 FFLAGS="$FFLAGS -mfpmath=sse -msse -msse2"
0044 else
0045 FFLAGS="$FFLAGS -ffloat-store"
0046 fi
f10e3a8bdd Ed H*0047 FOPTIM='-O0 -malign-double'
0048 fi
0049
71dccd8c1e Jean*0050 CFLAGS="-O0"
0051 GSLINC=''
0052 GSLLIB='-lgsl -lgslcblas'
0053 PAPIINC='-I/usr/local/pkg/papi/papi-3.0.8.1/p4/include'
0054 PAPILIB='-L/usr/local/pkg/papi/papi-3.0.8.1/p4/lib -lpapi'
0055
0056 INCLUDEDIRS=''
0057 INCLUDES=''
0058 LIBS=''
0059
3fb63f7dce Ed H*0060 if test -d /usr/include/netcdf-3 ; then
0061 INCLUDES='-I/usr/include/netcdf-3'
45d0ab9a7b Ed H*0062 if test -d /usr/lib/netcdf-3 ; then
0063 if test -f /usr/lib/netcdf-3/libnetcdf_g77.a ; then
0064 LIBS='-L/usr/lib/netcdf-3 -lnetcdf_g77'
0065 else
0066 LIBS='-L/usr/lib/netcdf-3'
601ccc2eb9 Ed H*0067 fi
0068 fi
3fb63f7dce Ed H*0069 elif test -d /usr/include/netcdf ; then
0070 INCLUDES='-I/usr/include/netcdf'
6e7391899b Patr*0071 elif test -d /usr/local/netcdf ; then
0072 INCLUDES='-I/usr/local/netcdf/include'
0073 LIBS='-L/usr/local/netcdf/lib'
3fb63f7dce Ed H*0074 fi
45d0ab9a7b Ed H*0075
71dccd8c1e Jean*0076 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
0077 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
0078 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0079 #- used for parallel (MPI) DIVA
0080 MPIINCLUDEDIR="$MPI_INC_DIR"
0081 #MPI_HEADER_FILES='mpif.h mpiof.h'
71dccd8c1e Jean*0082 fi