README.md 4.01 KB
Newer Older
Jannik Hüls's avatar
Jannik Hüls committed
1 2 3 4
# Hybrid Petri nets with general transitions

## Install

5 6 7 8
### Ubuntu 18.04

Almost all dependencies can be installed via `apt`. Only [CArL](https://smtrat.github.io/carl/) and
[Hypro](https://hypro.github.io/hypro/html/) need to be compiled manually. However, they register themselves with CMake
joannadelicaris's avatar
joannadelicaris committed
9
upon compilation so that no steps other than compiling them need to be taken. 
10

11 12 13 14 15 16
##### A note on CArL and HyPro versions
Not all versions of CArl and HyPro work with each other or with HPnmG. Unfortunately, it is not always so clear which
*do*. Symptoms of bad versions include:
- HPnmG or targets thereof refusing to compile because of changed include paths, classes or signatures in HyPro
- Some targets of HPnmG refusing to *link* because of undefined symbols from `libgmp` in `libhypro.so`

Joanna Georgia Delicaris's avatar
Joanna Georgia Delicaris committed
17 18
For the Projektseminar, you should be able to use [this revision](https://github.com/smtrat/carl/commit/112ab9ffec0ce2252aec641c72905771c4729223)
for CArl and the [provided HyPro Version](https://zivgitlab.uni-muenster.de/ag-sks/teaching/projektseminars/2020-21-winter-stochastic-hybrid-systems/2020-21-winter-stochastic-hybrid-systems-student-access/hypro).
19

joannadelicaris's avatar
joannadelicaris committed
20

21
#### Dependencies
joannadelicaris's avatar
joannadelicaris committed
22 23
0. Install CMake.
   ```
joannadelicaris's avatar
joannadelicaris committed
24
   $ sudo apt install cmake
joannadelicaris's avatar
joannadelicaris committed
25
   ```
26 27
1. These are needed for both CArl and HyPro
   ```
28
   # gmp and gmpxx, the Gnu Multiprecision library and its C++ interface
29 30 31 32 33 34 35 36 37
   $ sudo apt install libgmp-dev

   # Boost
   $ sudo apt install libboost-all-dev
   ```
2. CArl additionally needs *Eigen3* for numerical computations
   ```
   $ sudo apt install libeigen3-dev
   ```
Joanna Georgia Delicaris's avatar
Joanna Georgia Delicaris committed
38 39 40 41 42 43
3. HyPro additionally needs this
   ```
   # uuid-dev
   $ sudo apt install uuid-dev
   ```
4. And hpnmg need these
44 45 46
   ```
   # CGAL
   $ sudo apt install libcgal-dev
47

48 49 50 51 52 53 54 55 56 57
   # GSL - GNU Scientific Library
   $ sudo apt install libgsl-dev

   # JRE
   $ sudo apt install default-jre

   # Xerces-C++ XML Parser
   $ sudo apt install libxerces-c-dev
   ```

Joanna Georgia Delicaris's avatar
Joanna Georgia Delicaris committed
58

59
#### CArl
60
Download [CArl](https://github.com/smtrat/carl) and pick a [version](#a-note-on-carl-and-hypro-versions)
61
```
62
$ git clone https://github.com/smtrat/carl && cd carl && git checkout <XYZ>
63 64 65 66 67 68 69 70 71 72
$ mkdir build && cd build && cmake ..
```
If your dependencies are installed correctly, the output of the latter
command should include lines similar to these:
```
-- Use system version of GMP/GMPXX 6.1.2
-- Use system version of Boost 106501
-- Use system version of Eigen3 3.3.4

```
joannadelicaris's avatar
joannadelicaris committed
73
Build carl with `make carl`. This may take a minute.
74 75

#### HyPro
Joanna Georgia Delicaris's avatar
Joanna Georgia Delicaris committed
76
Download HyPro.
77
```
Joanna Georgia Delicaris's avatar
Joanna Georgia Delicaris committed
78
$ git clone git@zivgitlab.uni-muenster.de:ag-sks/teaching/projektseminars/2020-21-winter-stochastic-hybrid-systems/2020-21-winter-stochastic-hybrid-systems-student-access/hypro.git && cd hypro
79 80 81 82 83 84 85 86
$ mkdir build && cd build && cmake ..
```
If your dependencies are installed correctly and if CArl registered itself correctly with CMake, the output of the
latter command should include lines like these:
```
-- Use system version of CArL
-- Found Java: ...
```
Joanna Georgia Delicaris's avatar
Joanna Georgia Delicaris committed
87 88
Build HyPro's resources and HyPro itself with `make resources && make hypro`. 
To build the tests for hypro, just run `make`. After building, run the tests with `make test`.
Carina Pilch's avatar
Carina Pilch committed
89

Joanna Georgia Delicaris's avatar
Joanna Georgia Delicaris committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
#### hpnmg
Download hpnmg.
```
$ git clone git@zivgitlab.uni-muenster.de:ag-sks/teaching/projektseminars/2020-21-winter-stochastic-hybrid-systems/2020-21-winter-stochastic-hybrid-systems-student-access/hpnmg.git && cd hpnmg
$ mkdir build && cd build && cmake ..
```
If your dependencies are installed correctly and if HyPro registered itself correctly with CMake, the output of the
latter command should include lines like these:
```
-- 
```
Build hpnmg with `make main`. 
To build the tests for hpnmg, just run `make testAllQuick` or `make testAllExtensive`.  
To run the tests, change directory to `build/test` and run the compiled binaries, e.g. `testAllQuick` and `testAllExtensive`:
```
$ make main
$ make testAllQuick && make testAllExtensive
$ cd build/test
$ ./testAllQuick
```
This should take between 30 seconds and two minutes, depending on your machine and the build type (debug or release).
Continuing:
```
$ ./testAllExtensive
```
This should take between 30 seconds and 13 minutes.
Carina Pilch's avatar
Carina Pilch committed
116