Skip to content

Commit

Permalink
updating build documentation for jupedsim #2 fix #14539
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Mar 20, 2024
1 parent 49c2f77 commit 0d3a636
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 25 deletions.
58 changes: 34 additions & 24 deletions docs/web/docs/Installing/Linux_Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,14 @@ alternatives below.
The package names above are for openSUSE, for ubuntu the call to get the most important optional libraries and tools is:

```
sudo apt-get install ccache libavformat-dev libswscale-dev libopenscenegraph-dev python3-pip python3-setuptools
sudo apt-get install ccache libavformat-dev libswscale-dev libopenscenegraph-dev python3-pip python3-build
sudo apt-get install libgtest-dev gettext tkdiff xvfb flake8 astyle python3-autopep8
pip3 install texttest
sudo apt-get install python3-pyproj python3-rtree python3-pandas flake8 python3-autopep8 python3-pulp python3-ezdxf
python3 -m pip install texttest
```

For the Python tools there are some requirements depending on which tools you want to use. If you want to install
everything using pip do `pip install -r tools/requirements.txt`. To install the most common dependencies with your
package manager on ubuntu do:

```
sudo apt-get install python3-pandas python3-rtree python3-pyproj
```
For the Python tools there are some more requirements depending on which tools you want to use. If you want to install
everything using pip do `python3 -m pip install -r tools/requirements.txt`.

## Getting the source code

Expand Down Expand Up @@ -138,26 +134,26 @@ Many of them might be available with the package manager of your distribution an
to use those. For ubuntu this currently means, you should first do

```
sudo apt-get install python3-pyproj python3-rtree python3-pandas python3-flake8 python3-autopep8 python3-scipy python3-pulp python3-ezdxf
sudo apt-get install python3-pyproj python3-rtree python3-pandas flake8 python3-autopep8 python3-pulp python3-ezdxf
```

and then install the remaining parts using pip:

```
pip install -r tools/requirements.txt
python3 -m pip install -r tools/requirements.txt
```

