3. Optional Runtime Dependencies#
The followings are dependencies used during the runtime of g-learn. Note that, among these dependencies, OpenMP is required, while the rest of the dependencies are optional.
3.1. OpenMP (Required)#
g-learn requires OpenMP, which is typically included with most C++ compilers.
- For Linux users:#
By installing a C++ compiler such as GCC, Clang, or Intel, you also obtain OpenMP as well. You may alternatively install
libgomp
(see below) without the need to install a full compiler.- For macOS users:#
It’s crucial to note that OpenMP is not part of the default Apple Xcode’s LLVM compiler. Even if you have Apple Xcode LLVM compiler readily installed on macOS, you will still need to install OpenMP separately via
libomp
Homebrew package (see below) or as part of the open source LLVM compiler, viallvm
Homebrew package.- For Windows users:#
OpenMP support depends on the compiler you choose; Microsoft Visual C++ supports OpenMP, but you may need to enable it explicitly.
Below are the specific installation for each operating system:
sudo apt install libgomp1 -y
sudo yum install libgomp -y
sudo dnf install libgomp -y
sudo brew install libomp
Note
In macOS, for libomp
versions 15
and above, Homebrew installs OpenMP as keg-only. To utilize the OpenMP installation, you should establish the following symbolic links:
libomp_dir=$(brew --prefix libomp)
ln -sf ${libomp_dir}/include/omp-tools.h /usr/local/include/omp-tools.h
ln -sf ${libomp_dir}/include/omp.h /usr/local/include/omp.h
ln -sf ${libomp_dir}/include/ompt.h /usr/local/include/ompt.h
ln -sf ${libomp_dir}/lib/libomp.a /usr/local/lib/libomp.a
ln -sf ${libomp_dir}/lib/libomp.dylib /usr/local/lib/libomp.dylib
3.2. CUDA Toolkit and NVIDIA Graphic Driver (Optional)#
To use GPU devices, install CUDA runtime libraries and NVIDIA graphic driver. See the instructions below.
3.3. Sparse Suite (Optional)#
Suite Sarse is a library for efficient calculations on sparse matrices. g-learn does not require this library as it has its own library for sparse matrices. However, if this library is available, g-learn uses it.
Note
The Sparse Suite library is only used for those functions in g-learn that uses the Cholesky decomposition method by passing method=cholesky
argument to the functions. See API reference for Functions for details.
Install Sparse Suite development library by
sudo apt install libsuitesparse-dev
sudo yum install libsuitesparse-devel
sudo dnf install libsuitesparse-devel
sudo brew install suite-sparse
Alternatively, if you are using Anaconda python distribution (on either of the operating systems), install Suite Sparse by:
sudo conda install -c conda-forge suitesparse
Install
scikit-sparse
python package:python -m pip install scikit-sparse