Views
Build instructions
From MCRL2
Contents |
Introduction
The toolset relies on Boost Build v2 as its primary build engine with a slim autotools generated layer wrapped around it. Boost Build v2 itself is a collection of files in a language called Jam. The build tool is called bjam (for Boost jam) which is an interpreter for the Boost dialect of Jam. Bjam is distributed as part of the toolset and it is bootstrapped when executing `make bjam'. Details on how to use Boost Build can be found on its homepage.
A copy of the source tree can be obtained in two ways:
- Download a compressed archive of the source distribution from a release or a development version from the download page.
- Use Subversion to checkout a version of the source tree.
The Subversion revision control system is used for storing the source code of the mCRL2 toolset in a repository. Using a Subversion client it is possible to obtain a local copy of the source tree. The following command achieves this:
svn checkout https://svn.win.tue.nl/repos/MCRL2/trunk MCRL2
This creates a local directory MCRL2 with the contents of the trunk directory in the MCRL2 repository. For more information on using SVN see the Subversion website.
Two types of platforms are supported:
- Microsoft Windows platform
- UNIX-like platforms
Windows platform
We support the following versions of Microsoft Windows:
- Windows 2000 (Version number: NT 5.0.2195)
- Windows XP (Version number: NT 5.1.2600)
- Windows Vista (Version number: NT 6.0.6000)
Unix-Like platforms
We support the following UNIX-like platforms:
- GNU/Linux (tested on Fedora Core, OpenSuSE, Debian, Ubuntu, Gentoo)
- Mac OS X:
- Mac OS X 10.4 with XCode 2.5
- Mac OS X 10.5 with XCode 3.1
- MinGW with gcc 4 on Microsoft Windows (version 5.1.3 or higher)
Limited support is provided for the following platforms:
- FreeBSD (version 6.2 or higher)
- Solaris (version 10 or higher)
Note: Other platforms may work, but have not been (thoroughly) tested.
Build Instructions Unix-Like platforms
Requirements
Required packages
| Name | Version | Package |
|---|---|---|
| g++ | >= 4.0.0 | gcc-c++ |
| make | >= 3.80 | make |
Recommended packages
| Name | Version | Package |
|---|---|---|
| wxWidgets | >= 2.8.4 | "libwxgtk2.8-dev" or "libwxgtk2.8-dbg" |
| OpenGL | 7.0.1, >= 2.8.4 | Mesa (GL and GLU), wxWidgets-gl |
These packages are required for the following graphical tools:
- diagraphica
- ltsgraph
- ltsview
- squadt
- xsim
Note: wxWidgets must be compiled with OpenGL for the following tools:
- diagraphica
- ltsview
- ltsgraph
Optional packages
| Name | Version | Package |
|---|---|---|
| default icon locations | "gnome-themes", "gnome-themes-extras" or "hicolor-icon-theme" | |
| flex | >= 2.5.4a-12 | flex |
| bison | >= 2.0 | bison |
| doxygen | >= 1.5.3 | doxygen |
| python | >= 2.5.1 | python |
Any of these default icon location packages ensure that the tools requiring "wxWidgets" do not generate warnings on missing icons. The packages for "flex", "bison", and "python" are used to generate source code. The package for "doxygen" is used to generate HTML documentation for the website. "flex", "bison", "python" and "doxygen" are only needed for developers.
Installing a source distribution
These instructions are for compiling the toolset from source on Linux, Unix, Mac OS X and Cygwin/MinGW on Windows.
- Source packages can be obtained from the download page. That page also contains instructions for checking out the most recent development version from our Subversion source tree.
- If you downloaded an archive, e.g. mcrl2-X.tar.bz2, unpack it to a new directory, say mcrl2, as follows:
tar -xjf mcrl2-X.tar.bz2 mcrl2
- From the root directory of the source tree run the following to view a list of available compilation options:
./configure --help
- When you have decided which options you want to use, run:
./configure ''[options]''
- If configure succeeded, compile and install the toolset by running:
make
make install
- Optionally, to clean up, run:
make clean
or, to also remove the files generated by configure, execute:make distclean
Installation under Mac OS X (pre 10.4 only)
In order to install the toolset under Mac OS X 10.3 the environment variable MACOSX_DEPLOYMENT_TARGET must be set to 10.3. For C shell, this can be achieved by adding the following line to your local .cshrc:
setenv MACOSX_DEPLOYMENT_TARGET 10.3
For bash, add the following line to your local .bashrc:
export MACOSX_DEPLOYMENT_TARGET=10.3
Windows
- Windows 2000/XP/Vista with the latest version of Cygwin or MinGW
- Windows XP/Vista with MS Visual C++ 8.0 sp1 and higher (for command line tools only)
- Windows XP/Vista with MS Visual C++ 9.0 (Visual Studio 2008)
The mCRL2 toolset can be built and installed on Windows using the following build environments:
Please refer to these web pages for instructions on how to install these tools. For MinGW and Cygwin installations the compiler packages (gcc/g++) need to be installed for compiling the toolset.
Cygwin/MinGW
To build and install the toolset in Cygwin/MinGW follow the build instructions for Unix-like platforms.
When testing a shared build (the default setting, creating dynamic link libraries) make sure that all external dynamic link libraries can be found at runtime. Especially mingw.dll or wxWidgets dll's can be missing. They are searched for in directories that are in the PATH environment variable or the same directory as the executables. It is safest to put them in the same directory as the executables.
Microsoft Visual Studio
Microsoft Visual C++ 2008 Express
It is possible to install and develop the mCRL2 toolset on Windows using Microsoft Visual Studio. This requires a copy of Microsoft Visual C++ 2008 Express, including the Windows SDK 6.0A. A copy can be found here. After installing a copy, proceed with the steps mentioned below. If a program needs to be executed from command prompt, make sure the command is executed in the Visual Studio 2008 Command Prompt (Start->Programs->Microsoft Visual C++ 2008 Express->Visual Studio Tools->Visual Studio 2008 Command Prompt).
- First run
config.bat
whilst in the directory<mcrl2>\build\msvc\
. This creates the executable <mcrl2>\build\bin\bjam.exe that can be used for building the toolset as well as <mcrl2>\build\config.jam. - To build and install GUI tools, wxWidgets is required. If wxWidgets has not been build and configured to work with Visual Studio proceed with the steps mentioned in the wxWidgets MSVC build instructions. It is possible to disable GUI tools. Therefore uncomment the four lines starting with WX_ and remove the WX_PREFIX from the <mcrl2>\build\config.jam file.
- Build the toolset by executing the following command from the root of the mCRL2 checkout directory:
\build\bin\bjam.exe
- To install the toolset in the directory C:/mcrl2 execute from the root of the mCRL2 checkout directory:
build\bin\bjam --install --prefix=C:/mcrl2
Notes:
- By default the Visual Studio Build uses static linking. It is currently not possible to use dynamic linking. Dynamic library creation fails because no methods are marked for export.
- Versions of MSVC older than 9.0 cannot be used to build the whole toolset because of compiler limitations.
Tips and Tricks
Development
It is recommended to develop in debug mode. Improper use of the underlying ATerm Library may cause problems, that are caught by assertions in debug mode.
Build selective tools
By selecting single tools on the command-line, with bjam invocations you can save a lot of time on building/installing. For example to install only mcrl22lps and lps2lts you can use the following command:
./build/bin/bjam --install mcrl22lps lps2lts
Also if you are not interested in using SQuADT can save some build-time by deactivating building squadt-support in tools.
./build/bin/bjam --install --disable-squadt-support mcrl22lps lps2lts
Multiple source trees for multiple platforms
Strange build problems may pop up when using a single source tree with multiple platforms/toolsets. The real problem is that the bjam executable is bootstrapped with a specific toolset on a specific platform. More concrete, the bjam executable built on MinGW with gcc behaves the same on Cygwin with gcc. This is a problem because platform dependent workarounds are activated on the wrong platform. Normally you would not use a MinGW version of bjam on Cygwin but here it just so happens because it is bundled with the toolset and used automatically when using `make'. To work around this problem when switching between platforms/toolsets with a single source tree either:
- stop using `make' and use a native version of bjam on each of the platforms,
- manually remove <source-root>/build/bin/bjam,
- run `make clean bjam' (more intrusive).
- use separate source trees
Of these alternative, the last just avoids the issue but may not always be an option. The first alternative is recommended most as, if done right, reduces the chance of making mistakes.
Installing syntax highlighting in Vim
To install vim syntax highlighting of μCRL, mCRL2 and EBNF specifications, do the following.
- From the root directory of the distribution, execute these commands:
install -d $HOME/.vim/syntax
install .vim/syntax/* $HOME/.vim/syntax
- Add the following lines to $HOME/.vimrc to enable syntax highlighting (if this hasn't been done already):
syntax enable filetype plugin on
- Add the following lines to $HOME/.vim/filetype.vim to link file names to the syntax files by their extension:
if exists("did_load_filetypes")
finish
endif
augroup filetypedetect
au! BufRead,BufNewFile *.bnf setfiletype ebnf
au! BufRead,BufNewFile *.ebnf setfiletype ebnf
au! BufRead,BufNewFile *.mcrl setfiletype mcrl
au! BufRead,BufNewFile *.mcrl2 setfiletype mcrl2
augroup END
Copyright © 2005-2010 Technische Universiteit Eindhoven.
