Skip to content

openpra-org/openepl-engine

Repository files navigation

OpenEPL Engine

C++ implementation of the DEPM algorithm, built on the C++ Storm API.

Running in Windows

Build

  • Build the source code inside a new docker image.
    docker build --target=binary -t openepl-engine:binary .

Quantification

  • Run the executable with the required input parameters
    docker run --rm -it -v $(pwd)/input:/input openepl-engine:binary `-i /input/${INPUT_DEPM_XML} -p "FAILURE" --mttf`

Build & Development

Build Instructions

Execute the following command from the project root directory openepl-engine:

Debug

docker build -t openepl-engine:Debug -f Dockerfile --build-arg CMAKE_BUILD_TYPE="Debug" .

Release

docker build -t openeplengine:Release -f Dockerfile --build-arg CMAKE_BUILD_TYPE="Release" .

Optional Build Arguments with defaults:

ARG MAKEFLAGS=-j$(nproc)
ARG CMAKE_BUILD_TYPE="Debug" | "Release"
ARG BUILD_DIR="/build"
ARG SRC_DIR="/source"

Development Instructions

Clion Docker Toolchain

Developing in Clion using the Docker Toolchain provides a consistent experience. The debugging environment is an ephemeral Docker container.

Prerequisites

  • Docker
  • CLion

Instructions

  1. Build Docker image

    From the $PROJECT_ROOT_DIR, run the following commands in a shell:

    # Set the environment variables
    PROJECT_ROOT_DIR=$(pwd)
    DEV_IMAGE_TAG=openepl-engine-debugger
    DEV_IMAGE_DOCKERFILE=$PROJECT_ROOT_DIR/Dockerfile-dev
    
    # Build the development image
    docker build --build-arg UID=$(id -u) -t $DEV_IMAGE_TAG $DEV_IMAGE_DOCKERFILE
    1. Go to Settings / Preferences | Build, Execution, Deployment | Toolchains.
    2. Click Add toolchain and select Docker.
    3. Click the screw nut icon next to the Docker field to select a Docker image.
      1. You can also configure a Docker server in Settings / Preferences | Build, Execution, Deployment | Docker and then select it in the toolchain settings.
    4. Select the Docker Image openepl-engine-debugger and wait until the tool detection finishes.
    5. Set the C Compiler to gcc
    6. Set the C++ Compiler to g++
    7. Then save the settings.
    1. After configuring a Docker toolchain, you can select it in CMake profiles or in Makefile settings. Alternatively, move the toolchain to the top of the list to make it default.

** Note: The project folder will mounted to the Docker container and building, running, and debugging will be performed in it. CLion will start the container and shut it down after the command is executed. The project folder will be mounted into the /tmp/openepl-engine directory in the container. **

Troubleshooting

    • To get better performance on Windows, we recommend using Docker with the WSL 2 backend.
      1. Set up Docker Desktop with the WSL 2 backend.
      2. In the Docker desktop application, navigate to Settings | Resources | WSL Integration and enable integration with your WSL distribution (for example, ubuntu-20.04).
      3. Place the project sources into the WSL filesystem (for example, \wsl$\ubuntu-20.04\tmp\llvm), then open it in CLion and configure a Docker toolchain.

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages