Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust DBM Library: Use EDBM instead of UDBM everywhere #115

Merged
merged 10 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions .github/workflows/build_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,8 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Install compiler tools
run: |
sudo apt-get update
sudo apt-get install llvm automake libxml2-dev gperf build-essential libboost-all-dev cmake make protobuf-compiler
- name: Compile UDBM wrapper
run: |
cd dbm
cmake -B build/
cmake --build build/
- name: Install llvm-config
run: sudo apt-get install llvm protobuf-compiler
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -45,15 +38,8 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Install compiler tools
run: |
sudo apt-get update
sudo apt-get install llvm automake libxml2-dev gperf build-essential libboost-all-dev cmake make protobuf-compiler mingw-w64
- name: Compile UDBM wrapper
run: |
cd dbm
cmake -B build/ -D CMAKE_TOOLCHAIN_FILE=toolchain-x86_64-w64-mingw32.cmake
cmake --build build/
- name: Install llvm-config
run: sudo apt-get install llvm protobuf-compiler mingw-w64
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,8 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Install compiler tools
run: |
sudo apt-get update
sudo apt-get install llvm automake libxml2-dev gperf build-essential libboost-all-dev cmake make protobuf-compiler
- name: Compile UDBM wrapper
run: |
cd dbm
cmake -B build/
cmake --build build/
- name: Install llvm-config
run: sudo apt-get install llvm protobuf-compiler
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -28,7 +21,6 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: -- --skip "DBMLib::lib_dbm::UDBM::bindgen_test_layout_dbm_idbm_t"
fmt:
name: Check code is formatted
runs-on: ubuntu-latest
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ simple-error = "0.2.3"
force_graph = "0.3.2"
rand = "0.8.5"
futures = "0.3.21"
edbm = {git = "https://github.com/Ecdar/EDBM"}


# Enable optimizations for EDBM in debug mode, but not for our code:
[profile.dev.package.edbm]
opt-level = 3

[build-dependencies]
bindgen = "0.60.0"
cc = "1.0.73"
tonic-build = "0.5.*"


Expand Down
30 changes: 7 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,22 @@
## About
This is a model checking engine for ECDAR (Environment for Compositional Design and Analysis of Real Time Systems) written in rust.

#### DBM Library
The engine uses the ECDAR DBM Library for operations on zones of time (https://www.github.com/ECDAR/EDBM).

## Prerequisites
- A rust compiler and C++ compiler installed (https://www.rust-lang.org/learn/get-started)
- [clang](https://clang.llvm.org/) for compiling the library (for the Ubuntu linux distribution, run the command ```apt install llvm-dev libclang-dev clang``` to properly install the clang dependencies)
- A rust compiler installed (https://www.rust-lang.org/learn/get-started)
- A folder containing the model components to check
- ProtoBuf compiler protoc (for the Ubuntu linux distribution ```apt install protobuf-compiler```)
- Download ProtoBuf definitions with ```git submodule update --init --recursive```

## Building the DBM library

Navigate into the dbm folder and make sure no build folder already exists. Then use cmake to build the dbm library, the files should be created in a `out` folder where Reveaal use them from.

```bash
cd dbm
cmake -B build/
cmake --build build/
```

## Building the project
- Build the project using `cargo build`
- Optionally run the tests using `cargo test`

## Cross compiling from Linux to Windows
Build the DBM library using the x86_64-w64-mingw32 toolchain:

```bash
cd dbm
cmake -B buildw/ -D CMAKE_TOOLCHAIN_FILE=toolchain-x86_64-w64-mingw32.cmake
cmake --build buildw/
```
## Cross compiling
The project is pure just so one should be able to crosscompile to any platform with a rust target.

### Compiling to Windows
Ensure that the rustc windows target is installed with `rustup target add x86_64-pc-windows-gnu` and build with cargo:

`cargo build --target x86_64-pc-windows-gnu`

The rust compiler is configured to pick the library for the current target, so you dont have to recompile the dbm library when switching compile target.
24 changes: 0 additions & 24 deletions dbm/CMakeLists.txt

This file was deleted.

13 changes: 0 additions & 13 deletions dbm/DBMAlloc.patch

This file was deleted.

175 changes: 0 additions & 175 deletions dbm/include/base/DataAllocator.h

This file was deleted.

Loading