Skip to content

Installing_RAVEN_Libraries

Joshua J. Cogliati edited this page Mar 31, 2023 · 10 revisions

Installing Libraries Needed to Run RAVEN

RAVEN requires various python libraries to run.

Standard Installation

RAVEN uses conda to maintain a contained library environment with all the specific tested python library versions needed to run RAVEN. If conda is not present on a system, it can usually be installed locally with no issue. The requirements may change from commit to commit, but can be updated via a simple utility.

To install or update Python libraries, navigate to the folder where raven is located and do the following:

cd raven
scripts/establish_conda_env.sh --install

This will install the correct set of libraries for your copy of RAVEN.

Note that if you want to use Python 2 (which is supported until the end of 2019), use:

cd raven
scripts/establish_conda_env.sh --install --py2

Conda Options

For facilitating a variety of computing environments, there are additional options for installing the Python libraries.

Defining location of conda

RAVEN will assume conda is in the default install location, which is operating system-dependent, unless it is told another directory to use. If conda is not installed in the default location, the establish_conda_env.sh script needs to be told where "conda.sh" is using the argument "--conda-defs":

scripts/establish_conda_env.sh --install --conda-defs ~/myconda/etc/profile.d/conda.sh

where myconda might be replaced with any path to the conda installation location. This location will be stored to the file raven/.ravenrc and referred to whenever RAVEN is run.

Changing RAVEN libraries name

By default, RAVEN installs the required Python libraries into a conda environment named "raven_libraries". In the event another name is desired, a bash global environment variable "RAVEN_LIBS_NAME" can be defined to override this default. For example, to rename the environment to "myRavenLibs":

export RAVEN_LIBS_NAME=myRavenLibs
scripts/establish_conda_env.sh

This name will be stored to the file raven/.ravenrc and referred to each time RAVEN runs.

Alternate Installation

In the event conda cannot be used, some suggestions for operating systems are listed below. To get the full list of libraries RAVEN needs to install, along with their specific versions, run the commands:

cd raven
python3 scripts/library_handler.py  --os linux conda

replacing "--linux" with "windows" or "macosx" depending on your operating system, which will print to terminal the list of libraries that should be installed for RAVEN to run, along with specific tagged versions. In windows, use python instead of python3. These libraries will need to be installed through a package manager such as conda or pip, or via the operating system tools listed below. Note the library lists in the examples below are not exhaustive, but give an example of how the libraries can be installed.

Note that for a conda install, there are some libraries that need to be installed with pip, which can be generated with:

python3 scripts/library_handler.py  --os mac conda --action install --subset pip

Note that a pip install command can be generated with:

cd raven
python3 scripts/library_handler.py  --os linux pip

In order for RAVEN to not use conda, the argument --skip-conda can be passed to the various raven commands including:

./build_raven --skip-conda
./run_tests --skip-conda
../../raven_framework --skip-conda test_output.xml

OSX

As described in MAC installation, first install XQuartz, XCode and the conda command line tools.

OSX conda

conda can be used to install the libraries:

sudo bash
#Set up http_proxy and https_proxy variables if needed
conda install -y numpy hdf5 h5py scipy scikit-learn matplotlib swig

Linux

Using conda and the establish_conda_env.sh script is recommend. pip or apt-get or dnf can be used, but if they get different versions of the raven dependencies than the supported versions, there may be some differences in the results during testing.

Fedora (22 or newer):

Library install:

dnf install swig libtool gcc-c++ python3-devel conda \
 numpy python3-h5py python3-scipy python-scikit-learn python3-matplotlib

Tex install (to rebuild manual):

dnf install texlive texlive-subfigure texlive-stmaryrd \
  texlive-titlesec texlive-preprint texlive-placeins

Add --conda-defs /etc/profile.d/conda.sh to the establish conda install. Example:

./scripts/establish_conda_env.sh --install --conda-defs /etc/profile.d/conda.sh

Ubuntu (14.4 or newer):

Install miniconda from: https://docs.conda.io/en/latest/miniconda.html

Library install:

sudo apt-get install libtool swig g++ python3-dev \
 python3-numpy python3-sklearn python3-h5py

Tex install (to rebuild manual):

sudo apt-get install texlive-latex-base texlive-extra-utils \
  texlive-latex-extra texlive-math-extra

Installing without root privilages

For this, pip with --user or the establish_conda_env.sh script can be used.

Ignoring Library Checks (not advised!)

In the unlikely event that you want to run RAVEN with an alternative set of libraries, an environment variable can be set on the command line to ignore library checks:

export RAVEN_IGNORE_VERSIONS=1

Placing this in your bash settings (bashrc or bash_profile) will ensure that libraries are never checked.

We strongly recommend this practice, as it is likely that failures will occur with deviating library versions. Not all of these failure will exhibit as errors or crashes; they may instead result in inaccurate calculations.