In order to compile JuPedSim it is necessary to first install the required libraries.

Supported compilers

Any compiler with support for C++11.

Tested with

  • g++ (linux/osx)
  • clang (osx)
  • Visual Studio 2017 (Windows)

JPScore and JPSreport use some functionalities of C++17. Therefore you need a compiler that supports C++17.

Required tools and libraries

  • cmake: see this tutorial for a brief overview.
  • Python3 (highly recommended): needed to plot results and data manipulation.
  • Boost library: necessary for jpscore and jpsreport
  • CGAL (optional)
  • Qt: necessary for jpseditor and jpsvis
  • VTK: necessary for jpsvis
  • Polygon3 necessary for jpsreport

Note: jpseditor and jpsvis come with Windows executables. Therefore, a compilation of these two packages may not be needed.

OSX

Assuming you have Homebrew. Otherwise, these commands can be slightly adapted to MacPorts users.

Install Qt

 brew update
 brew install qt

It may be necessary to link qt as follows:

  • Find the location of qmake
     find / -name qmake
    
  • then export the path to ~/.bashrc, ~/.zshrc or ~/.bash_profile. For example:
     echo 'export PATH=/path/to/qt/bin:$PATH"' >> ~/.bashrc
    

    (or export to ~/.zshrc if your are using zsh)

Install VTK

 brew install vtk --with-qt --without-python --with-python3 --without-boost  --build-from-source

Install CGAL

See here for CGAL installation.

Install Boost (at least v1.59)

For brew users:

 brew install boost

And for port users

 sudo port install boost

Linux

The instructions are for Ubuntu, Debian and Manjaro

Install Qt and VTK

  • Ubuntu (Debian)
 sudo apt-get install qt5-default
 sudo apt-get install libvtk6-dev
  • Manjaro
bash
sudo pacman -Sy qt5
sudo pacman -Sy vtk

Alternatively, you can download the latest version of QT here and the latest version of VTK here and compile them manually.

Install CGAL

See here for installation instructions.

Install Boost (at least v1.59)

You can compile boost using the following snippet:

 boost_version=1.61.0
 boost_dir=boost_1_61_0

 wget http://downloads.sourceforge.net/project/boost/boost/${boost_version}/${boost_dir}.tar.gz
 tar xfz ${boost_dir}.tar.gz
 rm ${boost_dir}.tar.gz
 cd ${boost_dir}
 ./bootstrap.sh --with-libraries=filesystem,test,system
 sudo ./b2 --without-python --prefix=/usr -j 4 link=shared runtime-link=shared install
 cd ..
 rm -rf ${boost_dir}
 sudo ldconfig

(download this snippet as a script).

Note: Debian’s and Ubuntu’s install manager offer an old version of Boost, which is not supported by JuPedSim.

Windows (10)

Installing and managing these libraries on Windows can be a real hassle. Fortunately, there is a nice package manager for C++ libraries that you might want to try.

See here for more details.

Otherwise, you can continue reading..

Install Boost (at least v1.59)

 bootstrap
 b2  variant=release --build-type=complete

See also Getting started on Windows.

This script can be useful, in case you are using Visual Studio.

Download it and put it in the same directory as Boost. Depending on your Boost version and VS, you may want to adapt in the script the variables boost_dir and msvcver.

Test Boost installation

You can test your Boost installation by using this minimal example.