Source Code#
The DAMASK core is written in Fortran 2018 with a few enhancements in C and C++. A Unix-style operating 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 pre- and post-processing tools are written in Python 3. They are the only parts of DAMASK that can be installed on Windows directly.
Warning
Compilation from source is only recommended for developers and users with profound knowledge of Unix-style operating systems.
Get an overview of the prerequisites present on your system:
wget --quiet https://damask-multiphysics.org/installation/files/DAMASK_prerequisites.sh -O - | sh
cat system_report.txt
Clone the DAMASK GitHub repository and checkout the development branch:
git clone https://github.com/damask-multiphysics/DAMASK.git --branch development
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 required 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 necessary:
BLAS/LAPACK
HDF5 with MPI and Fortran support
zlib (grid solver only)
FFTW with MPI support (grid solver only)
Packages such as SuperLU, HYPRE, MUMPS, or ML for certain sparse linear solvers
The PETSc setup can be tested with the help of a small example:
wget https://damask-multiphysics.org/installation/files/PETSc_test.tar.xz
tar -xf PETSc_test.tar.xz
cd PETSc_test
make PETSc_test
mpirun -np 2 ./PETSc_test
Full support of YAML 1.2 needs libfyaml to be installed. CMake uses pkg-config to locate the installation location.
If all prerequisites are installed, compilation and installation follows the standard CMake procedure:
cmake -S DAMASK -B build-grid -DDAMASK_SOLVER=grid
cmake --build build-grid --target install
cmake -S DAMASK -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 the wrapper is indeed using ifort with:
h5fc -show
The HDF5 setup can be tested with the help of a small example:
wget https://damask-multiphysics.org/installation/files/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 system package) and patch (typically installed by default) need to be installed. The following command applies the DAMASK modifications assuming the standard installation folder for MSC Marc:
export PYTHONPATH=${PWD}/DAMASK/python:${PYTHONPATH}
./DAMASK/install/MarcMentat/MSC_modifications.py
In case of 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
.
Changes made by MSC_modifications.py
The original Marc/Mentat installation remains fully operational after these changes!
Mentat
In
MSCpath/mentat20??/bin/
the script edit_window is altered to use a text editor according to the value of option--editor
.The file
MSCpath/mentat20??/menus/job_run.ms
is modified and compiled intoMSCpath/mentat20??/menus/linux64/main.msb
to add a DAMASK menu to Jobs Run from where you can start DAMASK using different optimization levels (0, 1, 2).In
MSCpath/mentat20??/bin/
submit4 to submit6 scripts are added, which call the run_damask[l, ,h] scripts.In
MSCpath/mentat20??/bin/
kill4 to kill6 scripts are added, which kill the respective jobs.
Marc
In
MSCpath/marc20??/tools/
run_damask[l, ,h] and compile_damask[l, ,h] scripts are added, which can treat *.f90 source files (compatible with free-format DAMASK). Naming convention: ‘l’ is for O0, ‘ ‘ for O1, and ‘h’ for O2 optimization.DAMASK Fortran compiler calls, modified according to the needs of DAMASK, are added in
MSCpath/marc20??/tools/include_linux64
.
Pre- and Post-Processing Tools#
If all requirements are installed, it suffices to add the location of the Python code to the PYTHONPATH environment variable:
cd DAMASK/python
export PYTHONPATH=${PWD}:${PYTHONPATH}
cd DAMASK/python
$env:PYTHONPATH = $pwd,$env:PYTHONPATH
Installation via pip is also possible but requires alteration of the git describe
-based version string in VERSION
to be compatible with PEP440.
cd DAMASK/python
sed -i 's/-/.dev/;s/-g/+/' damask/VERSION
pip install .
cd DAMASK/python
sed -i '' 's/-/.dev/;s/-g/+/' damask/VERSION
pip install .