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

Annotation of /MITgcm/tools/build_options/darwin_ia32_gfortran

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


Revision 1.13 - (hide annotations) (download)
Tue Sep 20 15:40:21 2011 UTC (12 years, 8 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63c
Changes since 1.12: +20 -15 lines
adjust opt file so that it works for my configuration: OS X 10.6.4
with gfortran, netcdf libraries, and OpenMPI optained from
hpc.sourceforge.net

1 dfer 1.1 #!/bin/bash
2 jmc 1.10 #
3 mlosch 1.13 # $Header: /u/gcmpack/MITgcm/tools/build_options/darwin_ia32_gfortran,v 1.12 2011/09/20 14:44:52 jmc Exp $
4 jmc 1.10 # $Name: $
5 dfer 1.1
6 jmc 1.11 # Tested on MacBook Pro with Snow Leopard
7     #- on 20-Nov-2009, without MPI:
8     # gcc and gfortran obtained from
9 dimitri 1.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 jmc 1.11 #
13 mlosch 1.13 # gfortran (version 4.6.0)
14     # OpenMPI (version 1.4.3)
15 jmc 1.11
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 dfer 1.1
33 jmc 1.11 #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) _ ## X ## _"
34     #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X"
35     #FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _"
36 mlosch 1.13 # for adjoint runs we might need this
37 jmc 1.11 #MAKEDEPEND=cyrus_makedepend
38    
39     S64='$(TOOLSDIR)/set64bitConst.sh'
40     DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
41 heimbach 1.2 CPP='/usr/bin/cpp -traditional -P'
42 jmc 1.11 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
43    
44 dimitri 1.9 #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 jmc 1.11
48 dfer 1.1 NOOPTFLAGS='-O0'
49 jmc 1.11 NOOPTFILES=''
50    
51     if test "x$IEEE" = x ; then #- with optimisation:
52 jmc 1.12 FFLAGS="$FFLAGS -Wunused -Wuninitialized"
53 dfer 1.1 FOPTIM='-O3 -funroll-loops'
54 dfer 1.4 NOOPTFLAGS='-O2 -funroll-loops'
55     NOOPTFILES='gad_c4_adv_x.F gad_u3_adv_x.F'
56 mlosch 1.13 # with gcc version 4.6.0 20101106 (experimental) (GCC) I needed this
57     # for better optimization (with bugs), more recent versions of gfortran
58     # might not need this any longer
59     # FOPTIM='-O3 -funroll-loops -ftree-vectorize'
60     # NOOPTFLAGS='-O1 -funroll-loops -ftree-vectorize'
61     # 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'
62 jmc 1.11 else #- no optimisation + IEEE :
63 jmc 1.12 FFLAGS="$FFLAGS -Wunused -ffloat-store"
64 dfer 1.1 FOPTIM='-O0'
65     fi
66    
67 mlosch 1.13 FFLAGS="$FFLAGS -fsecond-underscore -fconvert=big-endian"
68     #- might want to use '-fdefault-real-8' for fizhi pkg:
69     #FFLAGS="$FFLAGS -fdefault-real-8"
70    
71 jmc 1.11 INCLUDEDIRS=''
72     INCLUDES=''
73     LIBS=''
74    
75 mlosch 1.13 NETCDF_ROOT=/usr/local
76 jmc 1.11 if [ "x$NETCDF_ROOT" != x ] ; then
77     INCLUDES="-I${NETCDF_ROOT}/include"
78     LIBS="-L${NETCDF_ROOT}/lib"
79     else
80     #-- default NetCDF location: from former darwin_ia32_gfortran optfile:
81 mlosch 1.13 # If you optain netcdf libraries from fink, this is where they will
82     # be. I found that it is easier to get everything from
83     # sourceforge.net, then the libraries will be in /usr/local
84 jmc 1.11 INCLUDES='-I/sw/include'
85     LIBS='-L/sw/lib'
86     fi
87 dfer 1.1
88 jmc 1.11 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
89     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
90     MPIINCLUDEDIR="$MPI_INC_DIR"
91     MPI_HEADER_FILES='mpif.h mpiof.h'
92     MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
93     elif [ "x$MPI" = xtrue ] ; then
94     #-- default MPI header location: from former darwin_ia32_gfortran+mpi optfile:
95 mlosch 1.13 INCLUDES="$INCLUDES -I/usr/local/include -I/opt/openmpi/include"
96     LIBS="$LIBS -L/usr/local/lib"
97 jmc 1.11 fi

  ViewVC Help
Powered by ViewVC 1.1.22