Installing OpenPASS

This section describes how 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 source packages should be located on your machine under C:\OpenPASS\thirdParty for Windows and ~/OpenPASS/thirdParty for Linux. If there is a path deviation, the following commands must be adjusted.

To keep the installation process of openPASS as simple as possible, we again recommend a specific folder structure. If you have strictly followed and will follow the recommended paths of this guide, no command modifications are necessary.

  • Recommended checkout path of openPASS repository: C:\simopenpass

  • Recommended dependendy directory within the openPASS repository: C:\simopenpass\deps\thirdParty

  • Recommended installation directory of openPASS: C:\OpenPASS\bin\core

The above directory structure will be created by following the instructions of this guide.

  1. Clone OpenPASS repository

    As described above, the checkout path of the repository is assumed to be the default simopenpass.

    Start MinGW 64-bit shell

    cd /C/
    git clone https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass.git
    

    Note

    As stated in Installing the Build Environment, the windows programming tools suffer from a path length restriction. This error manifests as strange file not found compile errors. It is therefore recommended to use a short path for source code checkout, e.g. a drive letter. This can also be done by the windows command subst.

  2. Navigate into repository and checkout main branch

    cd simopenpass
    git checkout main
    
  3. Create directory structure

    mkdir -p deps/thirdParty
    
  4. Navigate into directory where installed prerequisites are located

    cd /C/OpenPASS/thirdParty
    
  5. Copy prerequisites into repository (c.f. Installing Prerequisites)

    cp -r osi /C/simopenpass/deps/thirdParty
    cp -r FMILibrary /C/simopenpass/deps/thirdParty
    

    Once prerequisites are in place, all third party dependencies within simopenpass can be resolved by CMake. For CMake builds, each installed prerequisite, which is located in its own subdirectory under

    • C:\simopenpass\deps\thirdParty for Windows and

    • ~/simopenpass/deps/thirdParty for Linux,

    can be referenced by its path. The reference is made via the CMAKE_PREFIX_PATH environmental variable, which holds a list of directories specifying the installed prerequisite. This will be explained in more detail in the following.

  6. Navigate back into repository

    cd /C/simopenpass
    
  7. Create build directory and navigate into it

    mkdir build
    cd build
    
  8. 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:/msys64/mingw64/bin;C:/simopenpass/deps/thirdParty/FMILibrary;C:/simopenpass/deps/thirdParty/osi" \
    -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 \
    -D CMAKE_C_COMPILER=gcc \
    -D CMAKE_CXX_COMPILER=g++ \
    ..
    

    Note

    Even though it is recommended, you do not have to copy MinGW libraries next to the executable. Providing the libraries can also be done in the following ways:

    • either openPASS gets only executed exclusively from the MinGW 64-bit shell, then all necessary MinGW libraries get linked automatically by the shell

    • or one can add C:\msys64\mingw64\bin permanently to the Windows Environment Variable Path

    • or temporarily set Path prior to the execution, e.g. in a wrapper:

      # your_program.cmd
      Path=C:\msys64\mingw64\bin;%Path% # set Path
      your_program.exe                  # execute
      

    Note

    If you need to adjust paths and options based on your system and needs, don’t forget to escape the semicolon ; (see CMAKE_PREFIX_PATH). For a build that goes beyond the default settings, see CMake Variables and Options for more available variables and options that can be set.

  9. Optional: Build and execute unit tests

    Starting from simopenpass/build:

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

    Note

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

  10. Build documentation

    Starting from simopenpass/build:

    make doc
    

    Note

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

  11. Build simulation core

    Starting from simopenpass/build:

    make -j3 install
    

    Note

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

  12. Fix installation (we’re working on that…)

    cp /C/OpenPASS/bin/core/bin/* /C/OpenPASS/bin/core