You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.6 KiB

2 months ago
  1. ***********************
  2. Installation
  3. ***********************
  4. Requirements
  5. ==================
  6. Before installing stormpy, make sure
  7. - Python 3 is available on your system.
  8. - `pycarl <https://moves-rwth.github.io/pycarl>`_ is available.
  9. - `Storm <http://www.stormchecker.org/>`_ is available on your system.
  10. To avoid issues, we suggest that both pycarl and Storm use the same version of `carl <https://smtrat.github.io/carl>`_.
  11. The simplest way of ensuring this is to first install carl as explained in the `Storm installation guide <http://www.stormchecker.org/documentation/installation/manual-configuration.html#carl>`_.
  12. You can then install Storm and pycarl independently.
  13. .. _compatibility_stormpy_storm:
  14. Compatibility of stormpy and Storm
  15. ----------------------------------
  16. Note that stormpy and Storm are continuously extended and modified.
  17. It is therefore important to use compatible versions of stormpy and Storm.
  18. You have two choices for stormpy depending on the version of Storm you are using:
  19. 1. **Release version**:
  20. You use the latest `release of Storm <https://github.com/moves-rwth/storm/releases>`_ or the ``stable`` branch or you installed Storm via `Homebrew <https://www.stormchecker.org/documentation/obtain-storm/homebrew.html>`_.
  21. In these cases, you need to use the latest `release of stormpy <https://github.com/moves-rwth/stormpy/releases>`_.
  22. For example, Storm 1.6.0 is compatible with stormpy 1.6.0.
  23. 2. **Master branch**:
  24. You use the ``master`` branch of Storm.
  25. In this case, you need to use the ``master`` branch of stormpy as well.
  26. Note that due to ongoing development in Storm, after some commits, the stormpy ``master`` might not work with the Storm ``master`` anymore.
  27. We will fix such issues as fast as possible.
  28. Installation Steps
  29. ====================
  30. Virtual Environments
  31. --------------------
  32. Virtual environments create isolated environments for your projects.
  33. This helps to keep your system clean, work with different versions of packages and different version of python.
  34. While it is not required, we recommend the use of such virtual environments. To get you started, we recommend
  35. `this guide <http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_ or
  36. `this primer <https://realpython.com/blog/python/python-virtual-environments-a-primer>`_.
  37. In short you can create a virtual environment ``env`` with::
  38. $ pip install virtualenv
  39. $ virtualenv -p python3 env
  40. $ source env/bin/activate
  41. The last step activates the virtual environment.
  42. Whenever using the environment, the console prompt is prefixed with ``(env)``.
  43. Building stormpy
  44. ----------------
  45. **Clone** the :ref:`compatible stormpy version<compatibility_stormpy_storm>` into any suitable location.
  46. For the ``master`` of stormpy use::
  47. $ git clone https://github.com/moves-rwth/stormpy.git
  48. $ cd stormpy
  49. or for the latest release use (remember to use the correct version)::
  50. $ git clone https://github.com/moves-rwth/stormpy.git --branch 1.6.0
  51. $ cd stormpy
  52. **Build** stormpy in develop mode using your favourite python distribution way of installing: e.g.::
  53. $ python3 setup.py develop
  54. or::
  55. $ pip install -ve .
  56. Optional build arguments
  57. ^^^^^^^^^^^^^^^^^^^^^^^^
  58. The build step ``build_ext`` also takes optional arguments for a more advanced configuration of stormpy.
  59. * *Specifying which Storm library to use*
  60. If you have multiple versions of Storm or cmake is not able to find your Storm version,
  61. you can specify the ``--storm-dir YOUR-PATH-TO-STORM`` flag::
  62. $ python3 setup.py build_ext --storm-dir YOUR-PATH-TO-STORM develop
  63. * *Disabling functionality*
  64. If you want to disable certain functionality in stormpy from being built you can use the following flags:
  65. * ``--disable-dft`` to disable support for dynamic fault trees (DFTs)
  66. * ``--disable-pars`` to disable support for parametric models
  67. * *Building stormpy in debug mode*
  68. If you want to build stormpy in debug mode you can add the ``--debug`` flag::
  69. $ python3 setup.py build_ext --debug develop
  70. * *Setting number of build threads*
  71. The build of stormpy uses all available cores per default.
  72. If you want to configure the number of threads manually you can specify the ``--jobs`` (or ``-j``) flag::
  73. $ python3 setup.py build_ext --jobs 2 develop
  74. Testing stormpy installation
  75. ----------------------------
  76. After building, you can run the test files by either::
  77. $ python setup.py test
  78. or by invoking pytest directly with::
  79. $ pip install pytest
  80. $ py.test tests/
  81. If the tests pass, you can now use stormpy.
  82. To get started, continue with our :doc:`getting_started`, consult the test files in ``tests/`` or the :doc:`api` (work in progress).