Installing OM
OM at Facilities
OM comes pre-installed at some beamlines and facilities.
At the LCLS facility, OM is already installed at the following beamlines:
- MFX beamline
- CXI beamline
OM can be used directly at at these beamlines and facilities. However, the users should always notify in advance the beamline scientists at each facility of their intention to use OM during an experiment.
OM on a Laptop/Desktop
There are three ways to instal OM on a standalone Desktop/Laptop computer.
Installation from PyPI
OM is available on PiPY:
It can be installed using the pip
command:
pip install ondamonitor
Installation from CondaForge
OM is available in the CondaForge package collection and can
be installed using the conda install
command:
conda install -c conda-forge ondamonitor
Installation from Source
OM can be also be installed from source. As a first step, the source code should be retrieved from GitHub. A compressed code archive for each stable release can be found the following page:
Alternatively, the source code can be retrieved directly from the GitHub repository
using the git clone
command:
git clone https://github.com/omdevteam/om
OM can then be installed using the pip
command from the root directory of the
retrieved source code (the directory that contains the setup.py
file):
pip install --prefix=<INSTALLATION PATH> .
In this command,<INSTALLATION PATH>
is a relative or absolute path to the directory
where OM should be installed. A Python development-style installation can also be
performed using the pip
command:
pip install --editable --prefix=<INSTALLATION PATH> .
When OM is installed from source, some additional configuration is needed for the local operating system to subsequently find the installation directory. Typically, on Linux, the following environment variables need to be set:
export PATH=<INSTALLATION PATH>/bin:$PATH
export PYTHONPATH=<INSTALLATION PATH>/lib/python<PYVER>/site-packages:$PYTHONPATH
Here, <INSTALLATION_PATH>
is the directory where OM has been installed, and <PYVER>
is the version of Python used by the system (only the major and minor components of the
version number). The Python version number can be obtained using the python -V
command, which outputs a string in the following format: Python X.Y.Z
. The <PYVER>
entry in the command above corresponds to the X.Y
part of this string.
Installation Script
OM can also be installed from source using a script that is provided with the source code:
sh tools/scripts/installation/install.sh
The script allows the installation of OM at a custom path, and supports editable Python installations. The script can install OM with all its base dependencies or, if a Python environment already provides them, it can also simply install OM. A list of all options supported by the script can be obtained using the following command:
sh tools/scripts/installation/install.sh -h
In addition to installing OM, the script also creates a file that can be used to
activate the installation and set all the required environment variables. If a specific
installation of OM has been carried out by the install.sh
script, it can be
activated by sourcing the file generated by the script:
source <INSTALLATION PATH>/bin/activate-om
Where, <INSTALLATION_PATH>
is the directory where OM has been installed.
MPI
When using OM's MPI Parallelization Engine (the default Parallelization Engine), an MPI framework must be installed on the system where OM is launched. The most popular choices are OpenMPI and MPICH.
The precise instructions for the installation of these frameworks are complex,
operating system-dependent, and outside of the scope of this documentation. Please
note that in addition to one of the MPI frameworks, the corresponding mpi4py
module
for the Python interpreter used by OM must also be installed.