Skip to main content

Manual installation of DES3D

Docker image coming soon!

Requirements

  1. A C++ compiler that supports C++11 standard. GNU g++ 5.0 or newer will suffice
  2. Boost::Program_options library. Version 1.42 or newer. Boost is a large set of libraries. To install only program_options library, follow these stpes:
    1. First download the source code from [https://www.boost.org].

    2. In the untarred source directory, run:

      ./bootstrap.sh

      In the same directory, build the library by running:

      ./b2 --with-program_options -q
  3. Python 3.2+
  4. Numpy for post-processing
  5. Optional:
    1. MMG: mesh adaptation library for adaptive remeshing. Bundled as a git submodule — no separate installation required (see below).
    2. Exodus: For importing a mesh in the ExodusII format. Available as a part of SEACAS project [https://github.com/gsjaardema/seacas/]

Submodules (mmg, nanoflann, knn-bvh)

mmg, nanoflann, and knn-bvh are bundled as git submodules and built automatically by make — no separate installation or path configuration is required. After cloning, initialize them once:

git submodule update --init --recursive

make will also auto-initialize stale submodules, but running the command above explicitly after cloning is recommended.

Configuration

Required dependencies

boost::program_options

Modify BOOST_ROOT_DIR in Makefile if you manually built or installed boost library. If you followed the instructions above to build Boost::Program_options library, set BOOST_ROOT_DIR to the untarred boost directory.

Build options

Parameter NamePossible ValuesDescription
ndims2, 3Choose 2 for two-dimensional models (dynearthsol2d) or 3 for three-dimensional models (dynearthsol3d).
opt0, 1, 2, 3Integer value for optimization level.
openacc0, 1Disable (0) or enable (1) OpenACC build.
openmp0, 1Disable (0) or enable (1) OpenMP build.
nprof0, 1Disable (0) or enable (1) profiling with nprof.
gprof0, 1Disable (0) or enable (1) profiling with gprof.
usemmg0, 1Disable (0) or enable (1) mesh optimization during remeshing with mmg.
useexo0, 1Disable (0) or enable (1) import of an .exo mesh, usually created with the meshing software, CUBIT. Note: Only a 3D mesh can be imported currently.
use_gpu_knn0, 1Enable GPU-accelerated k-nearest-neighbour search via BVH (requires openacc = 1). Reduces remeshing time by ~61 % on GPU. Requires the knn-bvh submodule.
SOA0, 1Enable Structure-of-Arrays memory layout for Array2D. Improves remeshing speed by >2× on CPU and is beneficial on GPU (H100). Default off.

Optional external libraries

ExodusII

If you want to import an ExodusII mesh (.exo),

  • install SEACAS enabling exodus support
  • set useexo = 1 and ndims = 3. Only 3D exodus mesh can be imported.
  • set EXO_INCLUDE and EXO_LIB_DIR in Makefile based on the SEACAS installation path.

MMG

MMG is bundled as a git submodule and built automatically — no manual installation or path configuration is needed. To enable it:

  • set usemmg = 1 (both ndims=2 and ndims=3 are supported).

For further information, see Adaptive mesh refinement with MMG.

Building

$ make

Build options can be set on the command line without editing Makefile: e.g.,

  • To build optimized executable (default optimization level, 1): make
  • To build a debugging executable: make opt=0
  • To build the executable without OpenMP: make openmp=0
    • This build is necessary to debug the code under valgrind.

macOS (Apple Silicon)

Building on macOS requires LLVM OpenMP (Apple's built-in Clang does not ship with libomp). Install it with Homebrew:

brew install llvm

Then point the build at LLVM's OpenMP:

make LLVM_DIR=$(brew --prefix llvm)

At startup, DES3D automatically sets OMP_WAIT_POLICY=active on macOS to avoid a performance regression caused by libomp's default zero-blocktime on Apple Silicon. You can override this by setting the variable in your environment before running the executable.