Skip to content

Commit ea3fb42

Browse files
authored
Python2 installation update (#279)
* 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.
1 parent d376091 commit ea3fb42

2 files changed

Lines changed: 43 additions & 14 deletions

File tree

docs/source/HPC_systems.rst

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
HPC systems
44
================
55

6-
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.
6+
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.
77

88

99
Snellius (SURF)
@@ -163,7 +163,7 @@ Now you need the Python interface to MultiNest, starting from ``$HOME``:
163163
cd ~/pymultinest
164164
python setup.py install --user
165165
166-
To test the installation of MultiNest and PyMultiNest on the login node:
166+
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:
167167

168168
.. code-block:: bash
169169
@@ -191,6 +191,7 @@ To prepare X-PSI from ``$HOME``:
191191
192192
git clone https://github.com/xpsi-group/xpsi.git
193193
cd xpsi
194+
git checkout python2
194195
LDSHARED="icc -shared" CC=icc python setup.py install --user
195196
196197
This ensures that both the compiler and linker are Intel, otherwise gcc linker
@@ -317,6 +318,7 @@ Let's start by loading the necessary modules and creating a conda environment:
317318
318319
git clone https://github.com/xpsi-group/xpsi.git
319320
cd xpsi
321+
git checkout python2
320322
module load anaconda2/2019-10
321323
conda env create -f basic_environment.yml
322324
conda activate xpsi
@@ -336,7 +338,7 @@ Let's then install mpi4py:
336338
python setup.py install
337339
mpiexec -n 4 python demo/helloworld.py
338340
339-
Let's then install MultiNest and PyMultiNest:
341+
Let's then install MultiNest and PyMultiNest (and checkout a version that is known to be Python 2.7 compatible):
340342

341343
.. code-block:: bash
342344
@@ -351,14 +353,31 @@ Let's then install MultiNest and PyMultiNest:
351353
352354
cd; git clone https://github.com/JohannesBuchner/PyMultiNest.git pymultinest
353355
cd pymultinest
356+
git checkout c8eba95
354357
python setup.py install
355358
359+
Let's then install GSL:
360+
361+
.. code-block:: bash
362+
363+
cd; wget -v http://mirror.koddos.net/gnu/gsl/gsl-latest.tar.gz
364+
cd gsl-latest
365+
mkdir build
366+
cd build
367+
../configure CC=gcc --prefix=$HOME/gsl
368+
make
369+
make check
370+
make install
371+
make installcheck
372+
make clean
373+
export PATH=$HOME/gsl/bin:$PATH
374+
356375
Let's then finally install X-PSI:
357376

358377
.. code-block:: bash
359378
360-
cd; cd xpsi;
361-
CC=gcc python setup.py install
379+
cd; cd xpsi;
380+
CC=gcc python setup.py install
362381
363382
Helios (using ``python --user``)
364383
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -381,7 +400,7 @@ Let's then install mpi4py:
381400
python setup.py install --user
382401
mpiexec -n 4 python demo/helloworld.py
383402
384-
Let's then install MultiNest and PyMultiNest:
403+
Let's then install MultiNest and PyMultiNest (and checkout a version that is known to be Python 2.7 compatible):
385404

386405
.. code-block:: bash
387406
@@ -396,15 +415,16 @@ Let's then install MultiNest and PyMultiNest:
396415
397416
cd; git clone https://github.com/JohannesBuchner/PyMultiNest.git pymultinest
398417
cd pymultinest
418+
git checkout c8eba95
399419
python setup.py install --user
400420
401-
Let's then install GSL (which was not needed if using the conda environment approach):
421+
Let's then install GSL:
402422

403423
.. code-block:: bash
404424
405425
cd; wget -v http://mirror.koddos.net/gnu/gsl/gsl-latest.tar.gz
406-
cd gsl-latest
407-
mkdir build
426+
cd gsl-latest
427+
mkdir build
408428
cd build
409429
../configure CC=gcc --prefix=$HOME/gsl
410430
make
@@ -418,8 +438,9 @@ Let's then finally install X-PSI:
418438

419439
.. code-block:: bash
420440
421-
cd; git clone https://github.com/xpsi-group/xpsi.git
422-
cd xpsi;
441+
cd; git clone https://github.com/xpsi-group/xpsi.git
442+
cd xpsi
443+
git checkout python2
423444
CC=gcc python setup.py install --user
424445
425446
Batch usage

docs/source/install.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ Python environment
2424
X-PSI was developed in Python 2.7, and is in the process of being ported to Python 3.
2525
Fortunately, there are several ways to create a virtual environment with a
2626
different version of Python, without disrupting your Python ecosystem.
27+
In this page, we present the installation procedure using Python 2.7.
28+
To use Python 2.7 compatible X-PSI version, we need to switch from
29+
the main branch to a branch called python2:
30+
31+
.. code-block:: bash
32+
33+
cd </path/to/xpsi>
34+
git checkout python2
2735
2836
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.
2937

@@ -118,7 +126,7 @@ Dependencies
118126
Python dependencies
119127
^^^^^^^^^^^^^^^^^^^
120128

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

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

312320
.. note::
313321

314-
Here we clone the PyMultiNest repository. However, for `Riley et al. (2019) <https://ui.adsabs.harvard.edu/abs/2019ApJ...887L..21R/abstract>`_,
322+
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>`_,
315323
working with X-PSI ``v0.1``, we used the repository as frozen in a *fork*.
316324
To clone this version instead:
317325

0 commit comments

Comments
 (0)