[MITgcm-support] MITgcm optfile for the latest OS/X

Constantinos Evangelinos ce107 at ocean.mit.edu
Wed Apr 7 14:46:24 EDT 2010


Just a quick note to any users of Macs that try and get the model working on 
the latest version of OS/X (64 bit capable) by modifying the existing ia32 
optfile to an amd64 version.

A few tricky things I discovered getting it to work with Pierre Rampal:
a) Installing the latest GCC (C/C++/Fortran) version 4.5 from hpc.sf.net into 
/usr/local (as suggested) results in conflicts (for gcc) with any more 
centrally installed (in /usr/bin) version of gcc and genmake2 breaks. You need 
to put in the full path to the compilers in the optfile. 

FC=/usr/local/bin/gfortran
CC=/usr/local/bin/gcc
LINK=/usr/local/bin/gfortran

b) If you build NetCDF4 with the default options with gfortran you need to:
1) Add a -lcurl in your link line next to -lnetcdf, for example
INCLUDEDIRS='/Users/Pierre/NetCDF/include'
INCLUDES='-I/Users/Pierre/NetCDF/include'
LIBS='-L/Users/Pierre/NetCDF/lib -lnetcdf -lcurl'
2) Make sure that you define
FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _"
as the old ia32 optfile assumed a netcdf library built with g77 and therefore 
used a different name mangling scheme. This will also allow genmake2 to find 
etime().
3) Delete the -fsecond-underscore flag from the optfile as it conflicts with 
the new gfortran name mangling scheme we use.

c) If on the other hand you already had a NetCDF library built with g77 (or 
built with gfortran and -fsecond-underscore for whatever reason), then you 
need to still do (b.1) above, use 
FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## __"
and skip (b.3) entirely. That however will still not allow genmake2 to use 
etime for timing etc. and I do not recommend it.

I'm attaching Pierre's optfile - if someone can clean it up and make it a bit 
more generic (without references to his home directory for example) it should 
be checked in. Also keep in mind that we have optfiles:
darwin_ia64_pgf95+mpich2-mx_trane
darwin_ia64_pgf95_trane
which do not correspond to anything meaningful (no darwin system ever used 
IA64 processors). They should be renamed to darwin_ia32_pgf95_* 

Constantinos
-- 
Dr. Constantinos Evangelinos
Department of Earth, Atmospheric and Planetary Sciences
Massachusetts Institute of Technology

-------------- next part --------------
A non-text attachment was scrubbed...
Name: darwin_amd64_gfortran
Type: application/x-shellscript
Size: 1493 bytes
Desc: not available
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20100407/8f3fd552/attachment.bin>


More information about the MITgcm-support mailing list