Build instructions
The mCRL2 source code can be obtained in two ways. The source code for releases of the toolset are available as a source tarball, see Download mCRL2. The source code for the development version of the toolset is available in our Git repository hosted at Github. It can be obtained using the following command:
$ git clone https://github.com/mCRL2org/mCRL2.git
In the remainder of this manual, we assume that you have the source code on your
system in a folder called mCRL2. We will use an out-of-source build directory,
referred to as <build>. Setting CMAKE_EXPORT_COMPILE_COMMANDS to ON
produces a compile_commands.json in the build directory, which is used by
VS Code and other IDE plugins for code navigation and analysis.
Note
The mCRL2 toolset requires Qt and OpenGL for compilation of the graphical tools (diagraphica, ltsgraph, ltsview, lpsxsim, mcrl2-gui, mcrl2xi). If this is undesirable then building the graphical tools can be disabled using the MCRL2_ENABLE_GUI_TOOLS cmake flag.
See the platform specific instructions for Windows, MacOS and Linux. For testing see the documentation here.
Python dependencies
If you don’t want to install Python libraries system wide, you can set up a Python virtual environment (needs to be done only once) in the build directory:
$ python3 -m venv sphinx-venv
Activate it:
$ source sphinx-venv/bin/activate
Afterwards dependencies can be installed using pip as follows:
$ pip install -r <mCRL2>/requirements.txt
When using a virtual environment ensure that CMake uses the right Python binary:
$ cmake [other options] \
-DPython_EXECUTABLE=absolute/path/to/sphinx-venv/bin/python \
<mCRL2-build>
Documentation
To build the documentation we need various dependencies depending on what exact
configuration is being used. First of all the cmake flag
MCRL2_ENABLE_DOCUMENTATION must be enabled to build the documentation.
Then the doc target can be build for a full documentation build, or fastdoc
to avoid cleaning up the intermediate results. The documentation build can be
fine tuned using the following cmake configuration flags.
MCRL2_ENABLE_DOC_DOXYGENenables building the source code documentation using doxygen, this requires Doxygen to be installed with at least version 1.9.7.
MCRL2_ENABLE_DOC_PDFLATEXenables building the pdfs that are found in the library documentation, this required pdflatex to be installed with various packages.
MCRL2_ENABLE_DOC_MANUALenables building the tool documentation pages, which requires the tools to be compiled.
CMake configuration flags
All three methods allow you to change the value of CMake configuration variables. Below, we describe the meaning of these variables. Note that in the graphical user interfaces, some advanced settings are initially hidden.
Note
For a typical installation of mCRL2, the default settings are
acceptable for all the options listed below. The only common change
is in the path to which mCRL2 must be installed, which can be set
using CMAKE_INSTALL_PREFIX.
Note
Values of the flags are cached and are case insensitive. This implies that when changing a single value, all other flags remain the same.
BOOST_ROOTDefault:: Automatically detected
Specifies the path to the Boost libraries. This is normally automatically detected, but may have to be set manually when Boost was compiled manually, or when detection fails.
CMAKE_BUILD_TYPEDefault:
ReleaseThis variable controls the type of build when using a single-configuration generator like the Makefile generator. This variable has no effect for Visual Studio projects as they contain multiple-configurations.
ReleaseCompile with optimisations enabled. Debug information is not generated.
DebugCompile with extra checks, less optimisation and with generation of debug symbols.
RelwithDebInfoSame as
Release, except that debug information is also generated.Warning
Historically, some extra checks were enabled in this mode. There may therefore still be differences in behaviour, compared to the
Releasesetting.MinSizeRelSame as
Release, but instructs the compiler to optimise for size.CMAKE_INSTALL_PREFIXDefault:
/usr/local/The installation prefix for mCRL2. All mCRL2 files will be installed there.
BUILD_SHARED_LIBSDefault:
ONONGenerate shared libraries, to which the executables link.
OFFGenerate static libraries, which are linked into the executables. This increases the size of executables dramatically.
MCRL2_ENABLE_EXPERIMENTALDefault:
OFFONCompile experimental tools.
OFFDo not compile experimental tools.
MCRL2_ENABLE_DEPRECATEDDefault:
OFFONCompile deprecated tools.
OFFDo not compile deprecated tools.
MCRL2_ENABLE_PROFILINGDefault:
OFFONEnable profiling when executing tools.
OFFDisable profiling when executing tools.
MCRL2_ENABLE_TESTSDefault:
OFFONEnable generation of library and random test targets.
OFFDo not generate library and random test targets.
MCRL2_ENABLE_TOOL_TESTSDefault:
ONONEnable generation of tool tests.
OFFDo not generate tool tests.
MCRL2_ENABLE_DOC_MANUALDefault:
ONONEnable generation of tool manual pages (requires built tools).
OFFDisable generation of tool manual pages.
MCRL2_ENABLE_GUI_TOOLSDefault:
ONONCompile graphical tools (diagraphica, ltsgraph, ltsview, mcrl2-gui, lpsxsim, mcrl2ide).
OFFDo not compile graphical tools.
BUILD_TESTINGDefault:
ONONExecute tests after successful build. Which tests are generated is determined by the
MCRL2_ENABLE_TESTSandMCRL2_ENABLE_TOOL_TESTSconfiguration variables.OFFDo not execute tests.
Qt6_DIRThis variable specifies the location where Qt6 can be found.