/ESMA-Baselibs

Base Libraries for the GEOS ESM

Primary LanguageMakefileApache License 2.0Apache-2.0

ESMA Baselibs

Build Latest Release

This git repository contains a simplified version of the "baselibs" module first developed by Gerhard Theurich and later maintained by Eugene Mirvis, Denis Nadeau, and Matthew Thompson. The current version only includes a minimal set of libraries needed for building GEOS at NASA/GSFC.

Current State of Libraries

Library Version
ESMF v8.3.0b09
netCDF 4.8.1
netCDF Fortran 4.5.4
netCDF C++ 4.3.1
HDF5 1.10.9
HDF4 4.2.15
GFE v1.3.1
xgboost v1.6.0
antlr2 2.7.7
GSL 2.7
jpeg 9e
zlib 1.2.11
szip 2.1.1
cURL 7.83.1
UDUNITS2 2.2.26
NCO 5.0.7
CDO 2.0.5
nccmp 1.9.1.0
FLAP geos/v1.10.0
HDF-EOS2 3.0
HDF-EOS5 2.0
SDP Toolkit 5.2.20

Installation Instructions

Requirements

  • C compiler, preferably gcc

  • Fortran compiler. Tested compilers are GNU, Intel, and NAG. PGI support was once available, but has not been tested in a while.

  • The MPI library. On a Linux desktop/laptop, Open MPI is recommended. Make sure mpicc, mpifort, etc is on your path. Try compiling a simple "Hello, world!" program with mpicc and running it; sometimes you need to set your LD_LIBRARY_PATH so that the runtime MPI libraries can be found.

    Linux Note: many Linux distributions now have Open MPI packages. However these either lack Fortran altogether or use gfortran. You must have Open MPI with Fortran support, and the Fortran compiler used to build MPI must the Fortran compiler you will be using.

  • on Linux, make sure "bison" and "flex" are installed; on generic Unix platforms, make sure you have "yacc" and "lex".

  • on Darwin, GNU sed is needed for ESMF Applications. This sed must be visible as sed (and not, say, gsed as installed by Brew)

  • CMake of a recent vintage

Obtaining ESMA Baselibs

ESMA Baselibs can be obtained in two ways via a tarball or through git.

Tarball

Recent releases of ESMA Baselibs have a complete tarball uploaded as an asset on the Releases page. These are the files denoted by:

ESMA-Baselibs-x.y.z.COMPLETE.tar.xz

The COMPLETE indicates that they have completed all the steps needed to get Baselibs via git (see below). Note that to save space, this tarball is tarred with --exclude-vcs so the libraries that are normally git repositories, will not be in this tarball.

Git Clone

ESMA Baselibs is based on submodules so you need to clone with:

git clone --recurse-submodules -b <TAG> https://github.com/GEOS-ESM/ESMA-Baselibs.git
Download non-git Libraries

Note that there is an additional step needed for building a complete ESMA Baselibs when retrieved via Git. There are six libraries that are not on git at present:

  • GSL
  • szlib
  • CDO
  • HDF-EOS
  • HDF-EOS 5
  • SDP Toolkit

to get these libraries, run:

make download

Note that this step will occur automatically the first time Baselibs is built, but in case you want to build on a system without internet access (say, a compute node), this command should be run first on a head node.

Build Instructions

If you are feeling lucky, building can be just as simple as

cd ESMA-Baselibs
make install ESMF_COMM=<mpistack> (prefix=<dir>)
make verify ESMF_COMM=<mpistack>

where <mpistack> is one of the ESMF MPI stack names, such as:

  • mpt
  • openmpi
  • mpich3
  • mvapich2
  • intelmpi

see esmf/INSTALL for more information.

You can optionally pass in a prefix to determine where Baselibs will be built. If you don't, the system uses config.guess => x86_64-pc-linux-gnu to install to:

../x86_64-pc-linux-gnu/$FC/Linux

Customizing The Installation

If the Baselibs do not build out of the repository, then you will need to customize a few things. For example, to choose the ifort compiler under Linux, just enter this

  • BUILD=ESSENTIALS

    Use this to only build the libraries essential for building and running GEOS GCM

  • CONFIG_SETUP

    This is to help detail what combination of compiler and MPI was used. If unspecified, the default is the value of FC

  • ROOTDIR

    Root directory for installing the binaries; the installation directory will be at

    prefix = $(ROOTDIR)/$(SYSNAME)/$(CONFIG_SETUP)/$(ARCH)
    

    where $(ARCH) is the result of uname -s, e.g., Linux.

  • prefix

    Bypass the definition above and install at this directory. It is no recommended that you specify this - specify ROOTDIR instead

Using Baselibs in GEOS

For GEOS, you'll need to pass in the Baselibs as:

cmake .. -DBASEDIR=<BASEDIR_LOC> ...

where BASEDIR_LOC is such that BASEDIR_LOC/lib, etc. exists.

For additional information, contact Matthew.Thompson@nasa.gov

Contributing

Please check out our contributing guidelines.

License

All files are currently licensed under the Apache-2.0 license, see LICENSE.

Previously, the code was licensed under the NASA Open Source Agreement, Version 1.3.