Compiling and Linking

From WikiROMS
Jump to navigationJump to search
Compiling and Linking

GNU make

To compile ROMS, first check to make sure that you have GNU make on your system. Typing "make -v" or "gmake -v" should bring up a message such as:

GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

You want to have at least version 3.80, and 3.81 behaves better on some systems. If you don't have a fairly modern GNU make, it is freely available and quite portable.

NetCDF

You will also need to have the Netcdf library, F90 interface, installed on your system. Tell ROMS how to find it according to the directions in makefile. Notice that there are several machine-dependent make include files in the Compilers sub-directory. For example, the locations of the NetCDF include and library directories are specified in file Linux-pgi.mk as:

NETCDF_INCDIR ?= /opt/pgisoft/netcdf/include
NETCDF_LIBDIR ?= /opt/pgisoft/netcdf/lib

We recommend you to install both the Fortran F77 and F90 interfaces of the NetCDF library.

User Changes

There are several user-defined switches in the makefile, as described here.

Compiling

Check over your cppdefs.h and Functionals one last time, check your choices as listed in makefile, then launch make or the build Script.

To understand the compilation process and the ROMS makefile, read about make and gmake.