Skip to content

Latest commit

 

History

History
203 lines (147 loc) · 8.8 KB

build.adoc

File metadata and controls

203 lines (147 loc) · 8.8 KB

Building the Executable

This section describes how to build the source code and create LDT’s executable: named LDT.

Please see Section [sec-important_note_fs] for information regarding using a case sensitive file system for compiling/running LDT.

LISF Dependencies

Please first read the companion document LISF Installation Guide. This document describes the required and optional libraries used by LISF. It also describes the supported development environments.

Build Instructions

Step 1

Perform the steps described in Section [sec-obtain-src] to obtain the source code.

Step 2

Go to the $WORKING directory. This directory contains two scripts for building the LDT executable: configure and compile.

Step 3

Set the LDT_ARCH environment variable based on the system you are using. The following commands are written using Bash shell syntax.

For a Linux system with the Intel Fortran compiler
% export LDT_ARCH=linux_ifc
For a Linux system with the GNU Fortran compiler
% export LDT_ARCH=linux_gfortran
For a Cray system with the Intel Fortran compiler
% export LDT_ARCH=cray_ifc
For a Cray system with the Cray Fortran compiler
% export LDT_ARCH=cray_cray
For an IBM system with the GNU Fortran compiler
% export LDT_ARCH=ibm_gfortran

It is suggested that you set this environment variable in a modulefile [1] to load or in an environment script to source before compiling and/or running LDT.

Step 4

Run the configure script first by typing:

% ./configure

This script will prompt the user with a series of questions regarding support to compile into LDT, requiring the user to specify the locations of the required and optional libraries via several LDT specific environment variables. The following environment variables are used by LDT.

Variable Description Usage

LDT_FC

Fortran 90 compiler

required

LDT_CC

C compiler

required

LDT_MODESMF

path to ESMF module files

required

LDT_LIBESMF

path to ESMF library files

required

LDT_OPENJPEG

path to openJPEG library

required

LDT_ECCODES

path to ecCodes library

required

LDT_NETCDF

path to NetCDF library

required

LDT_HDF4

path to HDF4 library

optional (required to use HDFEOS2)

LDT_HDF5

path to HDF5 library

optional

LDT_HDFEOS

path to HDFEOS2 library

optional

LDT_GDAL

path to GDAL library

optional

LDT_FORTRANGIS

path to FortranGIS library

optional (required to use GDAL)

LDT_LIBGEOTIFF

path to GeoTIFF library

optional

LDT_JPEG

path to JPEG library

optional (use system libjpeg by default)

LDT_LIBTIFF

path to TIFF library

optional (use system libtiff by default)

LDT_LIBJBIG

path to JBIG library

optional (use system libjbig by default)

LDT_LIBLZMA

path to LZMA library

optional (use system liblzma by default)

LDT_RPC

path to RPC library

optional (use system RPC library by default)

Note that the CC variable must be set to a C compiler, not a C++ compiler. A C++ compiler may mangle internal names in a manner that is not consistent with the Fortran compiler. This will cause errors during linking.

It is suggested that you set these environment variables in a modulefile [1] to load or in an environment script to source before compiling and/or running LDT.

You may encounter errors either when trying to compile LDT or when trying to run LDT because the compiler or operating system cannot find these libraries. To fix this, you must add these libraries to your $LD_LIBRARY_PATH environment variable. For example, say that you are using ESMF, ecCodes, NetCDF, and HDF5. Then you must execute the following command (written using Bash shell syntax):

% export LD_LIBRARY_PATH=$LDT_HDF5/lib:$LDT_LIBESMF:$LDT_NETCDF/lib:$LDT_ECCODES/lib:$LD_LIBRARY_PATH

It is suggested that you set this environment variable in a modulefile [1] to load or in an environment script to source before compiling and/or running LDT.

Example

An example execution of the configure script is shown below:

% ./configure
------------------------------------------------------------------------
Setting up configuration for LDT
Parallelism (0-serial, 1-dmpar, default=0):
Optimization level (-3=strict checks with warnings, -2=strict checks, -1=debug, 0,1,2,3, default=2):
Assume little/big_endian data format (1-little, 2-big, default=2):
Use GRIBAPI/ECCODES? (0-neither, 1-gribapi, 2-eccodes, default=2):
NETCDF version (3 or 4, default=4)?:
NETCDF use shuffle filter? (1-yes, 0-no, default = 1):
NETCDF use deflate filter? (1-yes, 0-no, default = 1):
NETCDF use deflate level? (1 to 9-yes, 0-no, default = 9):
Use HDF4? (1-yes, 0-no, default=1):
Use HDF5? (1-yes, 0-no, default=1):
Use HDFEOS? (1-yes, 0-no, default=1):
Enable GeoTIFF support? (1-yes, 0-no, default=1):
Enable LIBGEOTIFF support? (1-yes, 0-no, default=1):
Include date/time stamp history? (1-yes, 0-no, default=1):
-----------------------------------------------------
 configure.ldt file generated successfully
-----------------------------------------------------
Settings are written to configure.ldt in the make directory.
If you wish to change settings, please edit that file.

To compile, run the compile script.
------------------------------------------------------------------------

At each prompt, select the desired value. If you desire the default value, then you may simply press the Enter key.

Most of the configure options are be self-explanatory. Here are a few specific notes:

  • for Parallelism (0-serial, 1-dmpar, default=1):, dmpar refers to enabling MPI

  • for Assume little/big_endian data format (1-little, 2-big, default=2):, select the default value of 2. By default, LDT reads and writes binary data in the big endian format. Only select the value of 1, if you have reformatted all required binary data into the little endian format.

  • for Use GRIBAPI/ECCODES? (0-neither, 1-gribapi, 2-eccodes, default=2):, select the default value of 2. Technically, GRIB support is not required by LDT; however, most of the commonly used met forcing data are in GRIB, making GRIB support a practical requirement. ecCodes is ECMWF’s replacement to their GRIB-API library. GRIB-API is supported only for historical reasons; thus, please use ecCodes.

    Important
    GRIB-API support is now deprecated. Future releases will support only ecCodes.
  • for Enable GeoTIFF support? (1-yes, 0-no, default=1):, GeoTIFF means the GeoTIFF support provided by the GDAL library.

  • for Enable LIBGEOTIFF support? (1-yes, 0-no, default=1):, LIBGEOTIFF means GeoTIFF support provided by the GeoTIFF library.

Note that due to an issue involving multiple definitions within the NetCDF 3 and HDF 4 libraries, you cannot compile LDT with support for both NetCDF 3 and HDF 4 together.

Note that if you compiled NetCDF 4 without compression, then when specifying NETCDF version (3 or 4, default=4):, select 3. Then you must manually append -lnetcdff to the LDFLAGS variable in the make/configure.ldt file.

Step 5

Compile the LDT source code by running the compile script.

% ./compile

This script will compile the libraries provided with LDT and then the LDT source code. The executable LDT will be placed in the $WORKING directory upon successful completion of the compile script.

Step 6

Finally, copy the LDT executable into your running directory, $RUNNING. (See Section [sec-run].)


1. See the “Creating a Custom Modulefile” document found at {nasalisfpages}