The pip installation will ensure that all libraries are there, so it is safe to skip the first `apt-get` step.
If you need information about the minimum required versions of the packages read them directly
from the [requirements.txt](https://github.com/eclipse-sumo/sumo/blob/main/tools/requirements.txt). Be aware that
the minimum versions in the requirements file just reflect our current test server setup, so you might also get away with earlier versions.

You might need to replace `pip` with `pip3` if you are using python3 on Linux.
If you want to reproduce our test server setup exactly, then use the versions in
[req_test_server.txt](https://github.com/eclipse-sumo/sumo/blob/main/tools/req_test_server.txt)


## Building the SUMO binaries with cmake

To build with cmake version 3 or higher is required.
To build with cmake version 3.5 or higher is required.

Create a build folder for cmake (in the SUMO root folder)
and configure SUMO with the full set of available options like GDAL and
Expand Down Expand Up @@ -316,27 +312,41 @@ improve build speed.
In this section, you will learn how to build the latest version of the pedestrian simulator JuPedSim and how to compile SUMO with this latest version of JuPedSim. First of all, clone the JuPedSim repository:

``` bash
git clone https://github.com/PedestrianDynamics/jupedsim.git
git clone https://github.com/PedestrianDynamics/jupedsim
```
Note that this will clone the full repository, including the latest version of JuPedSim. **We strongly recommend to build the latest release of JuPedSim (not the latest version), which is officially supported by SUMO.** You can consult the [JuPedSim build procedure](https://github.com/PedestrianDynamics/jupedsim#readme); hereafter we propose a similar procedure. First check which is the [latest release](https://github.com/PedestrianDynamics/jupedsim/releases) then in the cloned directory checkout to the latest release. For example, for JuPedSim release v1.0.5, you would need to type:
Note that this will clone the full repository, including the latest version of JuPedSim. **We strongly recommend to build the latest release of JuPedSim (not the master branch), which is officially supported by SUMO.** You can consult the [JuPedSim build procedure](https://github.com/PedestrianDynamics/jupedsim#readme); hereafter we propose a similar procedure. First check which is the [latest release](https://github.com/PedestrianDynamics/jupedsim/releases) then in the cloned directory checkout to the latest release and do a regular cmake build. For example, for JuPedSim release v1.1.0, you would need to type:

``` bash
cd jupedsim
git checkout v1.0.5
cd ..
git checkout v1.1.0
cmake -B build .
cmake --build build
sudo cmake --install build
```

Outside the repository directory, but at the same level, you will build and install in two directories `jupedsim-build` and `jupedsim-install`, which get created automatically by the following commands:
Now you should make sure GEOS is installed (`sudo apt-get install libgeos-dev`) and
continue with the [standard build procedure above](#building-the-sumo-binaries-with-cmake).

### Tweaking the JuPedSim build

If you do not want to install jupedsim into your system, you can specify an alternative install directory like this:

``` bash
cmake -B jupedsim-build -DCMAKE_INSTALL_PREFIX=jupedsim-install jupedsim
cmake --build jupedsim-build
cmake --install jupedsim-build
cmake -B build -DCMAKE_INSTALL_PREFIX=$PWD/../jupedsim-install .
cmake --build build
cmake --install build
```

You can also change the configuration to Debug (with `-DCMAKE_BUILD_TYPE=Debug`) and also enable multithreading (with `-j4`) as usual with CMake. Now to integrate the latest version of JuPedSim into SUMO, you need to have GEOS on your computer, for instance by typing `sudo apt-get install libgeos-dev` in a console. Then, please follow the standard build procedure for MacOS: since the JuPedSim install folder is at the same level of SUMO, it will be found automatically. Alternatively, you can notify CMake where is JuPedSim installed by setting `JUPEDSIM_CUSTOMDIR` when calling CMake.
This will install jupedsim in the directory `jupedsim-install` right beside the checkout. If you installed jupedsim
into the system or in a `jupedsim-install` directory beside sumo, the standard cmake call of SUMO will find it
automatically.

Please be aware that if you want to install sumo into the system, you also need to install jupedsim into the system.
To tweak or debug the jupedsim build you can also change the configuration to Debug (with `-DCMAKE_BUILD_TYPE=Debug`)
and also enable multithreading (with `-j4`) as usual with CMake. If you have different jupedsim versions or choose a
different install path, you can notify CMake where JuPedSim is installed by setting `JUPEDSIM_CUSTOMDIR` when calling CMake.

For further remarks on the use of JuPedSim inside SUMO, please consult [this page](../Simulation/Pedestrians.md#jupedsim).
For further remarks on the use of JuPedSim inside SUMO, please consult [the documentation on the model](../Simulation/Pedestrians.md#jupedsim).

## Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion docs/web/docs/Simulation/Pedestrians.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ JuPedSim is a pedestrian simulator developed by the Jülich Research Center. It

## Installation

If you are on Windows, the latest release of JuPedSim is distributed together with the SUMO software distribution so no additional steps are required. Alternatively, if you want to build the latest JuPedSim version available on Windows, please have a look at [this page](../Installing/Windows_Build.md#How to build JuPedSim and then build SUMO with JuPedSim). If you are on Linux or MacOS, you need to build JuPedSim, then build SUMO (have a look [here](../Installing/Linux_Build.md#how_to_build_jupedsim_and_then_build_sumo_with_jupedsim) for Linux or [here](../Installing/MacOS_Build.md#how_to_build_jupedsim_and_then_build_sumo_with_jupedsim) for MacOS).
If you are on Windows, the latest release of JuPedSim is distributed together with the SUMO software distribution so no additional steps are required. Alternatively, if you want to build the latest JuPedSim version available on Windows, please have a look at [the build instructions](../Installing/Windows_Build.md#how-to-build-jupedsim-and-then-build-sumo-with-jupedsim). If you are on Linux or MacOS, you need to [build JuPedSim, then build SUMO](../Installing/Linux_Build.md#how_to_build_jupedsim_and_then_build_sumo_with_jupedsim).

## Use

Expand Down

0 comments on commit 0d3a636

Please sign in to comment.