next up previous contents
Next: 10 Architectural Overview Up: ESMF_usrdoc Previous: 8 Validating an ESMF   Contents


9 Compiling and Linking User Code against an ESMF Installation

Building a user application against an ESMF installation requires that the compiler and linker be able to find the appropriate ESMF header, module and library files. If this procedure has been documented by the installer of the ESMF library on your system then follow the directions given. Otherwise it is up to the user to determine and provide the required compiler and linker flags. Every ESMF installation provides a file named esmf.mk that contains the relevant information.

The location of the esmf.mk file should be documented by the party that installed ESMF on the system. We recommend that a single ESMF specific environment variable ESMFMKFILE be set to point to the esmf.mk file. See section 6.8 for the related discussion.

The information in esmf.mk is defined in form of variables. In fact, syntactically esmf.mk is a makefile fragment and can be imported by an application specific makefile via the include command. All the variables in esmf.mk start with an "ESMF_" prefix to prevent conflicts. The information in esmf.mk is fully specified and is not affected by any variables set in the user's environment.

The information defined in esmf.mk includes Fortran compiler and linker, as well as C++ compiler and linker. It further includes the Fortran and C++ specific compiler and linker flags. One way of using the esmf.mk is to glean the necessary information from it and use this information directly on the command line when compiling a user application, or to hardwire it into the application specific build system. However, the recommended use of esmf.mk is to include this file in the application specific makefile directly via the include command, and to use the defined variables to augment the application specific settings.


next up previous contents
Next: 10 Architectural Overview Up: ESMF_usrdoc Previous: 8 Validating an ESMF   Contents
esmf_support@list.woc.noaa.gov