Kaskade 7 relies on several third party libraries for grid management and solvers. 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.
We provide two flavors of container images:
Both container images are intended to be used in a rootless mode with podman, such that any non-root developer on multi-user Linux systems can easily use them.
Download the build environment and complete package images and load them into your podman system. We need to fetch both images as the complete package image may depend on the build system image. Then start the container, mounting your project’s working directory to the /project directory in the container:
curl https://www.zib.de/other/kaskade7/container/images/kaskade7-build-environment.tar.gz | gunzip | podman load
curl https://www.zib.de/other/kaskade7/container/images/kaskade7-complete.tar.gz | gunzip | podman load
podman run -it -v your-project-directory:/project -p 8080:8080 --rm kaskade7-complete
The images are intended to be used unchanged, and everything you modify should reside on the host
filesystem. Consequently, containers are disposable, and will be removed after leaving the
container shell (flag -rm).
Kaskade 7 is installed under /kaskade7 in the container and ready to be used. The dependency installation paths are listed in /Makefile.Local.
The container runs a micro web server handing out the doxygen documentation for Kaskade 7.
Point your browser to http://localhost:8080 to access it (flag -p).
Tutorial examples and tests are not pre-compiled in the complete package image. 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.
Smaller projects mainly relying on Kaskade 7 can benefit from using the Kaskade 7 make structure directly. Here is a short template for a project Makefile that can be a start for your project:
# 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
FLAGS = -g -Wall
default: main
# Some object file purely as 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: main.o module.o $(KASKADE7)/libs/*.o $(KASKADE7)/libs/*.a
$(CXX) main.o module.o $(KASKADE7)/libs/*.o $(KASKADELIB) $(DUNELIB) $(UGLIB) \
$(BOOSTLIB) $(DIRECTSOLVERLIB) $(BLASLIB) $(FTNLIB) $(NUMALIB) \
$(LINKFLAGS) $(FLAGS) -o $@
clean:
rm -f gccerr.txt main $(OBJ)
If you have access to the ZIB gitlab server, check out a working copy by:
git clone git@git.zib.de:numerical-mathematics/computational-anatomy-and-physiology/kaskade7.git
Otherwise, you can extract the Kaskade 7 source code from the kaskade7-complete container image.
Create a suitable Makefile.Local file in your Kaskade 7 working directory. The
Makefile.Local-container template provided with Kaskade 7 should do the trick, but you may want
to adapt it to your needs.
Download one build environment image and load it into your podman system:
curl https://www.zib.de/other/kaskade7/container/images/kaskade7-build-environment.tar.gz | gunzip | podman load
Then start the development container. Mount your Kaskade 7 working directory to the /kaskade7
directory in the container (flag -v).
podman run -it -v your-working-directory:/kaskade7 --rm kaskade7-build-environment
This will open an interactive shell (flag -it) in the /kaskade7 directory. You may directly
type
make test run-tutorial
to build the Kaskade 7 library and build and run tests as well as tutorial examples. Dependency
and object files will end up in your host working directory, and the container should remain
unchanged. Consequently, you will want it to be removed when you quit (flag -rm).
Of course, you can use the build environment image as well for separate projects outside of the Kaskade 7 source tree, if you mount your project working directory into the container.
If the container development environments do not fit your needs, feel free to install the required dependencies on your own. It’s no fun, but also no magic.