Version 8 (modified by chauvin, 15 years ago) (diff) |
---|
Installing the gfortran compiler
gfortran 4.2.3 available on the site http://r.research.att.com/tools/
Generating NETCDF modules and library
The following script is executed in the directory netcdf-3.6.1. gcc-4.0 comes from the XCode (Mac OS X 10.5.8). Flags avoid conflicts between C and Fortran during the library compilation.
#!/bin/sh export FC=gfortran export F90=gfortran export F77=gfortran export FFLAGS='-O3 -ff2c' export F90FLAGS='-O3 -ff2c' export CC=gcc-4.0 export CPPFLAGS='-Df2cFortran' ./configure --prefix=/usr/local/netcdf-3.6.1/gfortran
Compiling NEMO
Compiler options in NEMO/build/config : The debugging option has to be -dwarf-2 (and not -g). The optimizing option -O3 is ok too.
NETCDF_INCLUDE=/usr/local/netcdf-3.6.1/gfortran/include NETCDF_LIB=-L/usr/local/netcdf-3.6.1/gfortran/lib -lnetcdf CPP=cpp CPPFLAGS=-traditional -P AR=ar ARFLAGS=cvr FC=gfortran FCFLAGS= -c -gdwarf-2 -fdefault-real-8 -ffree-line-length-none -I$(NETCDF_INCLUDE) -I$(NEMOLIB) FCFLAGSF90= -c -gdwarf-2 -fdefault-real-8 -ffree-line-length-none -I$(NETCDF_INCLUDE) -I$(NEMOLIB) LDFLAGS= -gdwarf-2 -free-line-length-none -o
Compiling NEMOVAR
Link with the lapack library is needed (conjgrad).