# Hybrid Petri nets with general transitions ## Install ### 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 upon compilation so that no steps other than compiling them need to be taken. ##### 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` 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). #### Dependencies 0. Install CMake. ``` $ sudo apt install cmake ``` 1. These are needed for both CArl and HyPro ``` # gmp and gmpxx, the Gnu Multiprecision library and its C++ interface $ 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 ``` 3. HyPro additionally needs this ``` # uuid-dev $ sudo apt install uuid-dev ``` 4. And hpnmg need these ``` # CGAL $ sudo apt install libcgal-dev # 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 ``` #### CArl Download [CArl](https://github.com/smtrat/carl) and pick a [version](#a-note-on-carl-and-hypro-versions) ``` $ git clone https://github.com/smtrat/carl && cd carl && git checkout $ 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 ``` Build carl with `make carl`. This may take a minute. #### HyPro Download HyPro. ``` $ 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 $ 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: ... ``` 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`. #### 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.