Installing openPASS

This section describes how to compile and run openPASS. Please make sure that all prerequisites have been properly installed according to section Installing Prerequisites. If you have strictly followed the instructions, the installed dependencies should be located on your machine under C:\deps on Windows and ~/deps on Linux. If there is a path deviation, the following commands must be adjusted.

Note

If you are unfamiliar to CMake or working within a MinGW 64-bit shell, Section CMake Variables and Options and MSYS2 might give you a short introduction on these topics in the scope of building openPASS itself.

  1. Navigate back into repository

    cd /C/openpass
    
  2. Create build directory and navigate into it

    mkdir build
    cd build
    
  3. Prepare build

    openPASS links against shared libraries, which are located in the paths specified by CMAKE_PREFIX_PATH. To be able to install openPASS with resolved dependencies, all libraries found under the paths have to be copied right next to the executable during the installation step. This is done by setting INSTALL_EXTRA_RUNTIME_DEPS=ON. If you have followed the instructions strictly, no changes are necessary.

    cmake -G "MSYS Makefiles" \
    -D CMAKE_PREFIX_PATH="C:/deps/direct_deploy/fmilibrary;C:/deps/direct_deploy/open-simulation-interface;C:/deps/direct_deploy/protobuf;C:/deps/direct_deploy/protobuf-shared;C:/deps/direct_deploy/units;C:/deps/direct_deploy/mantleapi;C:/deps/direct_deploy/yase;C:/deps/direct_deploy/openscenario_api;C:/deps/direct_deploy/openscenario_engine;C:/deps/direct_deploy/gtest;C:/deps/direct_deploy/boost;C:/deps/direct_deploy/qt;C:/deps/direct_deploy/minizip;C:/deps;C:/msys64/mingw64/bin;" \
    -D CMAKE_INSTALL_PREFIX=C:/openPASS/bin/core \
    -D CMAKE_BUILD_TYPE=Release \
    -D USE_CCACHE=ON \
    -D WITH_DEBUG_POSTFIX=OFF \
    -D OPENPASS_ADJUST_OUTPUT=OFF \
    -D INSTALL_EXTRA_RUNTIME_DEPS=ON \
    ..
    

    Note

    • By specifying INSTALL_EXTRA_RUNTIME_DEPS=ON, runtime dependencies will be copied to the installation directory when running make install. This applies to all dependencies located in the paths specified in CMAKE_PREFIX_PATH.

    • Make sure that the path C:/msys64/mingw64/bin is the last path in the CMAKE_PREFIX_PATH. Otherwise cmake might find and use local versions of required libraries instead of the ones listed in the thirdparties folder.

    Note

    For a build that goes beyond the default settings, see CMake Variables and Options for more available variables and options that can be set.

  4. Optional: Build and execute unit tests

    Starting from openpass/build:

    make test ARGS="--output-on-failure -j3"
    

    Note

    ARGS is optional, but recommended. Adjust parallel build flag -j3 based on your system.

  5. Build documentation

    Starting from openpass/build:

    make doc
    

    Note

    Currently the documentation must be built before openPASS can be successfully installed if the CMake variable WITH_DOC=ON (default).

  6. Build simulation core

    Starting from openpass/build:

    make -j3 install
    

    Note

    Again, adjust parallel build flag -j3 based on your system.