The source code and dockerfile for the GSW2024 AI Lab.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

94 lines
3.1 KiB

2 months ago
  1. ***********************
  2. Installation
  3. ***********************
  4. Requirements
  5. ==================
  6. Before installing pycarl, make sure
  7. - Python 3 is available on your system. Pycarl does not work with python 2.
  8. - `carl <https://smtrat.github.io/carl>`_ with branch ``master14`` is available on your system.
  9. - *(optional)* in order to have full parsing capabilities, you additionally need `carl-parser <https://github.com/smtrat/carl-parser>`_.
  10. .. note:: Make sure you are using the ``master14`` branch of carl as the current master branch uses a newer C++ standard that pycarl does not require and therefore does not enable.
  11. Installation Steps
  12. ====================
  13. Virtual Environments
  14. --------------------
  15. Virtual environments create isolated environments for your projects.
  16. This helps to keep your system clean, work with different versions of packages and different version of python.
  17. While it is not required, we recommend the use of such virtual environments. To get you started, we recommend
  18. `this guide <http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_ or
  19. `this primer <https://realpython.com/blog/python/python-virtual-environments-a-primer>`_.
  20. In short you can create a virtual environment ``env`` with::
  21. $ pip install virtualenv
  22. $ virtualenv -p python3 env
  23. $ source env/bin/activate
  24. The last step activates the virtual environment.
  25. Whenever using the environment the console prompt is prefixed with ``(env)``.
  26. Building pycarl
  27. ---------------
  28. Clone pycarl into any suitable location::
  29. $ git clone https://github.com/moves-rwth/pycarl.git
  30. $ cd pycarl
  31. Build pycarl in develop mode using your favourite python distribution way of installing: e.g.::
  32. $ python3 setup.py develop
  33. or::
  34. $ pip install -ve .
  35. Optional build arguments
  36. ^^^^^^^^^^^^^^^^^^^^^^^^
  37. The build step also takes optional arguments for a more advanced configuration of pycarl.
  38. * *Specifying which carl library to use*
  39. If you have multiple versions of carl or cmake is not able to find your carl version,
  40. you can specify the ``--carl-dir YOUR-PATH-TO-CARL`` flag in the ``build_ext`` step::
  41. $ python3 setup.py build_ext --carl-dir YOUR-PATH-TO-CARL develop
  42. * *Disabling functionality*
  43. If you want to disable certain functionality in pycarl from being built you can use the following flags:
  44. * ``--disable-cln`` to disable support for CLN numbers
  45. * ``--disable-parser`` to disable support for full parsing capabilities
  46. * *Building pycarl in debug mode*
  47. If you want to build pycarl in debug mode you can add the ``--debug`` flag in the ``build_ext`` step::
  48. $ python3 setup.py build_ext --debug develop
  49. * *Setting number of build threads*
  50. The build of pycarl uses all available cores per default.
  51. If you want to configure the number of threads manually you can specify the ``--jobs`` (or ``-j``) flag::
  52. $ python3 setup.py build_ext --jobs 2 develop
  53. Testing pycarl installation
  54. ---------------------------
  55. After building, you can run the test files by::
  56. $ py.test tests/
  57. If you do not experience any issues, you can now use pycarl. To get started, follow the :doc:`getting_started`, consult the test files in ``tests/`` or the :doc:`api` (work in progress).