/[MITgcm]/MITgcm/tools/build_options/darwin_ia32_gfortran
ViewVC logotype

Contents of /MITgcm/tools/build_options/darwin_ia32_gfortran

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download)
Mon Mar 19 15:08:32 2012 UTC (12 years, 2 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint63l, checkpoint63m, checkpoint63n
Changes since 1.13: +5 -2 lines
update NOOPTFILES/FLAGS but leave old candidate in commented lines, so
that we do not forget them

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/darwin_ia32_gfortran,v 1.13 2011/09/20 15:40:21 mlosch Exp $
4 # $Name: $
5
6 # Tested on MacBook Pro with Snow Leopard
7 #- on 20-Nov-2009, without MPI:
8 # gcc and gfortran obtained from
9 # http://hpc.sourceforge.net/
10 # http://prdownloads.sourceforge.net/hpc/gcc-snwleo-intel-bin.tar.gz?download
11 # http://prdownloads.sourceforge.net/hpc/gfortran-snwleo-intel-bin.tar.gz?download
12 #
13 # gfortran (version 4.6.0)
14 # OpenMPI (version 1.4.3)
15
16 #-- Note: default location of NetCDF & MPI setting provided in this optfile
17 # are not standard. For this reason, you might need:
18 # 1) to set NETCDF_ROOT to where the NetCDF is installed, e.g.:
19 # export NETCDF_ROOT='/usr/NetCDF'
20 # 2) for MPI, to set environment variable MPI_INC_DIR to the include
21 # directory of your MPI implementation
22
23 if test "x$MPI" = xtrue ; then
24 # CC=mpicc
25 FC=mpif90
26 LINK=$FC
27 else
28 # CC=gcc
29 FC=gfortran
30 LINK=$FC
31 fi
32
33 #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) _ ## X ## _"
34 #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X"
35 #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _"
36 # for adjoint runs we might need this
37 #MAKEDEPEND=cyrus_makedepend
38
39 S64='$(TOOLSDIR)/set64bitConst.sh'
40 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
41 CPP='/usr/bin/cpp -traditional -P'
42 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
43
44 #Following flag is needed when using 32-bit gfortran with 64-bit gcc,
45 #as can be the case right after switching to Snow Leopard.
46 #CFLAGS='-arch i386'
47
48 NOOPTFLAGS='-O0'
49 NOOPTFILES=''
50
51 if test "x$IEEE" = x ; then #- with optimisation:
52 FFLAGS="$FFLAGS -Wunused -Wuninitialized"
53 FOPTIM='-O3 -funroll-loops'
54 NOOPTFLAGS='-O2 -funroll-loops'
55 # do we still need these?
56 # NOOPTFILES="$NOOPTFILES gad_c4_adv_x.F gad_u3_adv_x.F"
57 # add more optimization if you are bold enough
58 # FOPTIM="$FOPTIM -ftree-vectorize"
59 # with gcc version 4.6.0 20101106 (experimental) (GCC) I needed this
60 # for better optimization (with bugs), more recent versions of gfortran
61 # might not need this any longer
62 # FOPTIM='-O3 -funroll-loops -ftree-vectorize'
63 # NOOPTFLAGS='-O1 -funroll-loops -ftree-vectorize'
64 # 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'
65 else #- no optimisation + IEEE :
66 FFLAGS="$FFLAGS -Wunused -ffloat-store"
67 FOPTIM='-O0'
68 fi
69
70 FFLAGS="$FFLAGS -fsecond-underscore -fconvert=big-endian"
71 #- might want to use '-fdefault-real-8' for fizhi pkg:
72 #FFLAGS="$FFLAGS -fdefault-real-8"
73
74 INCLUDEDIRS=''
75 INCLUDES=''
76 LIBS=''
77
78 NETCDF_ROOT=/usr/local
79 if [ "x$NETCDF_ROOT" != x ] ; then
80 INCLUDES="-I${NETCDF_ROOT}/include"
81 LIBS="-L${NETCDF_ROOT}/lib"
82 else
83 #-- default NetCDF location: from former darwin_ia32_gfortran optfile:
84 # If you optain netcdf libraries from fink, this is where they will
85 # be. I found that it is easier to get everything from
86 # sourceforge.net, then the libraries will be in /usr/local
87 INCLUDES='-I/sw/include'
88 LIBS='-L/sw/lib'
89 fi
90
91 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
92 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
93 MPIINCLUDEDIR="$MPI_INC_DIR"
94 MPI_HEADER_FILES='mpif.h mpiof.h'
95 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
96 elif [ "x$MPI" = xtrue ] ; then
97 #-- default MPI header location: from former darwin_ia32_gfortran+mpi optfile:
98 INCLUDES="$INCLUDES -I/usr/local/include -I/opt/openmpi/include"
99 LIBS="$LIBS -L/usr/local/lib"
100 fi

  ViewVC Help
Powered by ViewVC 1.1.22