Skip to content

Commit

Permalink
Document Python environments (espressomd#4922)
Browse files Browse the repository at this point in the history
Description of changes:
- encourage the use of Python environments (venv, conda, etc.) in the installation instructions
  • Loading branch information
kodiakhq[bot] authored and jngrad committed May 22, 2024
1 parent 89737a8 commit 792f6b8
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions doc/sphinx/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,30 @@ are required to be able to compile and use |es|:
Python
|es|'s main user interface relies on Python 3.

We strongly recommend using Python environments to isolate
packages required by |es| from packages installed system-wide.
This can be achieved using venv [7]_, conda [8]_, or any similar tool.
Inside an environment, commands of the form
``sudo apt install python3-numpy python3-scipy``
can be rewritten as ``python3 -m pip install numpy scipy``,
and thus do not require root privileges.

Depending on your needs, you may choose to install all |es|
dependencies inside the environment, or only the subset of
dependencies not already satisfied by your workstation or cluster.
For the exact syntax to create and configure an environment,
please refer to the tool documentation.

Cython
Cython is used for connecting the C++ core to Python.

Python environment tools may allow you to install a Python executable
that is more recent than the system-wide Python executable.
Be aware this might lead to compatibility issues if Cython
accidentally picks up the system-wide :file:`Python.h` header file.
In that scenario, you will have to manually adapt the C++ compiler
include paths to find the correct :file:`Python.h` header file.


.. _Installing requirements on Ubuntu Linux:

Expand All @@ -86,9 +107,9 @@ To compile |es| on Ubuntu 22.04 LTS, install the following dependencies:

.. code-block:: bash
sudo apt install build-essential cmake cython3 python3-pip python3-numpy \
libboost-all-dev openmpi-common fftw3-dev libfftw3-mpi-dev libhdf5-dev libhdf5-openmpi-dev \
python3-scipy python3-opengl libgsl-dev freeglut3
sudo apt install build-essential cmake cython3 python3-dev openmpi-bin \
libboost-all-dev fftw3-dev libfftw3-mpi-dev libhdf5-dev libhdf5-openmpi-dev \
python3-pip python3-numpy python3-scipy python3-opengl libgsl-dev freeglut3
Optionally the ccmake utility can be installed for easier configuration:

Expand Down Expand Up @@ -971,3 +992,12 @@ ____
.. [5]
https://www.fftw.org/
.. [6]
https://docs.nvidia.com/cuda/
.. [7]
https://docs.python.org/3/library/venv.html
.. [8]
https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

0 comments on commit 792f6b8

Please sign in to comment.