Building Ascent

This page provides details on several ways to build Ascent from source.

For the shortest path from zero to Ascent, see Quick Start.

To build third party dependencies we recommend using uberenv which leverages Spack or Spack directly. We also provide info about building for known HPC clusters using uberenv. and a Docker example that leverages Spack.

Overview

Ascent uses CMake for its build system. Building Ascent creates two separate libraries:

  • libascent : a version for execution on a single node
  • libascent_mpi : a version for distributed-memory parallelism

The CMake variable( ENABLE_MPI ON | OFF ) controls the building the parallel version of Ascent and included proxy-apps.

The build dependencies vary according to which pipelines and proxy-applications are desired. For a minimal build with no parallel components, the following are required:

  • Conduit
  • C++ compilers

We recognize that building on HPC systems can be difficult, and we have provide two separate build strategies.

  • A spack based build
  • Manually compile dependencies using a CMake configuration file to keep compilers and libraries consistent

Most often, the spack based build should be attempted first. Spack will automatically download and build all the third party dependencies and create a CMake configuration file for Ascent. Should you encounter build issues that are not addressed here, please ask questions using our github issue tracker.

Build Dependencies

Ascent requires Conduit and provides optional features that depend on third-party libraries:

Feature Required TPLS
VTK-h Rendering and Filtering Pipelines VTk-m (Serial, OpenMP, CUDA, Kokkos)
MFEM High-Order to Low-Order Refinement for VTK-h Pipelines MFEM
Devil Ray High-Order Ray Tracer Pipelines RAJA (Serial, OpenMP, CUDA, HIP), Umpire, MFEM
General Expressions RAJA (Serial, OpenMP, CUDA, HIP), Umpire
JIT Expressions OCCA, Umpire

For a detailed account of features and what underpin them see Ascent Feature Map.

Getting Started

Clone the Ascent repo:

  • From Github
git clone --recursive https://github.com/Alpine-DAV/ascent.git

