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

Annotation of /MITgcm/tools/build_options/darwin_amd64_gfortran

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


Revision 1.5 - (hide annotations) (download)
Sat Feb 21 02:05:05 2015 UTC (9 years, 2 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, HEAD
Changes since 1.4: +8 -3 lines
add DEVEL options for better testing on my mac

1 jmc 1.1 #!/bin/bash
2     #
3 mlosch 1.5 # $Header: /u/gcmpack/MITgcm/tools/build_options/darwin_amd64_gfortran,v 1.4 2013/07/22 18:40:45 jmc Exp $
4 jmc 1.1 # $Name: $
5    
6 jmc 1.4 # tested on MacBook Pro with Snow Leopard & Snow Lion
7 jmc 1.1 # ==> need to update folowing comments:
8     # on 20-Nov-2009
9     # gcc and gfortran obtained from
10     # http://hpc.sourceforge.net/
11     # http://prdownloads.sourceforge.net/hpc/gcc-snwleo-intel-bin.tar.gz?download
12     # http://prdownloads.sourceforge.net/hpc/gfortran-snwleo-intel-bin.tar.gz?download
13    
14     #-------
15     # need to set NETCDF_ROOT to where the NetCDF is installed, e.g.:
16     # export NETCDF_ROOT='/usr/NetCDF'
17     # MPI : need to set environment variable MPI_INC_DIR to the include
18     # directory of your MPI implementation
19    
20     #-------
21     # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
22     # and generally, needs to increase the thread stack-size:
23     # - sh,bash:
24     # > export OMP_NUM_THREADS=2
25     # > export GOMP_STACKSIZE=400m
26     # - csh,tcsh:
27     # > setenv OMP_NUM_THREADS 2
28     # > setenv GOMP_STACKSIZE 400m
29     #-------
30    
31     if test "x$MPI" = xtrue ; then
32     CC=mpicc
33     FC=mpif77
34     F90C=mpif90
35     LINK=$F90C
36     else
37     CC=gcc
38     FC=gfortran
39     F90C=gfortran
40     LINK=$F90C
41     fi
42    
43     FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _"
44     S64='$(TOOLSDIR)/set64bitConst.sh'
45     DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
46     CPP='/usr/bin/cpp -traditional -P'
47     GET_FC_VERSION="--version"
48     EXTENDED_SRC_FLAG='-ffixed-line-length-132'
49     OMPFLAG='-fopenmp'
50    
51     #MAKEDEPEND=tools_xmakedepend
52    
53     #Following flag is needed when using 32-bit gfortran with 64-bit gcc,
54     #as can be the case right after switching to Snow Leopard.
55     #CFLAGS='-arch i386'
56    
57     NOOPTFLAGS='-O0'
58     NOOPTFILES=''
59    
60     FFLAGS="$FFLAGS -fconvert=big-endian"
61     # for big objects:
62     #FFLAGS="$FFLAGS -fPIC"
63     #- might want to use '-fdefault-real-8' for fizhi pkg:
64 jmc 1.3 #FFLAGS="$FFLAGS -fdefault-real-8 -fdefault-double-8"
65 jmc 1.1
66     # For IEEE, use the "-ffloat-store" option
67     if test "x$IEEE" = x ; then
68     FFLAGS="$FFLAGS -Wunused -Wuninitialized"
69     FOPTIM='-O3 -ftree-vectorize -funroll-loops'
70     NOOPTFLAGS='-O2 -funroll-loops'
71 dimitri 1.2 # NOOPTFILES='gad_c4_adv_x.F gad_u3_adv_x.F'
72 jmc 1.1 else
73 mlosch 1.5 FFLAGS="$FFLAGS -Wall"
74     if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
75     FOPTIM='-O0'
76     else #- development/check options:
77     FOPTIM='-O0 -g -fbounds-check'
78     FOPTIM="$FOPTIM -ffpe-trap=invalid,zero,overflow -finit-real=inf"
79     fi
80 jmc 1.1 fi
81    
82     INCLUDEDIRS=''
83     INCLUDES=''
84     LIBS=''
85    
86     if [ "x$NETCDF_ROOT" != x ] ; then
87     INCLUDEDIR="${NETCDF_ROOT}/include"
88     INCLUDES="-I${NETCDF_ROOT}/include"
89     LIBDIR="${NETCDF_ROOT}/lib"
90     LIBS="-L${NETCDF_ROOT}/lib -lnetcdf -lcurl"
91     fi
92    
93     if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
94     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
95     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
96 jmc 1.4 #- used for parallel (MPI) DIVA
97 jmc 1.1 MPIINCLUDEDIR="$MPI_INC_DIR"
98 jmc 1.4 #MPI_HEADER_FILES='mpif.h mpiof.h'
99 jmc 1.1 fi
100    

  ViewVC Help
Powered by ViewVC 1.1.22