Skip to content

Commit

Permalink
Dependencies: Python incl. venv
Browse files Browse the repository at this point in the history
Backported from #2556.

Follow-up to #2653
  • Loading branch information
ax3l committed Dec 10, 2021
1 parent 1e0d27c commit aa5b255
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Docs/source/developers/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ Add a test to the suite
There are three steps to follow to add a new automated test (illustrated here for PML boundary conditions):

* An input file for your test, in folder `Example/Tests/...`. For the PML test, the input file is at ``Examples/Tests/PML/inputs_2d``. You can also re-use an existing input file (even better!) and pass specific parameters at runtime (see below).
* A Python script that reads simulation output and tests correctness versus theory or calibrated results. For the PML test, see ``Examples/Tests/PML/analysis_pml_yee.py``. It typically ends with Python statement `assert( error<0.01 )`.
* Add an entry to [Regression/WarpX-tests.ini](./Regression/WarpX-tests.ini), so that a WarpX simulation runs your test in the continuous integration process, and the Python script is executed to assess the correctness. For the PML test, the entry is
* A Python script that reads simulation output and tests correctness versus theory or calibrated results. For the PML test, see ``Examples/Tests/PML/analysis_pml_yee.py``. It typically ends with Python statement ``assert( error<0.01 )``.
* If you need a new Python package dependency for testing, add it in ``Regression/requirements.txt``
* Add an entry to ``Regression/WarpX-tests.ini``, so that a WarpX simulation runs your test in the continuous integration process, and the Python script is executed to assess the correctness. For the PML test, the entry is

.. code-block::
Expand Down
15 changes: 11 additions & 4 deletions Docs/source/install/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ Optional dependencies include:
- see `optional I/O backends <https://github.com/openPMD/openPMD-api#dependencies>`__
- `CCache <https://ccache.dev>`__: to speed up rebuilds (For CUDA support, needs version 3.7.9+ and 4.2+ is recommended)
- `Ninja <https://ninja-build.org>`__: for faster parallel compiles
- `Python 3.6+ <https://www.python.org>`__

- `mpi4py <https://mpi4py.readthedocs.io>`__
- `numpy <https://numpy.org>`__
- `periodictable <https://periodictable.readthedocs.io>`__
- `picmistandard <https://picmi-standard.github.io>`__
- see our ``requirements.txt`` file for compatible versions


Install
Expand Down Expand Up @@ -67,7 +74,7 @@ If you also want to run runtime tests and added Python (``spack add python`` and

.. code-block:: bash
python -m pip install matplotlib==3.2.2 yt scipy numpy openpmd-api
python3 -m pip install matplotlib==3.2.2 yt scipy numpy openpmd-api virtualenv
If you want to run the ``./run_test.sh`` :ref:`test script <developers-testing>`, which uses our legacy GNUmake build system, you need to set the following environment hints after ``spack env activate warpx-dev`` for dependent software:

Expand Down Expand Up @@ -118,7 +125,7 @@ Without MPI:

.. code-block:: bash
conda create -n warpx-dev -c conda-forge blaspp ccache cmake compilers git lapackpp openpmd-api python numpy scipy yt fftw matplotlib mamba ninja
conda create -n warpx-dev -c conda-forge blaspp ccache cmake compilers git lapackpp openpmd-api python numpy scipy yt fftw matplotlib mamba ninja pip virtualenv
source activate warpx-dev
# compile WarpX with -DWarpX_MPI=OFF
Expand All @@ -127,7 +134,7 @@ With MPI (only Linux/macOS):

.. code-block:: bash
conda create -n warpx-dev -c conda-forge blaspp ccache cmake compilers git lapackpp "openpmd-api=*=mpi_openmpi*" python numpy scipy yt "fftw=*=mpi_openmpi*" matplotlib mamba ninja openmpi
conda create -n warpx-dev -c conda-forge blaspp ccache cmake compilers git lapackpp "openpmd-api=*=mpi_openmpi*" python numpy scipy yt "fftw=*=mpi_openmpi*" matplotlib mamba ninja openmpi pip virtualenv
source activate warpx-dev
For legacy ``GNUmake`` builds, after each ``source activate warpx-dev``, you also need to set:
Expand All @@ -145,7 +152,7 @@ Apt (Debian/Ubuntu)
.. code-block:: bash
sudo apt update
sudo apt install build-essential ccache cmake g++ git libfftw3-mpi-dev libfftw3-dev libhdf5-openmpi-dev libopenmpi-dev pkg-config python3 python3-matplotlib python3-numpy python3-scipy
sudo apt install build-essential ccache cmake g++ git libfftw3-mpi-dev libfftw3-dev libhdf5-openmpi-dev libopenmpi-dev pkg-config python3 python3-matplotlib python3-numpy python3-pip python3-scipy python3-venv
# optional:
# for CUDA, either install
Expand Down

0 comments on commit aa5b255

Please sign in to comment.