Back to home page

MITgcm

 
 

    


Warning, /tools/build_options/darwin_ia32_gfortran 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
1c397ce2f5 Davi*0001 #!/bin/bash
                0002 #
d65194ce66 Jean*0003 # Tested on MacBook Pro with Snow Leopard
                0004 #- on 20-Nov-2009, without MPI:
                0005 #    gcc and gfortran obtained from
4f411f0cfe Dimi*0006 # http://hpc.sourceforge.net/
                0007 # http://prdownloads.sourceforge.net/hpc/gcc-snwleo-intel-bin.tar.gz?download
                0008 # http://prdownloads.sourceforge.net/hpc/gfortran-snwleo-intel-bin.tar.gz?download
d65194ce66 Jean*0009 #
15978f0412 Jean*0010 #    gfortran (version 4.6.0)
a4d78fe466 Mart*0011 #    OpenMPI (version 1.4.3)
d65194ce66 Jean*0012 
15978f0412 Jean*0013 #-- Note: default location of NetCDF & MPI setting provided in this optfile
d65194ce66 Jean*0014 #         are not standard. For this reason, you might need:
                0015 #    1) to set NETCDF_ROOT to where the NetCDF is installed, e.g.:
                0016 #       export NETCDF_ROOT='/usr/NetCDF'
                0017 #    2) for MPI, to set environment variable MPI_INC_DIR to the include
                0018 #       directory of your MPI implementation
                0019 
                0020 if test "x$MPI" = xtrue ; then
                0021 # CC=mpicc
                0022   FC=mpif90
                0023   LINK=$FC
                0024 else
                0025 # CC=gcc
                0026   FC=gfortran
                0027   LINK=$FC
                0028 fi
                0029 
                0030 #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) _ ## X ## _"
                0031 #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X"
                0032 #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _"
a4d78fe466 Mart*0033 # for adjoint runs we might need this
1f0afb11b9 Jean*0034 #MAKEDEPEND=tools_xmakedepend
1c397ce2f5 Davi*0035 
d65194ce66 Jean*0036 S64='$(TOOLSDIR)/set64bitConst.sh'
                0037 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
4b37fb239b Patr*0038 CPP='/usr/bin/cpp -traditional -P'
d65194ce66 Jean*0039 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
                0040 
4f411f0cfe Dimi*0041 #Following flag is needed when using 32-bit gfortran with 64-bit gcc,
                0042 #as can be the case right after switching to Snow Leopard.
                0043 #CFLAGS='-arch i386'
1c397ce2f5 Davi*0044 
d65194ce66 Jean*0045 NOOPTFLAGS='-O0'
                0046 NOOPTFILES=''
4b37fb239b Patr*0047 
1f0afb11b9 Jean*0048 FFLAGS="$FFLAGS -fsecond-underscore -fconvert=big-endian"
                0049 #- might want to use '-fdefault-real-8' for fizhi pkg:
                0050 #FFLAGS="$FFLAGS -fdefault-real-8 -fdefault-double-8"
                0051 
d65194ce66 Jean*0052 if test "x$IEEE" = x ; then     #- with optimisation:
431ec0a8b4 Jean*0053     FFLAGS="$FFLAGS -Wunused -Wuninitialized"
1c397ce2f5 Davi*0054     FOPTIM='-O3 -funroll-loops'
4acbd9b33b Davi*0055     NOOPTFLAGS='-O2 -funroll-loops'
158570ee51 Mart*0056 # do we still need these?
                0057 #    NOOPTFILES="$NOOPTFILES gad_c4_adv_x.F gad_u3_adv_x.F"
                0058 # add more optimization if you are bold enough
                0059 #    FOPTIM="$FOPTIM -ftree-vectorize"
a4d78fe466 Mart*0060 # with gcc version 4.6.0 20101106 (experimental) (GCC) I needed this
                0061 # for better optimization (with bugs), more recent versions of gfortran
                0062 # might not need this any longer
                0063 #    FOPTIM='-O3 -funroll-loops -ftree-vectorize'
                0064 #    NOOPTFLAGS='-O1 -funroll-loops -ftree-vectorize'
                0065 #    NOOPTFILES='exch2_uv_agrid_3d_r4.F exch2_uv_agrid_3d_r8.F exch2_uv_agrid_3d_rl.F exch2_uv_agrid_3d_rs.F exch2_uv_bgrid_3d_r4.F exch2_uv_cgrid_3d_r4.F exch2_uv_cgrid_3d_r8.F exch2_uv_cgrid_3d_rl.F exch2_uv_cgrid_3d_rs.F exch_uv_agrid_3d_r8.F exch_uv_agrid_3d_rl.F exch_uv_agrid_3d_rs.F'
d65194ce66 Jean*0066 else                            #- no optimisation + IEEE :
431ec0a8b4 Jean*0067     FFLAGS="$FFLAGS -Wunused -ffloat-store"
1c397ce2f5 Davi*0068     FOPTIM='-O0'
                0069 fi
                0070 
d65194ce66 Jean*0071 INCLUDEDIRS=''
                0072 INCLUDES=''
                0073 LIBS=''
1c397ce2f5 Davi*0074 
a4d78fe466 Mart*0075 NETCDF_ROOT=/usr/local
d65194ce66 Jean*0076 if [ "x$NETCDF_ROOT" != x ] ; then
                0077     INCLUDES="-I${NETCDF_ROOT}/include"
                0078     LIBS="-L${NETCDF_ROOT}/lib"
                0079 else
                0080     #-- default NetCDF location: from former darwin_ia32_gfortran optfile:
a4d78fe466 Mart*0081     #   If you optain netcdf libraries from fink, this is where they will
                0082     #   be. I found that it is easier to get everything from
                0083     #   sourceforge.net, then the libraries will be in /usr/local
d65194ce66 Jean*0084     INCLUDES='-I/sw/include'
                0085     LIBS='-L/sw/lib'
                0086 fi
                0087 
                0088 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
                0089     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
15978f0412 Jean*0090     #- used for parallel (MPI) DIVA
d65194ce66 Jean*0091     MPIINCLUDEDIR="$MPI_INC_DIR"
15978f0412 Jean*0092    #MPI_HEADER_FILES='mpif.h mpiof.h'
d65194ce66 Jean*0093 elif [ "x$MPI" = xtrue ] ; then
                0094     #-- default MPI header location: from former darwin_ia32_gfortran+mpi optfile:
a4d78fe466 Mart*0095     INCLUDES="$INCLUDES -I/usr/local/include -I/opt/openmpi/include"
                0096     LIBS="$LIBS -L/usr/local/lib"
d65194ce66 Jean*0097 fi