Skip to content

Commit

Permalink
Python2 installation update (#279)
Browse files Browse the repository at this point in the history
* Checking out branch python2 mentioned in main installation page.

* Git checkout python2 added to the HPC instructions as well.

* PyMultiNest Python2 compatible commit mentioned.

* Corrected Helios installation instruction to include GSL installation for both methods.
  • Loading branch information
thjsal committed Feb 11, 2023
1 parent d376091 commit ea3fb42
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 14 deletions.
43 changes: 32 additions & 11 deletions docs/source/HPC_systems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
HPC systems
================

The information provided in this page is for users who intend to work on High-Performance Computing (HPC) systems. These installation instructions are system-specific. X-PSI has already been used on different systems, for some of which, we provide the instructions below. This information may also be translated to other systems by users looking for guidance.
The information provided in this page is for users who intend to work on High-Performance Computing (HPC) systems, and want to use the Python 2.7 version of X-PSI. These installation instructions are system-specific. X-PSI has already been used on different systems, for some of which, we provide the instructions below. This information may also be translated to other systems by users looking for guidance.


Snellius (SURF)
Expand Down Expand Up @@ -163,7 +163,7 @@ Now you need the Python interface to MultiNest, starting from ``$HOME``:
cd ~/pymultinest
python setup.py install --user
To test the installation of MultiNest and PyMultiNest on the login node:
If want to make sure that PyMultiNest is compatible with Python 2.7 version of X-PSI, you can e.g., checkout the following PyMultiNest commit: ``git checkout c8eba95``, before running the setup.py file. To test the installation of MultiNest and PyMultiNest on the login node:

.. code-block:: bash
Expand Down Expand Up @@ -191,6 +191,7 @@ To prepare X-PSI from ``$HOME``:
git clone https://github.com/xpsi-group/xpsi.git
cd xpsi
git checkout python2
LDSHARED="icc -shared" CC=icc python setup.py install --user
This ensures that both the compiler and linker are Intel, otherwise gcc linker
Expand Down Expand Up @@ -317,6 +318,7 @@ Let's start by loading the necessary modules and creating a conda environment:
git clone https://github.com/xpsi-group/xpsi.git
cd xpsi
git checkout python2
module load anaconda2/2019-10
conda env create -f basic_environment.yml
conda activate xpsi
Expand All @@ -336,7 +338,7 @@ Let's then install mpi4py:
python setup.py install
mpiexec -n 4 python demo/helloworld.py
Let's then install MultiNest and PyMultiNest:
Let's then install MultiNest and PyMultiNest (and checkout a version that is known to be Python 2.7 compatible):

.. code-block:: bash
Expand All @@ -351,14 +353,31 @@ Let's then install MultiNest and PyMultiNest:
cd; git clone https://github.com/JohannesBuchner/PyMultiNest.git pymultinest
cd pymultinest
git checkout c8eba95
python setup.py install
Let's then install GSL:

.. code-block:: bash
cd; wget -v http://mirror.koddos.net/gnu/gsl/gsl-latest.tar.gz
cd gsl-latest
mkdir build
cd build
../configure CC=gcc --prefix=$HOME/gsl
make
make check
make install
make installcheck
make clean
export PATH=$HOME/gsl/bin:$PATH
Let's then finally install X-PSI:

.. code-block:: bash
cd; cd xpsi;
CC=gcc python setup.py install
cd; cd xpsi;
CC=gcc python setup.py install
Helios (using ``python --user``)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -381,7 +400,7 @@ Let's then install mpi4py:
python setup.py install --user
mpiexec -n 4 python demo/helloworld.py
Let's then install MultiNest and PyMultiNest:
Let's then install MultiNest and PyMultiNest (and checkout a version that is known to be Python 2.7 compatible):

.. code-block:: bash
Expand All @@ -396,15 +415,16 @@ Let's then install MultiNest and PyMultiNest:
cd; git clone https://github.com/JohannesBuchner/PyMultiNest.git pymultinest
cd pymultinest
git checkout c8eba95
python setup.py install --user
Let's then install GSL (which was not needed if using the conda environment approach):
Let's then install GSL:

.. code-block:: bash
cd; wget -v http://mirror.koddos.net/gnu/gsl/gsl-latest.tar.gz
cd gsl-latest
mkdir build
cd gsl-latest
mkdir build
cd build
../configure CC=gcc --prefix=$HOME/gsl
make
Expand All @@ -418,8 +438,9 @@ Let's then finally install X-PSI:

.. code-block:: bash
cd; git clone https://github.com/xpsi-group/xpsi.git
cd xpsi;
cd; git clone https://github.com/xpsi-group/xpsi.git
cd xpsi
git checkout python2
CC=gcc python setup.py install --user
Batch usage
Expand Down
14 changes: 11 additions & 3 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ Python environment
X-PSI was developed in Python 2.7, and is in the process of being ported to Python 3.
Fortunately, there are several ways to create a virtual environment with a
different version of Python, without disrupting your Python ecosystem.
In this page, we present the installation procedure using Python 2.7.
To use Python 2.7 compatible X-PSI version, we need to switch from
the main branch to a branch called python2:

.. code-block:: bash
cd </path/to/xpsi>
git checkout python2
This section is divided into two subsections. We recommend that the user follow the instructions in the :ref:`basic_env` subsection to begin with. If faced with installation issues, the user may refer to the :ref:`diagnosis_env` subsection.

Expand Down Expand Up @@ -118,7 +126,7 @@ Dependencies
Python dependencies
^^^^^^^^^^^^^^^^^^^

The following Python packages are required for nested sampling:
The following Python packages are required for nested sampling (see below how to install PyMultiNest and mpi4py from source):

* `PyMultiNest <https://github.com/JohannesBuchner/PyMultiNest>`_
(the interface to the MultiNest library)
Expand Down Expand Up @@ -180,7 +188,7 @@ ensemble-MCMC is optional.
.. [#] The version of nestcheck_ currently compatible with X-PSI, and used in
`Riley et al. (2019) <https://ui.adsabs.harvard.edu/abs/2019ApJ...887L..21R/abstract>`_, is v0.2.0.
It may be cloned as follows:
It may be cloned as follows:
.. code-block:: bash
Expand Down Expand Up @@ -311,7 +319,7 @@ The package will be installed in your Conda environment (if activated).

.. note::

Here we clone the PyMultiNest repository. However, for `Riley et al. (2019) <https://ui.adsabs.harvard.edu/abs/2019ApJ...887L..21R/abstract>`_,
Here we clone the latest PyMultiNest repository. However, to make sure that PyMultiNest is compatible with Python 2.7 version of X-PSI, you can e.g., checkout the following PyMultiNest commit: ``git checkout c8eba95``, before running the setup.py file. For `Riley et al. (2019) <https://ui.adsabs.harvard.edu/abs/2019ApJ...887L..21R/abstract>`_,
working with X-PSI ``v0.1``, we used the repository as frozen in a *fork*.
To clone this version instead:

Expand Down

0 comments on commit ea3fb42

Please sign in to comment.