To use the MOAB-based coupler (E3SM/driver-moab), you will need to install MOAB and some of its dependencies on your machine to get started. Some instructions are provided below to install the dependencies directly on a new machine other than the ones officially supported for E3SM, where MOAB will be pre-built and installed.
Pre-installed recipes
MOAB comes pre-built as part of a conda package to test and experiment with the capabilities. Note that we do not recommend using the conda installation for MOAB for the online coupler workflows as often the preinstalled package will be suboptimal for the cluster or machine in use. However, such installations are useful for offline remapping and computational analysis workflows (with Python interfaces) using MOAB.
Once you have a conda environment setup, use the command below to install MOAB with TempestRemap enabled (with or without MPI).
With MPI: conda install -c conda-forge moab=*=mpi_mpich_tempest*
Without MPI: conda install -c conda-forge moab=*=nompi_tempest*
This method is useful for quickly getting started with MOAB and TempestRemap interfaces, as the build is consistent with all third-party libraries (TPLs) available prebuilt with MPI enabled or disabled. For more extensive TPL support in Conda, use the E3SM-Unified conda package.
Building MOAB TPL dependencies
There are several option dependencies for MOAB. Features and tools get automatically built and enabled based on the dependencies when configuring the MOAB library.
MPI: MOAB supports the usage of MPICH and OpenMPI libraries configured externally to enable scalable mesh manipulation algorithms.
HDF5: To manage the data dependencies and to natively support parallel I/O, MOAB uses a native HDF5 based file format to represent the entire MOAB data model.
NetCDF: MOAB library optionally depends on the NetCDF libraries (C) to compile the ExodusII reader/writer. NetCDF is also required to process NetCDF4 format nc files for E3SM.
Parallel-NetCDF: MOAB library optionally depends on the parallel-NetCDF (pnetcdf) libraries to compile the support for parallel reader and writer of NetCDF meshes and linear map weight files. This is a required dependency to enable parallel I/O of MPAS, SCRIP, ESMF and Exodus meshes as well.
Metis/ParMetis: MOAB can optionally use the Metis or ParMetis library for partitioning mesh files in an offline form through the
mbpart
tool. This may be useful to pre-partition the mesh a-priori in offline remapping workflows.Zoltan: Support for both offline and online partitioning through Zoltan (and its dependencies on Scotch, ParMetis etc) can be utilized through the partitioner tool and at runtime with appropriate file read options (
PARTITION_METHOD=RCBZOLTAN;
). This dynamic rebalancing is important to achieve good scalability when readingnc
files. If reading parallelh5m
files, we recommend using the offline partitioning tool withmbpart
with-z RCB
to use the Recursive Bisection geometric partitioner implementation in Zoltan.TempestRemap: Provides support for both offline and online remapping of Climate field data on unstructured spherical meshes. Required dependency for all E3SM workflows.
Eigen3: A substitute for BLAS/LAPACK interfaces. However, if TempestRemap tools are to be built, this becomes a required dependency as we store the SparseMatrix internally on every task using the Eigen3 datastructures.
Configuration and building from source
First, clone the sources from the repository using the command
git clone https://bitbucket.org/fathomteam/moab.git
Currently, both CMake and Autotools are maintained simultaneously in order to support all platforms (including Windows). Please choose your build system according to your needs and follow instructions below. Both of these workflows follow the same pattern of commands to build and install in your platform. Note that the autotools workflow may get deprecated in the future.
Autotools based configuration workflow
Please ensure that the autotools toolchain is pre-installed locally. We recommend a minimum autoconf version of v2.69.
Run
autoreconf -fi
to generate the configure scriptRun the
configure --help
script in the top source directory to see a list of available configure options.Use
--prefix=INSTALL_DIR
to specify installation directoryOverride default compilers with environment or user options:
CC, CXX, FC, F77
If you have MPI installed, use
--with-mpi=$MPI_DIR
If you have HDF5, NetCDF, PNetCDF installed, use
--with-hdf5=$HDF5_DIR--with-netcdf=$NETCDF_DIR --with-pnetcdf=$PNETCDF_DIR
to specify external dependencies.Similarly for Metis or ParMetis dependencies, use
--with-metis=$METIS_DIR
and--with-parmetis=$PARMETIS_DIR
respectivelyIf you have Zoltan installed, use
--with-zoltan=$ZOLTAN_DIR
If you have TempestRemap master branch pre-installed, then use
--with-tempestremap=$TEMPESTREMAP_DIR
during configuration, or use the auto-download option to let MOAB automatically build the dependency with the configure option--download-tempestremap
(to download the latest release) OR--download-tempestremap=master
(to build from Git master)
Now run the
configure
script with desired configuration options either in-source or out-of-source (build) directory.
Once configuration with either autotools or the CMake workflow is complete in the build directory, run the following to build the library:
Compile MOAB and supported tools:
make -j4
Verify configuration and build setup:
make check
Next to install the compiled libraries, headers and tools, run: make install
You can now use the
makefile
generated under thebuild/examples
folder and modify it to compile downstream code with MOAB dependency