Building Dependencies from source#
The polaris dependencies are managed via a separate repository to the main code base. The url for this is
https://git-out.gss.anl.gov/polaris/code/polaris-dependencies
After cloning the repo you should be able to build all required dependencies with the following command (assuming python is available and is 3.7+):
python -m pip install distro GitPython
python ./get-deps.py [-c <COMPILER>] [-d <TARGET_DIR>] [-v] [-p]
The flags for the build script are as follows:
-c - the compiler to use [default gcc or msvc-16.0]
-d <deps_dir> - the directory into which dependencies will be build [default /opt/polaris/deps or c:\opt\polaris\deps]
-v - verbose mode - shows the output of the compilation even if it succeeds [default false]
-p - produce a packaged .tar.gz of the entire deps dir (i.e. /opt/polaris/deps/gcc-10.3.0.tar.gz) [default false]
This above workflow is tested via CI tests on every change to the repo for Ubuntu 20.04 and 22.04 using both gcc 10.3/10.4 and clang.
Building on Bebop/Crossover#
When building on HPC clusters, some additional effort may be required to ensure that all dependencies are available.
Bebop requires that the GMP library is loaded (
module load gmp/6.1.2-v5tqli4
)Bebop and Crossover will not be able to download pre-packaged binaries of HDF5, so this can be allowed to fail as long as the hdf5 library is loaded (
module load hdf5/1.12.0
) when compiling POLARIS.Other clusters may also require a set of MPI headers to be available (
module load mpi
ormodule load mpich
)
Building on CentOS/RHEL/RockyLinux#
The following instructions were used to compile dependencies on RockyLinux 8. They are included here for reference:
sudo yum install gcc-toolset-10 cmake
scl enable gcc-toolset-10 bash
# Install GCC plugin dev kit
sudo yum install dnf-plugins-core
sudo yum config-manager --set-enabled powertools
sudo yum install gcc-toolset-10-gcc-plugin-devel
I also had to make sure that the deps dir for build2 was in the LD_LIBRARY_PATH when compiling polaris-linux.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/polaris/deps/gcc-10.3.0/build2/lib
python3 build.py -cb
Building using containers#
If you are on another operating system, you can use the devcontainer specification to quickly spin up a self-contained dev environment using docker containers. The easiest way to use this is to use VS Code and install the remote-containers plugin (NOTE: you will need docker desktop installed). More information can be found in the visual studio documentation.
Then you should be able to open the directory using the “Remote-Containers: Open directory in container” task and it will automatically download a debian or ubuntu base image with an appropriate gcc and a modern cmake. The default is an ubuntu base that matches the image used in CI but it can be tweaked by modifying values in the devcontainer.json file.