--recursive is necessary because we are using a git submodule to pull in BLT (https://github.com/llnl/blt). If you cloned without --recursive, you can checkout this submodule using:

cd ascent
git submodule init
git submodule update

Configure a build:

config-build.sh is a simple wrapper for the cmake call to configure ascent. This creates a new out-of-source build directory build-debug and a directory for the install install-debug. It optionally includes a host-config.cmake file with detailed configuration options.

cd ascent
./config-build.sh

Build, test, and install Ascent:

cd build-debug
make -j 8
make test
make install

Build Options

Ascent’s build system supports the following CMake options:

Main CMake Options

Option Description Default
BUILD_SHARED_LIBS Controls if shared (ON) or static (OFF) libraries are built. (default = ON)
ENABLE_FORTRAN Controls if Fortran components of Ascent are built. This includes the Fortran language bindings and Cloverleaf3D. (default = ON)
ENABLE_PYTHON Controls if the Ascent Python module and related tests are built. (default = OFF)
ENABLE_MPI Controls if MPI parallel versions of Ascent and proxy-apps are built. (default = ON)
ENABLE_SERIAL Controls if Serial (non-MPI) version of Ascent and proxy-apps are built. (default = ON)
ENABLE_CUDA Controls if Ascent uses CUDA. (default = OFF)
ENABLE_OPENMP Controls if the proxy-apps and Ascent use with OpenMP. (default = OFF)
ENABLE_DRAY Controls if Devil Ray is built. Requires RAJA + Umpire. (Devil Ray is now developed as part of Ascent) (default = OFF)
ENABLE_APCOMP Controls if AP Compositor is built. (AP Compositor is now developed as part of Ascent) (default = OFF)
ENABLE_VTKH Controls if VTK-h is built.. Requires VTK-m. (VTK-h is now developed as part of Ascent) (default = OFF)
ENABLE_EXAMPLES Controls if Ascent examples are built. (default = ON)
ENABLE_UTILS Controls if Ascent utilities are built. (default = ON)
ENABLE_TESTS Controls if Ascent tests are built. (default = ON)
ENABLE_LOGGING Controls if data logging is built. (default = ON)
ENABLE_DOCS Controls if the Ascent documentation is built (when sphinx is available). (default = ON)
(Devil Ray Specific Options)    
DRAY_ENABLE_STATS Controls if Devil Ray Status support is built. (default = ON)
DRAY_USE_DOUBLE_PRECISION Controls if Devil Ray is built with 64-bit floats (default = OFF, use 32-bit precision floats)

CMake Options for Third-party Library Paths

Name Description
CONDUIT_DIR Path to an Conduit install (required)
RAJA_DIR Path to an RAJA install (optional)
UMPIRE_DIR Path to an Umpire install (optional)
OCCA_DIR Path to an OCCA install (optional)
VTKM_DIR Path to an VTK-m install (optional)
KOKKOS_DIR Path to an Kokkos install (optional)
ADIOS2_DIR Path to an ADIOS 2 install (optional)
FIDES_DIR Path to a FIDES install (optional)
BABELFLOW_DIR Path to a BabelFlow install (optional)
BLT_SOURCE_DIR Path to a BLT install (default = blt)

Additional Build Notes

  • Python - The Ascent Python module builds for both Python 2 and Python 3. To select a specific Python, set the CMake variable PYTHON_EXECUTABLE to path of the desired python binary. The Ascent Python module requires the Conduit Python module.
  • MPI - We use CMake’s standard FindMPI logic. To select a specific MPI set the CMake variables MPI_C_COMPILER and MPI_CXX_COMPILER, or the other FindMPI options for MPI include paths and MPI libraries. To run the mpi unit tests, you may also need change the CMake variables MPIEXEC_EXECUTABLE and MPIEXEC_NUMPROC_FLAG, so you can use a different launcher, such as srun and set number of MPI tasks used.
  • BLT - Ascent uses BLT (https://github.com/llnl/blt) as the foundation of its CMake-based build system. It is included as a submodule in Ascent’s git repo, and also available in our release tarballs. The BLT_SOURCE_DIR CMake option defaults to src/blt, where we expect the blt submodule. The most compelling reason to override is to share a single instance of BLT across multiple projects.

Host Config Files

To handle build options, third party library paths, etc we rely on CMake’s initial-cache file mechanism.

cmake -C config_file.cmake

We call these initial-cache files host-config files, since we typically create a file for each platform or specific hosts if necessary.

The config-build.sh script uses your machine’s hostname, the SYS_TYPE environment variable, and your platform name (via uname) to look for an existing host config file in the host-configs directory at the root of the ascent repo. If found, it passes the host config file to CMake via the -C command line option.

cmake {other options} -C host-configs/{config_file}.cmake ../

You can find example files in the host-configs directory.

These files use standard CMake commands. CMake set commands need to specify the root cache path as follows:

set(CMAKE_VARIABLE_NAME {VALUE} CACHE PATH "")

It is possible to create your own configure file, and an boilerplate example is provided in /host-configs/boilerplate.cmake

Warning

If compiling all of the dependencies yourself, it is important that you use the same compilers for all dependencies. For example, different MPI and Fortran compilers (e.g., Intel and GCC) are not compatible with one another.

Building Ascent and Third Party Dependencies

We use Spack (http://spack.io) to help build Ascent’s third party dependencies on OSX and Linux.

Uberenv (scripts/uberenv/uberenv.py) automates fetching spack, building and installing third party dependencies, and can optionally install Ascent as well. To automate the full install process, Uberenv uses the Ascent Spack package along with extra settings such as Spack compiler and external third party package details for common HPC platforms.

Uberenv Options for Building Third Party Dependencies

uberenv.py has a few options that allow you to control how dependencies are built:

Option Description Default
–prefix Destination directory uberenv_libs
–spec Spack spec linux: %gcc osx: %clang
–spack-config-dir Folder with Spack settings files linux: (empty) osx: scripts/uberenv_configs/spack_configs/darwin/
-k Ignore SSL Errors False
–install Fully install ascent not just dependencies False

The -k option exists for sites where SSL certificate interception undermines fetching from github and https hosted source tarballs. When enabled, uberenv.py clones spack using:

git -c http.sslVerify=false clone https://github.com/llnl/spack.git

And passes -k to any spack commands that may fetch via https.

Default invocation on Linux:

python scripts/uberenv/uberenv.py --prefix uberenv_libs \
                                  --spec %gcc

Default invocation on OSX:

python scripts/uberenv/uberenv.py --prefix uberenv_libs \
                                  --spec %clang \
                                  --spack-config-dir scripts/uberenv_configs/spack_configs/darwin/

The uberenv –install installs ascent@develop (not just the development dependencies):

python scripts/uberenv/uberenv.py --install

For details on Spack’s spec syntax, see the Spack Specs & dependencies documentation.

Compiler Settings for Third Party Dependencies

You can edit yaml files under scripts/uberenv_configs/spack_configs/configs/{platform} or use the –spack-config-dir option to specify a directory with compiler and packages yaml files to use with Spack. See the Spack Compiler Configuration and Spack System Packages documentation for details.

For macOS, the defaults in scripts/uberenv_configs/spack_configs/configs/darwin/compilers.yaml are X-Code’s clang and gfortran from https://gcc.gnu.org/wiki/GFortranBinaries#MacOS.

Note

The bootstrapping process ignores ~/.spack/compilers.yaml to avoid conflicts and surprises from a user’s specific Spack settings on HPC platforms.

When run, uberenv.py checkouts a specific version of Spack from github as spack in the destination directory. It then uses Spack to build and install Conduit’s dependencies into spack/opt/spack/. Finally, it generates a host-config file {hostname}.cmake in the destination directory that specifies the compiler settings and paths to all of the dependencies.

Building Third Party Dependencies for Development

You can use scripts/uberenv/uberenv.py to help setup your development environment on OSX and Linux. uberenv.py leverages Spack (https://spack.io/) to build the external third party libraries and tools used by Ascent. Fortran support in is optional, dependencies should build without fortran. After building these libraries and tools, it writes an initial host-config file and adds the Spack built CMake binary to your PATH, so can immediately call the config-build.sh helper script to configure a ascent build.

#build third party libs using spack
python scripts/uberenv/uberenv.py

#copy the generated host-config file into the standard location
cp uberenv_libs/`hostname`*.cmake host-configs/

# run the configure helper script
./config-build.sh

# or you can run the configure helper script and give it the
# path to a host-config file
./config-build.sh uberenv_libs/`hostname`*.cmake

Building with Spack

Currently, we maintain our own fork of Spack for stability. As part of the uberenv python script, we automatically clone our Spack fork.

Warning

Installing Ascent from the Spack develop branch will most likely fail. We build and test spack installations with uberenv.py.

To install Ascent and also build all of its dependencies as necessary run:

spack install ascent

The Ascent Spack package provides several variants that customize the options and dependencies used to build Ascent.

Please see the Ascent Spack package source (or use spack info ascent) to learn about variants.

Uberenv Spack Configurations

See the Spack configs we use to build our CI Containers for concrete examples of using pacakges.yaml and compilers.yaml to specify system packages and compiler details to Spack.

Using Ascent in Another Project

Under src/examples there are examples demonstrating how to use Ascent in a CMake-based build system (using-with-cmake, using-with-cmake-mpi) and via a Makefile (using-with-make, using-with-make-mpi). You can read more details about these examples Using Ascent in Your Project.

Under src/examples/proxies you can find example integrations using ascent in the Lulesh, Kripke, and Cloverleaf3D proxy-applications. In src/examples/synthetic/noise you can find an example integration using our synthetic smooth noise application.

Building Ascent in a Docker Container

Under src/examples/docker/master/ubuntu there is an example Dockerfile which can be used to create an ubuntu-based docker image with a build of the Ascent github master branch. There is also a script that demonstrates how to build a Docker image from the Dockerfile (example_build.sh) and a script that runs this image in a Docker container (example_run.sh). The Ascent repo is cloned into the image’s file system at /ascent, the build directory is /ascent/build-debug, and the install directory is /ascent/install-debug.

Building Ascent Dependencies Manually

In some environments, a spack build of Ascent’s dependencies can fail or a user may prefer to build the dependencies manually.

Here is a script that demonstrates how to build Ascent and its main dependencies without device support:

#!/bin/bash

##############################################################################
# Demonstrates how to manually build Ascent and its dependencies, including:
#
#  hdf5, conduit, vtk-m, mfem, raja, and umpire
#
# usage example:
#   env enable_mpi=ON enable_openmp=ON ./build_ascent.sh
#
#
# Assumes: 
#  - cmake is in your path
#  - selected compilers are in your path or set via env vars
#  - [when enabled] MPI and Python (+numpy and mpi4py), are in your path
#
##############################################################################
set -eu -o pipefail

##############################################################################
# Build Options
##############################################################################

# shared options
enable_fortran="${enable_fortran:=OFF}"
enable_python="${enable_python:=OFF}"
enable_openmp="${enable_openmp:=OFF}"
enable_mpi="${enable_mpi:=OFF}"
enable_tests="${enable_tests:=ON}"
enable_verbose="${enable_verbose:=ON}"
build_jobs="${build_jobs:=6}"

# tpl controls
build_hdf5="${build_hdf5:=true}"
build_conduit="${build_conduit:=true}"
build_vtkm="${build_vtkm:=true}"
build_camp="${build_camp:=true}"
build_raja="${build_raja:=true}"
build_umpire="${build_umpire:=true}"
build_mfem="${build_mfem:=true}"

# ascent options
build_ascent="${build_ascent:=true}"


root_dir=$(pwd)

################
# HDF5
################
hdf5_version=1.12.2
hdf5_src_dir=${root_dir}/hdf5-${hdf5_version}
hdf5_build_dir=${root_dir}/build/hdf5-${hdf5_version}/
hdf5_install_dir=${root_dir}/install/hdf5-${hdf5_version}/
hdf5_tarball=hdf5-${hdf5_version}.tar.gz

if ${build_hdf5}; then
if [ ! -d ${hdf5_src_dir} ]; then
  echo "**** Downloading ${hdf5_tarball}"
  curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.2/src/hdf5-1.12.2.tar.gz -o ${hdf5_tarball}
  tar -xzf ${hdf5_tarball}
fi

echo "**** Configuring HDF5 ${hdf5_version}"
cmake -S ${hdf5_src_dir} -B ${hdf5_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${hdf5_install_dir}

echo "**** Building HDF5 ${hdf5_version}"
cmake --build ${hdf5_build_dir} -j${build_jobs}
echo "**** Installing HDF5 ${hdf5_version}"
cmake --install ${hdf5_build_dir}

fi # build_hdf5

################
# Conduit
################
conduit_version=v0.8.4
conduit_src_dir=${root_dir}/conduit-${conduit_version}/src
conduit_build_dir=${root_dir}/build/conduit-${conduit_version}/
conduit_install_dir=${root_dir}/install/conduit-${conduit_version}/
conduit_tarball=conduit-${conduit_version}-src-with-blt.tar.gz

if ${build_conduit}; then
if [ ! -d ${conduit_src_dir} ]; then
  echo "**** Downloading ${conduit_tarball}"
  curl -L https://github.com/LLNL/conduit/releases/download/${conduit_version}/${conduit_tarball} -o ${conduit_tarball}
  tar -xzf ${conduit_tarball}
fi

echo "**** Configuring Conduit ${conduit_version}"
cmake -S ${conduit_src_dir} -B ${conduit_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${conduit_install_dir} \
  -DENABLE_FORTRAN=${enable_fortran} \
  -DENABLE_MPI=${enable_mpi} \
  -DENABLE_PYTHON=${enable_python} \
  -DENABLE_TESTS=${enable_tests} \
  -DHDF5_DIR=${hdf5_install_dir}

echo "**** Building Conduit ${conduit_version}"
cmake --build ${conduit_build_dir} -j${build_jobs}
echo "**** Installing Conduit ${conduit_version}"
cmake --install ${conduit_build_dir}

fi # build_conduit

################
# VTK-m
################
vtkm_version=v1.8.0
vtkm_src_dir=${root_dir}/vtk-m-${vtkm_version}
vtkm_build_dir=${root_dir}/build/vtk-m-${vtkm_version}
vtkm_install_dir=${root_dir}/install/vtk-m-${vtkm_version}/
vtkm_tarball=vtk-m-${vtkm_version}.tar.gz

if ${build_vtkm}; then
if [ ! -d ${vtkm_src_dir} ]; then
  echo "**** Downloading ${vtkm_tarball}"
  curl -L https://gitlab.kitware.com/vtk/vtk-m/-/archive/${vtkm_version}/${vtkm_tarball} -o ${vtkm_tarball}
  tar -xzf ${vtkm_tarball}
fi

echo "**** Configuring VTK-m ${vtkm_version}"
cmake -S ${vtkm_src_dir} -B ${vtkm_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON\
  -DVTKm_NO_DEPRECATED_VIRTUAL=ON \
  -DVTKm_USE_64BIT_IDS=OFF \
  -DVTKm_USE_DOUBLE_PRECISION=ON \
  -DVTKm_USE_DEFAULT_TYPES_FOR_ASCENT=ON \
  -DVTKm_ENABLE_MPI=OFF \
  -DVTKm_ENABLE_OPENMP=${enable_openmp}\
  -DVTKm_ENABLE_RENDERING=ON \
  -DVTKm_ENABLE_TESTING=OFF \
  -DBUILD_TESTING=OFF \
  -DVTKm_ENABLE_BENCHMARKS=OFF\
  -DCMAKE_INSTALL_PREFIX=${vtkm_install_dir}

echo "**** Building VTK-m ${vtkm_version}"
cmake --build ${vtkm_build_dir} -j${build_jobs}
echo "**** Installing VTK-m ${vtkm_version}"
cmake --install ${vtkm_build_dir}

fi # build_vtkm


################
# Camp
################
camp_version=2022.03.2
camp_src_dir=${root_dir}/camp-${camp_version}
camp_build_dir=${root_dir}/build/camp-${camp_version}
camp_install_dir=${root_dir}/install/camp-${camp_version}/
camp_tarball=camp-${camp_version}.tar.gz

if ${build_camp}; then
if [ ! -d ${camp_src_dir} ]; then
  echo "**** Cloning Camp ${camp_version}"
  # clone since camp releases don't contain submodules
  git clone --recursive --depth 1 --branch v${camp_version} https://github.com/LLNL/camp.git camp-${camp_version}
  # curl -L https://github.com/LLNL/camp/archive/refs/tags/v${camp_version}.tar.gz -o ${camp_tarball} 
  # tar -xzf ${camp_tarball} 
fi

echo "**** Configuring Camp ${camp_version}"
cmake -S ${camp_src_dir} -B ${camp_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON\
  -DENABLE_TESTS=${enable_tests} \
  -DENABLE_EXAMPLES=${enable_tests} \
  -DCMAKE_INSTALL_PREFIX=${camp_install_dir}

echo "**** Building Camp ${camp_version}"
cmake --build ${camp_build_dir} -j${build_jobs}
echo "**** Installing Camp ${camp_version}"
cmake --install ${camp_build_dir}

fi # build_camp



################
# RAJA
################
raja_version=v2022.03.0
raja_src_dir=${root_dir}/RAJA-${raja_version}
raja_build_dir=${root_dir}/build/raja-${raja_version}
raja_install_dir=${root_dir}/install/raja-${raja_version}/
raja_tarball=RAJA-${raja_version}.tar.gz

if ${build_raja}; then
if [ ! -d ${raja_src_dir} ]; then
  echo "**** Downloading ${raja_tarball}"
  curl -L https://github.com/LLNL/RAJA/releases/download/${raja_version}/${raja_tarball} -o ${raja_tarball} 
  tar -xzf ${raja_tarball} 
fi

echo "**** Configuring RAJA ${raja_version}"
cmake -S ${raja_src_dir} -B ${raja_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON\
  -Dcamp_DIR=${camp_install_dir} \
  -DENABLE_OPENMP=${enable_openmp} \
  -DENABLE_TESTS=${enable_tests} \
  -DENABLE_EXAMPLES=${enable_tests} \
  -DCMAKE_INSTALL_PREFIX=${raja_install_dir}

echo "**** Building RAJA ${raja_version}"
cmake --build ${raja_build_dir} -j${build_jobs}
echo "**** Installing RAJA ${raja_version}"
cmake --install ${raja_build_dir}

fi # build_raja

################
# Umpire
################
umpire_version=2022.03.1
umpire_src_dir=${root_dir}/umpire-${umpire_version}
umpire_build_dir=${root_dir}/build/umpire-${umpire_version}
umpire_install_dir=${root_dir}/install/umpire-${umpire_version}/
umpire_tarball=umpire-${umpire_version}.tar.gz

if ${build_umpire}; then
if [ ! -d ${umpire_src_dir} ]; then
  echo "**** Downloading ${umpire_tarball}"
  curl -L https://github.com/LLNL/Umpire/releases/download/v${umpire_version}/${umpire_tarball} -o ${umpire_tarball}
  tar -xzf ${umpire_tarball}
fi

echo "**** Configuring Umpire ${umpire_version}"
cmake -S ${umpire_src_dir} -B ${umpire_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -Dcamp_DIR=${camp_install_dir} \
  -DENABLE_OPENMP=${enable_openmp} \
  -DENABLE_TESTS=${enable_tests} \
  -DCMAKE_INSTALL_PREFIX=${umpire_install_dir}

echo "**** Building Umpire ${umpire_version}"
cmake --build ${umpire_build_dir} -j${build_jobs}
echo "**** Installing Umpire ${umpire_version}"
cmake --install ${umpire_build_dir}

fi # build_umpire

################
# MFEM
################
mfem_version=4.4
mfem_src_dir=${root_dir}/mfem-${mfem_version}
mfem_build_dir=${root_dir}/build/mfem-${mfem_version}
mfem_install_dir=${root_dir}/install/mfem-${mfem_version}/
mfem_tarball=mfem-${mfem_version}.tar.gz

if ${build_mfem}; then
if [ ! -d ${mfem_src_dir} ]; then
  echo "**** Downloading ${mfem_tarball}"
  curl -L https://github.com/mfem/mfem/archive/refs/tags/v4.4.tar.gz -o ${mfem_tarball}
  tar -xzf ${mfem_tarball}
fi

echo "**** Configuring MFEM ${mfem_version}"
cmake -S ${mfem_src_dir} -B ${mfem_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DMFEM_USE_CONDUIT=ON \
  -DCMAKE_PREFIX_PATH="${conduit_install_dir}" \
  -DCMAKE_INSTALL_PREFIX=${mfem_install_dir}

echo "**** Building MFEM ${vtkm_version}"
cmake --build ${mfem_build_dir} -j${build_jobs}
echo "**** Installing MFEM ${mfem_version}"
cmake --install ${mfem_build_dir}

fi # build_mfem


################
# Ascent
################
ascent_version=develop
ascent_src_dir=${root_dir}/ascent/src
ascent_build_dir=${root_dir}/build/ascent-${ascent_version}/
ascent_install_dir=${root_dir}/install/ascent-${ascent_version}/

echo "**** Creating Ascent host-config (ascent-config.cmake)"
#
echo '# host-config file generated by build_ascent.sh' > ascent-config.cmake
echo 'set(CMAKE_VERBOSE_MAKEFILE ' ${enable_verbose} 'CACHE BOOL "")' >> ascent-config.cmake
echo 'set(CMAKE_BUILD_TYPE Release CACHE STRING "")' >> ascent-config.cmake
echo 'set(CMAKE_INSTALL_PREFIX ' ${ascent_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(ENABLE_MPI ' ${enable_mpi} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_FORTRAN ' ${enable_fortran} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_PYTHON ' ${enable_python} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(BLT_CXX_STD c++14 CACHE STRING "")' >> ascent-config.cmake
echo 'set(CONDUIT_DIR ' ${conduit_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(VTKM_DIR ' ${vtkm_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CAMP_DIR ' ${camp_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(RAJA_DIR ' ${raja_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(UMPIRE_DIR ' ${umpire_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(MFEM_DIR ' ${mfem_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(ENABLE_VTKH ON CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_APCOMP ON CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_DRAY ON CACHE BOOL "")' >> ascent-config.cmake

if ${build_ascent}; then
if [ ! -d ${ascent_src_dir} ]; then
    echo "**** Cloning Ascent"
    git clone --recursive https://github.com/Alpine-DAV/ascent.git
fi

echo "**** Configuring Ascent"
cmake -S ${ascent_src_dir} -B ${ascent_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${ascent_install_dir} \
  -DENABLE_MPI=${enable_mpi} \
  -DENABLE_FORTRAN=${enable_fortran} \
  -DENABLE_TESTS=$enable_tests \
  -DENABLE_PYTHON=${enable_python} \
  -DBLT_CXX_STD=c++14 \
  -DCONDUIT_DIR=${conduit_install_dir} \
  -DVTKM_DIR=${vtkm_install_dir} \
  -DENABLE_VTKH=ON \
  -DCAMP_DIR=${camp_install_dir} \
  -DRAJA_DIR=${raja_install_dir} \
  -DUMPIRE_DIR=${umpire_install_dir} \
  -DMFEM_DIR=${mfem_install_dir} \
  -DENABLE_APCOMP=ON \
  -DENABLE_DRAY=ON

echo "**** Building Ascent"
cmake --build ${ascent_build_dir} -j${build_jobs}
echo "**** Installing Ascent"
cmake --install ${ascent_build_dir}

fi # build_ascent

Here is a script that shows how to build Ascent and its main dependencies with ROCm/HIP device support:

#!/bin/bash

##############################################################################
# Demonstrates how to manually build Ascent and its dependencies, including:
#
#  hdf5, conduit, vtk-m, mfem, raja, and umpire
#
# usage example:
#   env enable_mpi=ON enable_openmp=ON ./build_ascent.sh
#
#
# Assumes: 
#  - cmake is in your path
#  - selected compilers are in your path or set via env vars
#  - [when enabled] MPI and Python (+numpy and mpi4py), are in your path
#
##############################################################################
set -eu -o pipefail

CC=/opt/rocm/llvm/bin/amdclang
CXX=/opt/rocm/llvm/bin/amdclang++
ROCM_ARCH=gfx90a
ROCM_PATH=/opt/rocm/

##############################################################################
# Build Options
##############################################################################

# shared options
enable_fortran="${enable_fortran:=OFF}"
enable_python="${enable_python:=OFF}"
enable_openmp="${enable_openmp:=OFF}"
enable_mpi="${enable_mpi:=OFF}"
enable_tests="${enable_tests:=ON}"
enable_verbose="${enable_verbose:=ON}"
build_jobs="${build_jobs:=6}"

# tpl controls
build_hdf5="${build_hdf5:=true}"
build_conduit="${build_conduit:=true}"
build_kokkos="${build_kokkos:=true}"
build_vtkm="${build_vtkm:=true}"
build_camp="${build_camp:=true}"
build_raja="${build_raja:=true}"
build_umpire="${build_umpire:=true}"
build_mfem="${build_mfem:=true}"

# ascent options
build_ascent="${build_ascent:=true}"

root_dir=$(pwd)

################
# HDF5
################
hdf5_version=1.12.2
hdf5_src_dir=${root_dir}/hdf5-${hdf5_version}
hdf5_build_dir=${root_dir}/build/hdf5-${hdf5_version}/
hdf5_install_dir=${root_dir}/install/hdf5-${hdf5_version}/
hdf5_tarball=hdf5-${hdf5_version}.tar.gz

if ${build_hdf5}; then
if [ ! -d ${hdf5_src_dir} ]; then
  echo "**** Downloading ${hdf5_tarball}"
  curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.2/src/hdf5-1.12.2.tar.gz -o ${hdf5_tarball}
  tar -xzf ${hdf5_tarball}
fi

echo "**** Configuring HDF5 ${hdf5_version}"
cmake -S ${hdf5_src_dir} -B ${hdf5_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${hdf5_install_dir}

echo "**** Building HDF5 ${hdf5_version}"
cmake --build ${hdf5_build_dir} -j${build_jobs}
echo "**** Installing HDF5 ${hdf5_version}"
cmake --install ${hdf5_build_dir}

fi # build_hdf5

################
# Conduit
################
conduit_version=v0.8.4
conduit_src_dir=${root_dir}/conduit-${conduit_version}/src
conduit_build_dir=${root_dir}/build/conduit-${conduit_version}/
conduit_install_dir=${root_dir}/install/conduit-${conduit_version}/
conduit_tarball=conduit-${conduit_version}-src-with-blt.tar.gz

if ${build_conduit}; then
if [ ! -d ${conduit_src_dir} ]; then
  echo "**** Downloading ${conduit_tarball}"
  curl -L https://github.com/LLNL/conduit/releases/download/${conduit_version}/${conduit_tarball} -o ${conduit_tarball}
  tar -xzf ${conduit_tarball}
fi

echo "**** Configuring Conduit ${conduit_version}"
cmake -S ${conduit_src_dir} -B ${conduit_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${conduit_install_dir} \
  -DENABLE_FORTRAN=${enable_fortran} \
  -DENABLE_MPI=${enable_mpi} \
  -DENABLE_PYTHON=${enable_python} \
  -DENABLE_TESTS=${enable_tests} \
  -DHDF5_DIR=${hdf5_install_dir}

echo "**** Building Conduit ${conduit_version}"
cmake --build ${conduit_build_dir} -j${build_jobs}
echo "**** Installing Conduit ${conduit_version}"
cmake --install ${conduit_build_dir}

fi # build_conduit

################
# Kokkos
################
kokkos_version=3.6.01
kokkos_src_dir=${root_dir}/kokkos-${kokkos_version}
kokkos_build_dir=${root_dir}/build/kokkos-${kokkos_version}
kokkos_install_dir=${root_dir}/install/kokkos-${kokkos_version}/
kokkos_tarball=kokkos-${kokkos_version}.tar.gz

if ${build_kokkos}; then
if [ ! -d ${kokkos_src_dir} ]; then
  echo "**** Downloading ${kokkos_tarball}"
  curl -L https://github.com/kokkos/kokkos/archive/refs/tags/${kokkos_version}.tar.gz -o ${kokkos_tarball}
  tar -xzf ${kokkos_tarball}
fi


echo "**** Configuring Kokkos ${kokkos_version}"
cmake -S ${kokkos_src_dir} -B ${kokkos_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON\
  -DKokkos_ARCH_VEGA90A=ON \
  -DCMAKE_CXX_COMPILER=${ROCM_PATH}/bin/hipcc \
  -DKokkos_ENABLE_HIP=ON \
  -DKokkos_ENABLE_SERIAL=ON \
  -DKokkos_ENABLE_HIP_RELOCATABLE_DEVICE_CODE=OFF \
  -DCMAKE_INSTALL_PREFIX=${kokkos_install_dir} \
  -DCMAKE_CXX_FLAGS="--amdgpu-target=${ROCM_ARCH}" \
  -DBUILD_TESTING=OFF \
  -DVTKm_ENABLE_BENCHMARKS=OFF\
  -DCMAKE_INSTALL_PREFIX=${kokkos_install_dir}

echo "**** Building Kokkos ${kokkos_version}"
cmake --build ${kokkos_build_dir} -j${build_jobs}
echo "**** Installing VTK-m ${kokkos_version}"
cmake --install ${kokkos_build_dir}

fi # build_vtkm

################
# VTK-m
################
vtkm_version=v1.8.0
vtkm_src_dir=${root_dir}/vtk-m-${vtkm_version}
vtkm_build_dir=${root_dir}/build/vtk-m-${vtkm_version}
vtkm_install_dir=${root_dir}/install/vtk-m-${vtkm_version}/
vtkm_tarball=vtk-m-${vtkm_version}.tar.gz

if ${build_vtkm}; then
if [ ! -d ${vtkm_src_dir} ]; then
  echo "**** Downloading ${vtkm_tarball}"
  curl -L https://gitlab.kitware.com/vtk/vtk-m/-/archive/${vtkm_version}/${vtkm_tarball} -o ${vtkm_tarball}
  tar -xzf ${vtkm_tarball}
fi

echo "**** Configuring VTK-m ${vtkm_version}"
cmake -S ${vtkm_src_dir} -B ${vtkm_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DVTKm_NO_DEPRECATED_VIRTUAL=ON \
  -DVTKm_USE_64BIT_IDS=OFF \
  -DVTKm_USE_DOUBLE_PRECISION=ON \
  -DVTKm_USE_DEFAULT_TYPES_FOR_ASCENT=ON \
  -DVTKm_ENABLE_BENCHMARKS=OFF\
  -DVTKm_ENABLE_RENDERING=ON \
  -DVTKm_ENABLE_TESTING=OFF \
  -DBUILD_TESTING=OFF \
  -DVTKm_ENABLE_BENCHMARKS=OFF\
  -DVTKm_ENABLE_MPI=OFF \
  -DVTKm_ENABLE_KOKKOS=ON \
  -DCMAKE_HIP_ARCHITECTURES="${ROCM_ARCH}" \
  -DCMAKE_HIP_COMPILER_TOOLKIT_ROOT=${ROCM_PATH} \
  -DCMAKE_PREFIX_PATH="${kokkos_install_dir}" \
  -DCMAKE_INSTALL_PREFIX=${vtkm_install_dir}

echo "**** Building VTK-m ${vtkm_version}"
cmake --build ${vtkm_build_dir} -j${build_jobs}
echo "**** Installing VTK-m ${vtkm_version}"
cmake --install ${vtkm_build_dir}

fi # build_vtkm


################
# Camp
################
camp_version=2022.03.2
camp_src_dir=${root_dir}/camp-${camp_version}
camp_build_dir=${root_dir}/build/camp-${camp_version}
camp_install_dir=${root_dir}/install/camp-${camp_version}/
camp_tarball=camp-${camp_version}.tar.gz

if ${build_camp}; then
if [ ! -d ${camp_src_dir} ]; then
  echo "**** Cloning Camp ${camp_version}"
  # clone since camp releases don't contain submodules
  git clone --recursive --depth 1 --branch v${camp_version} https://github.com/LLNL/camp.git camp-${camp_version}
  # curl -L https://github.com/LLNL/camp/archive/refs/tags/v${camp_version}.tar.gz -o ${camp_tarball} 
  # tar -xzf ${camp_tarball} 
fi

echo "**** Configuring Camp ${camp_version}"
cmake -S ${camp_src_dir} -B ${camp_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DCMAKE_C_COMPILER=${CC} \
  -DCMAKE_CXX_COMPILER=${CXX} \
  -DENABLE_HIP=ON \
  -DENABLE_TESTS=OFF \
  -DCMAKE_HIP_ARCHITECTURES="${ROCM_ARCH}" \
  -DROCM_PATH="/opt/rocm/" \
  -DCMAKE_INSTALL_PREFIX=${camp_install_dir}

echo "**** Building Camp ${camp_version}"
cmake --build ${camp_build_dir} -j${build_jobs}
echo "**** Installing Camp ${camp_version}"
cmake --install ${camp_build_dir}

fi # build_camp


################
# RAJA
################
raja_version=v2022.03.0
raja_src_dir=${root_dir}/RAJA-${raja_version}
raja_build_dir=${root_dir}/build/raja-${raja_version}
raja_install_dir=${root_dir}/install/raja-${raja_version}/
raja_tarball=RAJA-${raja_version}.tar.gz

if ${build_raja}; then
if [ ! -d ${raja_src_dir} ]; then
  echo "**** Downloading ${raja_tarball}"
  curl -L https://github.com/LLNL/RAJA/releases/download/${raja_version}/${raja_tarball} -o ${raja_tarball} 
  tar -xzf ${raja_tarball} 
fi

echo "**** Configuring RAJA ${raja_version}"
cmake -S ${raja_src_dir} -B ${raja_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON\
  -DCMAKE_C_COMPILER=${CC} \
  -DCMAKE_CXX_COMPILER=${CXX} \
  -DENABLE_HIP=ON \
  -DCMAKE_HIP_ARCHITECTURES=${ROCM_ARCH} \
  -DROCM_PATH=/opt/rocm/ \
  -DENABLE_OPENMP=OFF \
  -Dcamp_DIR=${camp_install_dir} \
  -DENABLE_TESTS=OFF \
  -DENABLE_EXAMPLES=OFF \
  -DENABLE_EXERCISES=OFF \
  -DCMAKE_INSTALL_PREFIX=${raja_install_dir}  
  

echo "**** Building RAJA ${raja_version}"
cmake --build ${raja_build_dir} -j${build_jobs}
echo "**** Installing RAJA ${raja_version}"
cmake --install ${raja_build_dir}

fi # build_raja

################
# Umpire
################
umpire_version=2022.03.1
umpire_src_dir=${root_dir}/umpire-${umpire_version}
umpire_build_dir=${root_dir}/build/umpire-${umpire_version}
umpire_install_dir=${root_dir}/install/umpire-${umpire_version}/
umpire_tarball=umpire-${umpire_version}.tar.gz

if ${build_umpire}; then
if [ ! -d ${umpire_src_dir} ]; then
  echo "**** Downloading ${umpire_tarball}"
  curl -L https://github.com/LLNL/Umpire/releases/download/v${umpire_version}/${umpire_tarball} -o ${umpire_tarball}
  tar -xzf ${umpire_tarball}
fi

echo "**** Configuring Umpire ${umpire_version}"
cmake -S ${umpire_src_dir} -B ${umpire_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DCMAKE_C_COMPILER=${CC} \
  -DCMAKE_CXX_COMPILER=${CXX} \
  -DENABLE_HIP=ON \
  -DCMAKE_HIP_ARCHITECTURES="${ROCM_ARCH}" \
  -DROCM_PATH=/opt/rocm/ \
  -Dcamp_DIR=${camp_install_dir} \
  -DENABLE_OPENMP=${enable_openmp} \
  -DENABLE_TESTS=${enable_tests} \
  -DCMAKE_INSTALL_PREFIX=${umpire_install_dir}

echo "**** Building Umpire ${umpire_version}"
cmake --build ${umpire_build_dir} -j${build_jobs}
echo "**** Installing Umpire ${umpire_version}"
cmake --install ${umpire_build_dir}

fi # build_umpire

################
# MFEM
################
mfem_version=4.4
mfem_src_dir=${root_dir}/mfem-${mfem_version}
mfem_build_dir=${root_dir}/build/mfem-${mfem_version}
mfem_install_dir=${root_dir}/install/mfem-${mfem_version}/
mfem_tarball=mfem-${mfem_version}.tar.gz

if ${build_mfem}; then
if [ ! -d ${mfem_src_dir} ]; then
  echo "**** Downloading ${mfem_tarball}"
  curl -L https://github.com/mfem/mfem/archive/refs/tags/v4.4.tar.gz -o ${mfem_tarball}
  tar -xzf ${mfem_tarball}
fi

echo "**** Configuring MFEM ${mfem_version}"
cmake -S ${mfem_src_dir} -B ${mfem_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DMFEM_USE_CONDUIT=ON \
  -DCMAKE_PREFIX_PATH="${conduit_install_dir}" \
  -DCMAKE_INSTALL_PREFIX=${mfem_install_dir}

echo "**** Building MFEM ${vtkm_version}"
cmake --build ${mfem_build_dir} -j${build_jobs}
echo "**** Installing MFEM ${mfem_version}"
cmake --install ${mfem_build_dir}

fi # build_mfem


################
# Ascent
################
ascent_version=develop
ascent_src_dir=${root_dir}/ascent/src
ascent_build_dir=${root_dir}/build/ascent-${ascent_version}/
ascent_install_dir=${root_dir}/install/ascent-${ascent_version}/

echo "**** Creating Ascent host-config (ascent-config.cmake)"
#
echo '# host-config file generated by build_ascent.sh' > ascent-config.cmake
echo 'set(CMAKE_VERBOSE_MAKEFILE ' ${enable_verbose} 'CACHE BOOL "")' >> ascent-config.cmake
echo 'set(CMAKE_C_COMPILER ' ${CC} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CMAKE_CXX_COMPILER ' ${CXX} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CMAKE_BUILD_TYPE Release CACHE STRING "")' >> ascent-config.cmake
echo 'set(CMAKE_INSTALL_PREFIX ' ${ascent_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(ENABLE_MPI ' ${enable_mpi} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_FORTRAN ' ${enable_fortran} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_PYTHON ' ${enable_python} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_HIP ON CACHE BOOL "")' >> ascent-config.cmake
echo 'set(BLT_CXX_STD c++14 CACHE STRING "")' >> ascent-config.cmake
echo 'set(CMAKE_HIP_ARCHITECTURES ' ${ROCM_ARCH} ' CACHE STRING "")' >> ascent-config.cmake
echo 'set(CMAKE_PREFIX_PATH ' ${kokkos_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(ROCM_PATH ' ${ROCM_PATH} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CONDUIT_DIR ' ${conduit_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(KOKKOS_DIR ' ${kokkos_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(VTKM_DIR ' ${vtkm_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CAMP_DIR ' ${camp_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(RAJA_DIR ' ${raja_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(UMPIRE_DIR ' ${umpire_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(MFEM_DIR ' ${mfem_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(ENABLE_VTKH ON CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_APCOMP ON CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_DRAY ON CACHE BOOL "")' >> ascent-config.cmake

if ${build_ascent}; then
if [ ! -d ${ascent_src_dir} ]; then
    echo "**** Cloning Ascent"
    git clone --recursive https://github.com/Alpine-DAV/ascent.git
fi

echo "**** Configuring Ascent"
cmake -S ${ascent_src_dir} -B ${ascent_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${ascent_install_dir} \
  -DENABLE_MPI=${enable_mpi} \
  -DENABLE_FORTRAN=${enable_fortran} \
  -DENABLE_TESTS=$enable_tests \
  -DENABLE_PYTHON=${enable_python} \
  -DENABLE_HIP=ON \
  -DBLT_CXX_STD=c++14 \
  -DCMAKE_HIP_ARCHITECTURES="${ROCM_ARCH}" \
  -DCMAKE_PREFIX_PATH="${kokkos_install_dir}" \
  -DROCM_PATH=${ROCM_PATH} \
  -DCONDUIT_DIR=${conduit_install_dir} \
  -DKOKKOS_DIR=${kokkos_install_dir} \
  -DVTKM_DIR=${vtkm_install_dir} \
  -DRAJA_DIR=${raja_install_dir} \
  -DUMPIRE_DIR=${umpire_install_dir} \
  -DCAMP_DIR=${camp_install_dir} \
  -DMFEM_DIR=${mfem_install_dir} \
  -DENABLE_VTKH=ON \
  -DENABLE_APCOMP=ON \
  -DENABLE_DRAY=ON

echo "**** Building Ascent"
cmake --build ${ascent_build_dir} -j${build_jobs}
echo "**** Installing Ascent"
cmake --install ${ascent_build_dir}

fi # build_ascent

Here is a script that shows how to build Ascent and its main dependencies with CUDA device support:

#!/bin/bash

##############################################################################
# Demonstrates how to manually build Ascent and its dependencies, including:
#
#  hdf5, conduit, vtk-m, mfem, raja, and umpire
#
# usage example:
#   env enable_mpi=ON enable_openmp=ON ./build_ascent.sh
#
#
# Assumes: 
#  - cmake is in your path
#  - selected compilers (including nvcc) are in your path or set via env vars
#  - [when enabled] MPI and Python (+numpy and mpi4py), are in your path
#
##############################################################################
set -eu -o pipefail

CC="${CC:=gcc}"
CXX="${CXX:=g++}"
FTN="${FTN:=gfortran}"

CUDA_ARCH="${CUDA_ARCH:=80}"
CUDA_ARCH_VTKM="${CUDA_ARCH_VTKM:=ampere}"

##############################################################################
# Build Options
##############################################################################

# shared options
enable_fortran="${enable_fortran:=OFF}"
enable_python="${enable_python:=OFF}"
enable_openmp="${enable_openmp:=OFF}"
enable_mpi="${enable_mpi:=OFF}"
enable_tests="${enable_tests:=ON}"
enable_verbose="${enable_verbose:=ON}"
build_jobs="${build_jobs:=6}"

# tpl controls
build_hdf5="${build_hdf5:=true}"
build_conduit="${build_conduit:=true}"
build_vtkm="${build_vtkm:=true}"
build_camp="${build_camp:=true}"
build_raja="${build_raja:=true}"
build_umpire="${build_umpire:=true}"
build_mfem="${build_mfem:=true}"

# ascent options
build_ascent="${build_ascent:=true}"

root_dir=$(pwd)

################
# HDF5
################
hdf5_version=1.12.2
hdf5_src_dir=${root_dir}/hdf5-${hdf5_version}
hdf5_build_dir=${root_dir}/build/hdf5-${hdf5_version}/
hdf5_install_dir=${root_dir}/install/hdf5-${hdf5_version}/
hdf5_tarball=hdf5-${hdf5_version}.tar.gz

if ${build_hdf5}; then
if [ ! -d ${hdf5_src_dir} ]; then
  echo "**** Downloading ${hdf5_tarball}"
  curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.2/src/hdf5-1.12.2.tar.gz -o ${hdf5_tarball}
  tar -xzf ${hdf5_tarball}
fi

echo "**** Configuring HDF5 ${hdf5_version}"
cmake -S ${hdf5_src_dir} -B ${hdf5_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${hdf5_install_dir}

echo "**** Building HDF5 ${hdf5_version}"
cmake --build ${hdf5_build_dir} -j${build_jobs}
echo "**** Installing HDF5 ${hdf5_version}"
cmake --install ${hdf5_build_dir}

fi # build_hdf5

################
# Conduit
################
conduit_version=v0.8.4
conduit_src_dir=${root_dir}/conduit-${conduit_version}/src
conduit_build_dir=${root_dir}/build/conduit-${conduit_version}/
conduit_install_dir=${root_dir}/install/conduit-${conduit_version}/
conduit_tarball=conduit-${conduit_version}-src-with-blt.tar.gz

if ${build_conduit}; then
if [ ! -d ${conduit_src_dir} ]; then
  echo "**** Downloading ${conduit_tarball}"
  curl -L https://github.com/LLNL/conduit/releases/download/${conduit_version}/${conduit_tarball} -o ${conduit_tarball}
  tar -xzf ${conduit_tarball}
fi

echo "**** Configuring Conduit ${conduit_version}"
cmake -S ${conduit_src_dir} -B ${conduit_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${conduit_install_dir} \
  -DENABLE_FORTRAN=${enable_fortran} \
  -DENABLE_MPI=${enable_mpi} \
  -DENABLE_PYTHON=${enable_python} \
  -DENABLE_TESTS=${enable_tests} \
  -DHDF5_DIR=${hdf5_install_dir}

echo "**** Building Conduit ${conduit_version}"
cmake --build ${conduit_build_dir} -j${build_jobs}
echo "**** Installing Conduit ${conduit_version}"
cmake --install ${conduit_build_dir}

fi # build_conduit

################
# VTK-m
################
vtkm_version=v1.8.0
vtkm_src_dir=${root_dir}/vtk-m-${vtkm_version}
vtkm_build_dir=${root_dir}/build/vtk-m-${vtkm_version}
vtkm_install_dir=${root_dir}/install/vtk-m-${vtkm_version}/
vtkm_tarball=vtk-m-${vtkm_version}.tar.gz

if ${build_vtkm}; then
if [ ! -d ${vtkm_src_dir} ]; then
  echo "**** Downloading ${vtkm_tarball}"
  curl -L https://gitlab.kitware.com/vtk/vtk-m/-/archive/${vtkm_version}/${vtkm_tarball} -o ${vtkm_tarball}
  tar -xzf ${vtkm_tarball}
fi

echo "**** Configuring VTK-m ${vtkm_version}"
cmake -S ${vtkm_src_dir} -B ${vtkm_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DVTKm_NO_DEPRECATED_VIRTUAL=ON \
  -DVTKm_USE_64BIT_IDS=OFF \
  -DVTKm_USE_DOUBLE_PRECISION=ON \
  -DVTKm_USE_DEFAULT_TYPES_FOR_ASCENT=ON \
  -DVTKm_ENABLE_BENCHMARKS=OFF\
  -DVTKm_ENABLE_RENDERING=ON \
  -DVTKm_ENABLE_TESTING=OFF \
  -DBUILD_TESTING=OFF \
  -DVTKm_ENABLE_BENCHMARKS=OFF\
  -DVTKm_ENABLE_MPI=OFF \
  -DVTKm_ENABLE_CUDA=ON \
  -DCMAKE_CUDA_HOST_COMPILER=${CXX}\
  -DVTKm_CUDA_Architecture=${CUDA_ARCH_VTKM} \
  -DCMAKE_INSTALL_PREFIX=${vtkm_install_dir}

echo "**** Building VTK-m ${vtkm_version}"
cmake --build ${vtkm_build_dir} -j${build_jobs}
echo "**** Installing VTK-m ${vtkm_version}"
cmake --install ${vtkm_build_dir}

fi # build_vtkm


################
# Camp
################
camp_version=2022.03.2
camp_src_dir=${root_dir}/camp-${camp_version}
camp_build_dir=${root_dir}/build/camp-${camp_version}
camp_install_dir=${root_dir}/install/camp-${camp_version}/
camp_tarball=camp-${camp_version}.tar.gz

if ${build_camp}; then
if [ ! -d ${camp_src_dir} ]; then
  echo "**** Cloning Camp ${camp_version}"
  # clone since camp releases don't contain submodules
  git clone --recursive --depth 1 --branch v${camp_version} https://github.com/LLNL/camp.git camp-${camp_version}
  # curl -L https://github.com/LLNL/camp/archive/refs/tags/v${camp_version}.tar.gz -o ${camp_tarball} 
  # tar -xzf ${camp_tarball} 
fi

echo "**** Configuring Camp ${camp_version}"
cmake -S ${camp_src_dir} -B ${camp_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DCMAKE_C_COMPILER=${CC} \
  -DCMAKE_CXX_COMPILER=${CXX} \
  -DENABLE_CUDA=ON \
  -DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCH} \
  -DENABLE_TESTS=OFF \
  -DCMAKE_INSTALL_PREFIX=${camp_install_dir}

echo "**** Building Camp ${camp_version}"
cmake --build ${camp_build_dir} -j${build_jobs}
echo "**** Installing Camp ${camp_version}"
cmake --install ${camp_build_dir}

fi # build_camp


################
# RAJA
################
raja_version=v2022.03.0
raja_src_dir=${root_dir}/RAJA-${raja_version}
raja_build_dir=${root_dir}/build/raja-${raja_version}
raja_install_dir=${root_dir}/install/raja-${raja_version}/
raja_tarball=RAJA-${raja_version}.tar.gz

if ${build_raja}; then
if [ ! -d ${raja_src_dir} ]; then
  echo "**** Downloading ${raja_tarball}"
  curl -L https://github.com/LLNL/RAJA/releases/download/${raja_version}/${raja_tarball} -o ${raja_tarball} 
  tar -xzf ${raja_tarball} 
fi

echo "**** Configuring RAJA ${raja_version}"
cmake -S ${raja_src_dir} -B ${raja_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON\
  -DCMAKE_C_COMPILER=${CC} \
  -DCMAKE_CXX_COMPILER=${CXX} \
  -DENABLE_OPENMP=OFF \
  -DENABLE_CUDA=ON \
  -DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCH} \
  -Dcamp_DIR=${camp_install_dir} \
  -DENABLE_TESTS=OFF \
  -DENABLE_EXAMPLES=OFF \
  -DENABLE_EXERCISES=OFF \
  -DCMAKE_INSTALL_PREFIX=${raja_install_dir}  
  

echo "**** Building RAJA ${raja_version}"
cmake --build ${raja_build_dir} -j${build_jobs}
echo "**** Installing RAJA ${raja_version}"
cmake --install ${raja_build_dir}

fi # build_raja

################
# Umpire
################
umpire_version=2022.03.1
umpire_src_dir=${root_dir}/umpire-${umpire_version}
umpire_build_dir=${root_dir}/build/umpire-${umpire_version}
umpire_install_dir=${root_dir}/install/umpire-${umpire_version}/
umpire_tarball=umpire-${umpire_version}.tar.gz

if ${build_umpire}; then
if [ ! -d ${umpire_src_dir} ]; then
  echo "**** Downloading ${umpire_tarball}"
  curl -L https://github.com/LLNL/Umpire/releases/download/v${umpire_version}/${umpire_tarball} -o ${umpire_tarball}
  tar -xzf ${umpire_tarball}
fi

echo "**** Configuring Umpire ${umpire_version}"
cmake -S ${umpire_src_dir} -B ${umpire_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DCMAKE_C_COMPILER=${CC} \
  -DCMAKE_CXX_COMPILER=${CXX} \
  -DENABLE_CUDA=ON \
  -DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCH} \
  -Dcamp_DIR=${camp_install_dir} \
  -DENABLE_OPENMP=${enable_openmp} \
  -DENABLE_TESTS=${enable_tests} \
  -DCMAKE_INSTALL_PREFIX=${umpire_install_dir}

echo "**** Building Umpire ${umpire_version}"
cmake --build ${umpire_build_dir} -j${build_jobs}
echo "**** Installing Umpire ${umpire_version}"
cmake --install ${umpire_build_dir}

fi # build_umpire

################
# MFEM
################
mfem_version=4.4
mfem_src_dir=${root_dir}/mfem-${mfem_version}
mfem_build_dir=${root_dir}/build/mfem-${mfem_version}
mfem_install_dir=${root_dir}/install/mfem-${mfem_version}/
mfem_tarball=mfem-${mfem_version}.tar.gz

if ${build_mfem}; then
if [ ! -d ${mfem_src_dir} ]; then
  echo "**** Downloading ${mfem_tarball}"
  curl -L https://github.com/mfem/mfem/archive/refs/tags/v4.4.tar.gz -o ${mfem_tarball}
  tar -xzf ${mfem_tarball}
fi

echo "**** Configuring MFEM ${mfem_version}"
cmake -S ${mfem_src_dir} -B ${mfem_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=ON \
  -DMFEM_USE_CONDUIT=ON \
  -DCMAKE_PREFIX_PATH="${conduit_install_dir}" \
  -DCMAKE_INSTALL_PREFIX=${mfem_install_dir}

echo "**** Building MFEM ${vtkm_version}"
cmake --build ${mfem_build_dir} -j${build_jobs}
echo "**** Installing MFEM ${mfem_version}"
cmake --install ${mfem_build_dir}

fi # build_mfem


################
# Ascent
################
ascent_version=develop
ascent_src_dir=${root_dir}/ascent/src
ascent_build_dir=${root_dir}/build/ascent-${ascent_version}/
ascent_install_dir=${root_dir}/install/ascent-${ascent_version}/

echo "**** Creating Ascent host-config (ascent-config.cmake)"
#
echo '# host-config file generated by build_ascent.sh' > ascent-config.cmake
echo 'set(CMAKE_VERBOSE_MAKEFILE ' ${enable_verbose} 'CACHE BOOL "")' >> ascent-config.cmake
echo 'set(CMAKE_C_COMPILER ' ${CC} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CMAKE_CXX_COMPILER ' ${CXX} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CMAKE_BUILD_TYPE Release CACHE STRING "")' >> ascent-config.cmake
echo 'set(CMAKE_INSTALL_PREFIX ' ${ascent_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(ENABLE_MPI ' ${enable_mpi} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_FORTRAN ' ${enable_fortran} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_PYTHON ' ${enable_python} ' CACHE BOOL "")' >> ascent-config.cmake
echo 'set(BLT_CXX_STD c++14 CACHE STRING "")' >> ascent-config.cmake
echo 'set(ENABLE_CUDA ON CACHE BOOL "")' >> ascent-config.cmake
echo 'set(CMAKE_CUDA_ARCHITECTURES ' ${CUDA_ARCH} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CONDUIT_DIR ' ${conduit_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(VTKM_DIR ' ${vtkm_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(CAMP_DIR ' ${camp_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(RAJA_DIR ' ${raja_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(UMPIRE_DIR ' ${umpire_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(MFEM_DIR ' ${mfem_install_dir} ' CACHE PATH "")' >> ascent-config.cmake
echo 'set(ENABLE_VTKH ON CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_APCOMP ON CACHE BOOL "")' >> ascent-config.cmake
echo 'set(ENABLE_DRAY ON CACHE BOOL "")' >> ascent-config.cmake

if ${build_ascent}; then
if [ ! -d ${ascent_src_dir} ]; then
    echo "**** Cloning Ascent"
    git clone --recursive https://github.com/Alpine-DAV/ascent.git
fi

echo "**** Configuring Ascent"
cmake -S ${ascent_src_dir} -B ${ascent_build_dir} \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose} \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=${ascent_install_dir} \
  -DENABLE_MPI=${enable_mpi} \
  -DENABLE_FORTRAN=${enable_fortran} \
  -DENABLE_TESTS=$enable_tests \
  -DENABLE_PYTHON=${enable_python} \
  -DBLT_CXX_STD=c++14 \
  -DENABLE_CUDA=ON \
  -DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCH} \
  -DCONDUIT_DIR=${conduit_install_dir} \
  -DVTKM_DIR=${vtkm_install_dir} \
  -DRAJA_DIR=${raja_install_dir} \
  -DUMPIRE_DIR=${umpire_install_dir} \
  -DCAMP_DIR=${camp_install_dir} \
  -DMFEM_DIR=${mfem_install_dir} \
  -DENABLE_VTKH=ON \
  -DENABLE_APCOMP=ON \
  -DENABLE_DRAY=ON

echo "**** Building Ascent"
cmake --build ${ascent_build_dir} -j${build_jobs}
echo "**** Installing Ascent"
cmake --install ${ascent_build_dir}

fi # build_ascent

ParaView Support

Ascent ParaView support is in src/examples/paraview-vis directory. This section describes how to configure, build and run the example integrations provided with Ascent and visualize the results insitu using ParaView. ParaView pipelines are provided for all example integrations. We describe in details the ParaView pipeline for cloverleaf3d in the ParaView Visualization section.

Setup spack

Install spack, modules and shell support.

  • Clone the spack repository:

    git clone https://github.com/spack/spack.git
    cd spack
    source share/spack/setup-env.sh
    
  • If the module command does not exist:

    • install environment-modules using the package manager for your system.
    • run add.modules to add the module command to your .bashrc file
    • Alternatively run spack bootstrap

Install ParaView and Ascent

  • For MomentInvariants (optional module in ParaView for pattern detection) visualization patch ParaView to enable this module:
  • Install ParaView (any version >= 5.7.0). When running on Linux we prefer mpich, which can be specified by using ^mpich.
    • spack install paraview+python3+mpi+osmesa
    • for CUDA use: spack install paraview+python3+mpi+osmesa+cuda
  • Install Ascent
    • spack install ascent~vtkh+python
    • If you need ascent built with vtkh you can use spack install ascent+python. Note that you need specific versions of vtkh and vtkm that work with the version of Ascent built. Those versions can be read from scripts/uberenv/project.json by cloning spack_url, branch spack_branch. paraview-package-momentinvariants.patch is already setup to patch vtkh and vthm with the correct versions, but make sure it is not out of date.
  • Load required modules: spack load conduit;spack load python;spack load py-numpy;spack load py-mpi4py;spack load paraview

Setup and run example integrations

You can test Ascent with ParaView support by running the available integrations. Visualization images will be generated in the current directory. These images can be checked against the images in src/examples/paraview-vis/tests/baseline_images.

  • Test proxies/cloverleaf3d

    • Go to a directory where you intend to run cloverleaf3d integration (for summit.olcf.ornl.gov use a member work directory such as cd $MEMBERWORK/csc340) so that the compute node can write there.

    • Create links to required files for cloverleaf3d:

      • ln -s $(spack location --install-dir ascent)/examples/ascent/paraview-vis/paraview_ascent_source.py

      • ln -s $(spack location --install-dir ascent)/examples/ascent/paraview-vis/paraview-vis-cloverleaf3d.py paraview-vis.py for surface visualization.

      • Or ln -s $(spack location --install-dir ascent)/examples/ascent/paraview-vis/paraview-vis-cloverleaf3d-momentinvariants.py paraview-vis.py for MomentInvariants visualization (Optional)

      • ln -s $(spack location --install-dir ascent)/examples/ascent/paraview-vis/ascent_actions.json
        ln -s $(spack location --install-dir ascent)/examples/ascent/paraview-vis/expandingVortex.vti
        ln -s $(spack location --install-dir ascent)/examples/ascent/proxies/cloverleaf3d/clover.in
        
    • Run the simulation

      $(spack location --install-dir mpi)/bin/mpiexec -n 2 $(spack location --install-dir ascent)/examples/ascent/proxies/cloverleaf3d/cloverleaf3d_par > output.txt 2>&1

    • Examine the generated images

  • Similarily test proxies/kripke, proxies/laghos, proxies/lulesh, synthetic/noise. After you create the apropriate links similarily with cloverleaf3d you can run these simulations with:

    • $(spack location --install-dir mpi)/bin/mpiexec -np 8 ./kripke_par --procs 2,2,2 --zones 32,32,32 --niter 5 --dir 1:2 --grp 1:1 --legendre 4 --quad 4:4 > output.txt 2>&1
    • $(spack location --install-dir mpi)/bin/mpiexec -n 8 ./laghos_mpi -p 1 -m data/cube01_hex.mesh -rs 2 -tf 0.6 -visit -pa > output.txt 2>&1
    • $(spack location --install-dir mpi)/bin/mpiexec -np 8 ./lulesh_par -i 10 -s 32 > output.txt 2>&1
    • $(spack location --install-dir mpi)/bin/mpiexec -np 8 ./noise_par  --dims=32,32,32 --time_steps=5 --time_delta=1 > output.txt 2>&1

Setup and run on summit.olcf.ornl.gov

  • Execute section Setup spack

  • Configure spack

    • add a file ~/.spack/packages.yaml with the following content as detailed next. This insures that we use spectrum-mpi as the MPI runtime.

      packages:
        spectrum-mpi:
          buildable: false
          externals:
          - modules:
            - spectrum-mpi/10.3.1.2-20200121
            spec: spectrum-mpi@10.3.1.2-20200121
        cuda:
          buildable: false
          externals:
          - modules:
            - cuda/10.1.168
            spec: cuda@10.1.168
      
    • Load the correct compiler:

      module load gcc/7.4.0
      spack compiler add
      spack compiler remove gcc@4.8.5
      
  • Compile spack packages on a compute node

    • For busy summit I got internal compiler error when compiling llvm and paraview on the login node. To fix this, move the spack installation on $MEMBERWORK/csc340 and compile everything on a compute node.
      • First login to a compute node: bsub -W 2:00 -nnodes 1 -P CSC340 -Is /bin/bash
      • Install all spack packages as in Install ParaView and Ascent with -j80 option (there are 84 threads)
      • Disconnect from the compute node: exit.
  • Continue with Setup and run example integrations but run the integrations as described next:

    • Execute cloverleaf bsub $(spack location --install-dir ascent)/examples/ascent/paraview-vis/summit-moment-invariants.lsf
    • To check if the integration finished use: bjobs -a

Nightly tests

We provide a docker file for Ubuntu 18.04 and a script that installs the latest ParaView and Ascent, runs the integrations provided with Ascent, runs visualizations using ParaView pipelines and checks the results. See tests/README-docker.md for how to create the docker image, run the container and execute the test script.

Notes

  • Global extents are computed for uniform and rectilinear topologies but they are not yet computed for a structured topology (lulesh). This means that for lulesh and datasets that have a structured topology we cannot save a correct parallel file that represents the whole dataset.
  • For the laghos simulation accessed through Python extracts interface, only the higher order mesh is accessible at the moment, which is a uniform dataset. The documentation shows a non-uniform mesh but that is only available in the vtkm pipelines.