Skip to content

Installation

HERMES supports GNU/Linux and macOS. It requires CMake 3.20 or newer, a C++17 compiler, GSL, zlib, and CFITSIO. Python 3 is required for pyhermes. FFTW3F is optional. The unmaintained PICARD/HDF5 integration is disabled by default.

1. Install native dependencies

macOS with Homebrew

brew install cmake python cfitsio gsl fftw

Apple Clang from Xcode Command Line Tools is sufficient:

xcode-select --install

The command reports an existing installation when the tools are already present.

Debian or Ubuntu

sudo apt-get update
sudo apt-get install \
  build-essential cmake git \
  libcfitsio-dev libgsl-dev libfftw3-dev zlib1g-dev \
  python3-dev python3-venv

Fedora or RHEL

sudo dnf install \
  cmake gcc-c++ git \
  cfitsio-devel gsl-devel fftw-devel zlib-devel \
  python3-devel

2. Create an isolated environment

python3 -m venv "$HOME/.virtualenvs/hermes"
source "$HOME/.virtualenvs/hermes/bin/activate"
python -m pip install --upgrade pip

An isolated prefix prevents an older pyhermes or libhermes under /usr/local from shadowing the build being tested.

3. Clone and configure

git clone https://github.com/HERMES-SkyMaps/hermes.git
cd hermes

cmake -S . -B build \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \
  -DCMAKE_PREFIX_PATH="$VIRTUAL_ENV" \
  -DPython3_EXECUTABLE="$(command -v python)" \
  -DENABLE_PYTHON=ON \
  -DENABLE_TESTING=ON \
  -DDOWNLOAD_DATA=ON

DOWNLOAD_DATA=ON downloads approximately 282 MiB from the versioned hermes-data v1.0.0 release. CMake verifies its pinned SHA-256 before extraction. The default configuration does not contact the network unless this option is enabled.

4. Build, test, and install

cmake --build build --parallel
ctest --test-dir build --output-on-failure
cmake --install build

The installation contains the shared C++ library, headers, CMake package, Python extension, and runtime data below the virtual-environment prefix.

5. Verify what Python imports

python - <<'PY'
import os
import sys
import pyhermes

print("Python:", sys.executable)
print("HERMES:", pyhermes.__file__)
print("Version:", pyhermes.__version__)
print("Data:", pyhermes.getDataPath("VERSION"))
print("HERMES_DATA_PATH:", os.environ.get("HERMES_DATA_PATH", "<unset>"))
PY

Both Python and pyhermes should resolve inside $HOME/.virtualenvs/hermes. Installed data should resolve below the same prefix unless HERMES_DATA_PATH deliberately overrides it.

Next, run the checks in Verify the installation.

Build without installing

For development, the extension and data can be used directly from the build tree:

export PYTHONPATH="$PWD/build${PYTHONPATH:+:$PYTHONPATH}"
export HERMES_DATA_PATH="$PWD/build/data"
python -c 'import pyhermes; print(pyhermes.__file__)'

Do not leave these variables in a shell startup file: they can silently select an old build months later.