Setting Kaskade 7 up

Kaskade 7 relies on several third party libraries for grid management, direct and iterative solvers, and parallel linear algebra. Installing these dependencies is no fun. We therefore provide container-based development environments with everything pre-installed. These should cover most development scenarios. If they don’t fit, you can of course install the required libraries directly, see below.

Obtain the Kaskade 7 source code

If you have access to the ZIB GitLab server, check out a working copy:

git clone git@git.zib.de:numerical-mathematics/computational-anatomy-and-physiology/kaskade7.git

Without GitLab access, download the current source snapshot: kaskade7-src.tar.gz. It contains the tracked Kaskade 7 sources at the current release state, without git history or build artifacts. Alternatively, extract the source code from the kaskade7-complete image or obtain it from the public repository.

Unpack the snapshot and change into the resulting directory:

tar -xzf kaskade7-src.tar.gz
cd kaskade7

The following sections assume that you are in this directory.

Container development environments

The container images are built from the scripts in InstallDependencies/ in the Kaskade 7 repository. They require podman. From the repository root, run

InstallDependencies/build.sh

This builds the following images:

  • kaskade7-build-environment: provides the C++20 toolchain (GCC 16), Dune 2.11, Boost, SuiteSparse, MUMPS, Metis, Hypre, SuperLU, ITSOL, and OpenBLAS/LAPACK. It is the right choice if you intend to work on Kaskade 7 itself or want to compile your own project against a local Kaskade 7 working copy.
  • kaskade7-complete: contains the build environment plus a prebuilt Kaskade 7 library and its Doxygen documentation. This is the perfect choice if you want to use Kaskade 7 for a project, but do not want to modify Kaskade 7 itself.
  • kaskade7-amira: the build environment with the additional, non-free AmiraMesh library for reading and writing Amira .am files. This image is deprecated; Amira support will be dropped in Kaskade 7.9. It is only built if the libamiramesh.tar.gz archive is present.

The images are intended to be used in rootless mode with podman, such that any non-root developer on a multi-user Linux system can use them. All images serve the Doxygen documentation at http://localhost:8080/ (set DOCS_PORT to use a different port).

Using the complete package

Start the complete container with your project directory mounted at /workspace:

InstallDependencies/startComplete.sh your-project-directory

Kaskade 7 is installed under /kaskade7 and ready to be used. The dependency installation paths are listed in /kaskade7/Makefile.Local (in the image, /Makefile.Local is the third-party configuration). The container runs a small web server handing out the Doxygen documentation for Kaskade 7. Point your browser to http://localhost:8080 to access it.

The library and the documentation are prebuilt, but tutorial examples and tests are not. If you want to run them, go to /kaskade7 and execute:

make test
make run-tutorial

A list of supported make targets is produced by make help.

Using the Kaskade 7 make structure

Smaller projects that mainly rely on Kaskade 7 can benefit from using the Kaskade 7 make structure directly. Here is a short template for a project Makefile:

# Include the Kaskade 7 path and library setup
include /kaskade7/Makefile.Local

# Include the make rules for building object and dependency files
include $(KASKADE7)/Makefile.Rules

# Start with a debug build. Append to FLAGS instead of replacing it, because
# Makefile.Local already contains the required language and platform flags.
FLAGS += -g -Wall

default: main

# Some object files, purely as an arbitrary example
OBJ = main.o module.o

# Include the dependency files for the objects. This triggers the building of
# dependency files, and their presence ensures that the implicit compilation
# rule for creating objects (defined in Makefile.Rules) is found by make.
include $(patsubst %.o, %.d, $(OBJ))

# Build the target executable.
main: $(OBJ) $(KASKADE7)/libs/libkaskade.a
	$(CXX) $(OBJ) $(KASKADE7)/libs/*.o $(KASKADELIB) $(DUNELIB) $(UGLIB) \
	$(BOOSTLIB) $(DIRECTSOLVERLIB) $(BLASLIB) $(FTNLIB) $(NUMALIB) \
	$(LINKFLAGS) $(FLAGS) -o $@

clean:
	rm -f gccerr.txt main $(OBJ)

Using the build environment

Start the build environment

Create a suitable Makefile.Local file in your Kaskade 7 working directory. The Makefile.Local-container template provided with Kaskade 7 should work out of the box in the container:

cp Makefile.Local-container Makefile.Local

Then start the development container. The Kaskade 7 working copy is mounted at /kaskade7, your project directory at /workspace:

InstallDependencies/startBuildEnvironment.sh your-project-directory

This opens an interactive shell in the /kaskade7 working directory. You may directly type

make all

to build the library and the Doxygen documentation and to run the test suite. make tutorial builds the tutorial examples and make run-tutorial runs them. Dependency and object files end up in your host working directory, and the container remains disposable (--rm is passed by the start script).

Of course, you can use the build environment image as well for separate projects outside of the Kaskade 7 source tree; mount your project directory at /workspace and use the Kaskade 7 make structure shown above.

Direct installation of dependencies

If the container development environments do not fit your needs, you can install the required dependencies on your own. It’s no fun, but also no magic.

Mandatory components

  • a Linux system (Windows and Mac have been used occasionally but are not regularly tested)
  • a recent compiler for C++20 (GCC 16 is known to work; Kaskade 7.8 uses C++20)
  • Boost libraries
  • libnuma
  • BLAS/LAPACK
  • Dune 2.11, the Distributed and Unified Numerics Environment, with the modules dune-common, dune-geometry, dune-localfunctions, dune-istl, dune-grid, and dune-uggrid (for grid data structures, some linear algebra, and infrastructure)
  • direct sparse solvers: SuiteSparse (UMFPACK and CHOLMOD), MUMPS, and optionally SuperLU and PARDISO
  • graph partitioning (Metis)
  • some iterative solvers (ITSOL 2, Hypre)

Optional but useful

  • ParaView and gnuplot (for visualization)
  • valgrind and gdb (for debugging)
  • AmiraMesh, only if you need to read or write Amira .am files. This is deprecated and will be removed in Kaskade 7.9.

The exact compiler and library versions matter. In particular, Kaskade 7.8 is tested with Dune 2.11 and GCC 16. Older Dune versions are not supported by the current master branch.


Page last modified: 2026-11-13