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 2013 (Windows)

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
  • 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 (and Debian)

Install Qt and VTK

 sudo apt-get install qt5-default qttools5-dev-tools
 sudo apt-get install libvtk5-dev libvtk5.8-qt4 python-vtk libvtk-java

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

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.