Installation with Intel Fortran

Generic information for compiling with FCM

according to your compiler and the path to netcdf,
$ cd $chemin/nemovar/build
$ ./fcmvmake.ksh -t $basepath -c $compil_target 

Generating static libraries with ifort

The actual version of ifort (11.1) contains a bug when compiled on Mac OS: The linker (ranlib) does not find objects associated to global variables defined in some modules of NEMO:

ifort model.o libopa.a libioipsl.a  -L/usr/local/netcdf-3.6.1/intel/lib -lnetcdf -O3 -o  ../opa_exe.ORCA2_Z31.1.1
Undefined symbols:
  "_asmpar_mp_nitdin_r_", referenced from:

These particular modules contains only global variables, and no CONTAINS section (ie no subroutines). The temporary solution is to add the option -c to ranlib:

ranlib -c :
 Include  common symbols as definitions with respect to the table
             of contents.  This is seldom the intended behavior  for  linking
             from  a  library,  as  it forces the linking of a library member
             just because it uses an uninitialized global that  is  undefined
             at  that  point  in  the  linking.  This option is included only
             because this was the original behavior of ranlib.   This  option
             is not the default.

Adding the option -c to ranlib in fcm

No building tool ranlib is available in fcm 1.3 . A solution is to insert the following lines in your nemo.cfg:

bld::tool::ar ar_mac

and create a script ar_mac

ar rs $@ || exit 1
ranlib -c $1 || exit 1

Alternative solution (found by Rachid)

##bld::tool::ar      ar
bld::tool::ar      libtool
bld::tool::arflags -c -s -o

Generating NETCDF modules and library

The following script is executed in the directory netcdf-3.6.1/src The compilers come from the intel web site, and installed on a Mac OS X 10.5.8 (Leopard). Flags avoid conflicts between C and Fortran during the library compilation.

export FC=ifort
export F90=ifort
export F77=ifort

export CFLAGS='-O3'
export CC=icc
export CXX=icpc
export CPPFLAGS=' -DNDEBUG -DpgiFortran'

If problems persists: useful tips on the unidata server, known problems

Miscellaneous useful informations

  • yellow, brown refers to the path where the source code lies
  • yellow, brown is a user defined name, referring to the compilation environment.
  • Useful : the ROMS Mac installation page
  • Some compiling options for netcdf on intel page
Last modified 11 years ago Last modified on 2009-10-13T18:13:09+02:00