Difference between revisions of "Compiling and Linking"

From WikiROMS
Jump to navigationJump to search
Line 16: Line 16:


You will also need to have the [http://www.unidata.ucar.edu/software/netcdf/ 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:
You will also need to have the [http://www.unidata.ucar.edu/software/netcdf/ 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:
<div class="box"><span class="red">NETCDF_INCDIR ?=</span>/opt/pgisoft/netcdf/include<br />   <span class="red">NETCDF_LIBDIR ?=</span> /opt/pgisoft/netcdf/lib</div>
<div class="box"><span class="red">NETCDF_INCDIR ?= </span>/opt/pgisoft/netcdf/include<br /><span class="red">NETCDF_LIBDIR ?= </span> /opt/pgisoft/netcdf/lib</div>
We recommend you to install both the Fortran F77 and F90 interfaces of the NetCDF library.
We recommend you to install both the Fortran F77 and F90 interfaces of the NetCDF library.



Revision as of 20:05, 11 June 2007

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.80
Copyright (C) 2002 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. 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 one last time, then you should cd to the top-level ROMS directory. From here, type "make" or "gmake" (I create an alias so as to be typing "make" on all systems). It should now be compiling and linking for you. The final executable will be called oceanS, oceanG, oceanM, or oceanO for serial, debug, MPI, or OpenMP code, respectively.

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