Source Code#

A Unix-style operation system is a prerequisite for installation from source. DAMASK has been installed on different GNU/Linux distributions and on MacOS. Compilation on Windows is possible via the Windows Subsystem for Linux (WSL). The DAMASK core is written in Fortran 2018 with a few enhancements in C. The pre- and post-processing tools are written in Python 3.

Warning

Compilation from source is only recommended for developers and users with profound knowledge on Unix-style operating systems.

Get an overview of the prerequisites available on your system:

wget https://damask.mpie.de/files/installation/3.0.0-beta/DAMASK_prerequisites.sh
sh ./DAMASK_prerequisites.sh
cat system_report.txt

Download, check, and unpack the source code:

wget https://damask.mpie.de/download/damask-3.0.0-beta.tar.xz
wget https://damask.mpie.de/download/damask-3.0.0-beta.tar.xz.sha256
sha256sum -c damask-3.0.0-beta.tar.xz.sha256 && \
tar -xf damask-3.0.0-beta.tar.xz
wget https://damask.mpie.de/download/damask-3.0.0-beta.tar.xz
wget https://damask.mpie.de/download/damask-3.0.0-beta.tar.xz.sha256
shasum -a 256 -c damask-3.0.0-beta.tar.xz.sha256 && \
tar -xf damask-3.0.0-beta.tar.xz

Note

The next steps depend on which components (Grid and/or Mesh solver, MSC Marc, or processing tools) you want to install. Please follow the instructions in the relevant section(s) only.

Grid and Mesh Solver#

A recent version of the GNU Compiler Collection, the Intel Parallel Studio XE, or the Intel oneAPI toolkit is needed to build the grid solver and/or mesh solver from source. The solvers included with DAMASK are build with CMake and rely on PETSc. A PETSc installation with support for MPI and the following external packages is needed:

The PETSc setup can be tested with the help of a small example:

wget https://damask.mpie.de/files/installation/3.0.0-beta/PETSc_test.tar.xz
tar -xf PETSc_test.tar.xz
cd PETSc_test
make PETSc_test
mpirun -np 2 ./PETSc_test

For full support of YAML 1.2, a libfyaml installation is needed. CMake uses pkg-config to locate the installation location.

If all prerequisites are installed, compiliation and installation follows the standard CMake procedure:

cmake -S damask-3.0.0-beta -B build-grid -DDAMASK_SOLVER=grid
cmake --build build-grid --target install
cmake -S damask-3.0.0-beta -B build-mesh -DDAMASK_SOLVER=mesh
cmake --build build-mesh --target install

MSC Marc#

Supported versions of MSC Marc are

  • 2023.1, 2023.2, 2023.3 (default)

  • 2022.1, 2022.2, 2022.3, 2022.4

  • 2021.2, 2021.3.1

  • 2020

Install MSC Marc including Marc Mentat and the recommended version of Intel Parallel Studio XE. Then build an 64bit integer version of HDF5 with the Intel compilers using autotools (not CMake):

export FCFLAGS='-fPIC -integer-size 64 -real-size 64 -qopenmp'
export CFLAGS='-fPIC -qopenmp'
CFLAGS=$CFLAGS FCFLAGS=$FCFLAGS FC=ifort CC=icx ./configure \
--disable-parallel --enable-fortran --enable-build-mode=production
make && make install

A successful installation creates a wrapper called h5fc. This wrapper is used by MSC Marc to compile DAMASK. Check whether it is indeed using ifort with:

h5fc -show

The HDF5 setup can be tested with the help of a small example:

wget https://damask.mpie.de/files/installation/3.0.0-beta/HDF5_test.F90
h5fc HDF5_test.F90 -o HDF5_test
./HDF5_test

As a final step, apply the DAMASK modifications to the MSC Marc installation. For this, xvfb-run (typically available as a sytem package) and patch (typically installed by default) need to be installed. The following command applies the DAMASK modifications using the standard installation folder for MSC Marc:

export PYTHONPATH=${PWD}/damask-3.0.0-beta/python:${PYTHONPATH}
./damask-3.0.0-beta/install/MarcMentat/MSC_modifications.py

if you use a non-standard MSC Marc setup, use --marc-root and --marc-version to set path and version, respectively.

Note

To see all options of MSC_modifications.py, invoke it with --help.

Pre- and Post-Processing Tools#

Compiliation and installation follows the standard pip procedure:

cd damask-3.0.0-beta/python
pip install .