================== Spack installation ================== Install GPRidge and inspect its C, CMake, Fortran, Python, and CLI interfaces using Spack. GPRidge provides a local Spack repository under ``packaging/spack`` containing recipes for ``gpridge`` and its companion dependencies (``anneal``, ``ira``, ``linkcell``, ``minimage``, ``readcon-core``, ``readcon-db``, ``rgmin``, ``rgpot``, and ``rgsaddle-headers``); none of these packages are in upstream ``spack-packages`` yet. Prerequisites ------------- - Spack with Meson build support (``spack@1.0:`` or ``develop``). - C, C++, and Fortran compilers (``gcc@13:`` or equivalent) registered with Spack. - Rust 1.88 or newer (``rust@1.88:``) and ``llvm+clang`` (with ``libclang.so``) for the default ``+rgmin`` build. - Network access on build nodes during configure so Meson fetches the pinned ``subprojects/*.wrap`` archives and Cargo fetches its locked crates (``meson_args`` passes ``-Dwrap_mode=default``). Register the repository and install ----------------------------------- Add ``packaging/spack`` from a checkout and install either the pinned release tag (selected by default by ``spack install gpridge``) or the ``develop`` branch: .. code:: bash git clone --branch develop https://github.com/TheochemUI/gpridge.git cd gpridge spack repo add packaging/spack spack spec gpridge spack install gpridge To install the bleeding-edge branch with the Python bindings, Cap'n Proto configuration schemas, and Google Highway SIMD kernels: .. code:: bash spack install "gpridge@develop +python +capnp +highway" Load the installed package into your shell environment and verify the drivers or Python module: .. code:: bash spack load gpridge gprn --help gprd --help python3 -m gpridge.wheel_smoke Variants and constraints ------------------------ ``gpridge`` exposes the Meson configuration through Spack variants. Boolean and feature variants default to the repository build unless noted. .. table:: +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | Variant | Default | Effect / dependencies | +================+===============+==============================================================================================================+ | ``linalg`` | ``eigen`` | ``eigen``, ``cholmod``, ``cusolver``, ``kokkos``, ``stdpar``, ``scalapack``, or ``slate`` | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``blas`` | ``openblas`` | Selects ``openblas``, ``flexiblas``, or ``netlib-lapack`` via the ``blas`` / ``lapack`` virtuals | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``mpi`` | off | Distributed build; promotes default ``linalg=eigen`` to ``scalapack`` unless ``linalg=slate`` | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``hdf5`` | on | HDF5 >= 1.12 (``~mpi+shared`` for ``H5Fis_accessible``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``drivers`` | on | Build and install ``gprd`` and ``gprn`` | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``fortran`` | on | Compile and install ``libgpridge_fortran.a`` and ``include/gpridge.mod`` | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``python`` | off | Nanobind Python module ``gpridge`` (``python@3.11:``, ``py-nanobind@2.10:``, ``py-numpy@2:``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``rgmin`` | on | Rust/HiGHS optimizer (``rust@1.88:``, ``llvm+clang``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``anneal`` | on (+rgmin) | Simulated annealing pre-stage (``cbindgen@0.29:``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``readcon`` | on | Read ``.con`` structure files (``readcon-core``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``readcon_db`` | on (+readcon) | Persist observation archives (``readcon-db``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``ira`` | on (+drivers) | Iterative Rotations and Assignments (``ira``) for ``gprn`` endpoint alignment | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``highway`` | off | Google Highway SIMD kernels (``highway@1.2:``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``openmp`` | off | OpenMP distance and covariance loops (conflicts with ``+mpi``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``stdpar`` | off | Bounded parallel-STL kernel blocks (``tbb``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``capnp`` | off | Cap'n Proto schemas and plugin support (``capnproto@1.3:1``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``uma`` | off | ``rgpot`` UMA AOTInductor plugin (requires ``+capnp``, PyTorch stack, ``blas=flexiblas`` or ``blas=netlib``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``metatomic`` | off | ``rgpot`` Metatomic TorchScript plugin (requires PyTorch stack, ``blas=flexiblas`` or ``blas=netlib``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``xtb`` | off | ``rgpot`` xTB/GFN potential backend (``xtb@6.6:``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``mopac`` | off | ``rgpot`` MOPAC backend (runtime ``dlopen`` of ``libmopacc``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``nwchem`` | off | ``rgpot`` NWChem socket backend (requires ``+capnp``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``skala`` | off | ``rgpot`` Skala DFT backend (requires ``+capnp +nwchem``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``lammps`` | off | LAMMPS generic engine plugin (requires ``+capnp``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``chemfiles`` | off | Chemfiles trajectory I/O (``chemfiles@0.10:``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``ceres`` | off | Ceres Solver hyperparameter optimization (``ceres-solver``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``cuda`` | off | ``CudaPackage`` support (``cuda_arch``; for ``linalg=kokkos`` or ``linalg=cusolver``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``rocm`` | off | ``ROCmPackage`` support (``amdgpu_target``; for ``linalg=kokkos`` with ``rocsolver``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ | ``simd`` | ``default`` | Passes ``-Dsimd_baseline`` (``default``, ``x86-64-v3``, ``x86-64-v2``, ``native``, or ``none``) | +----------------+---------------+--------------------------------------------------------------------------------------------------------------+ Selected rules enforced by the recipe: - ``+mpi`` with the default ``linalg=eigen`` switches the Meson backend to ``scalapack``; ``+mpi`` conflicts with ``+openmp`` and with non-distributed backends other than ``eigen``, ``scalapack``, and ``slate``. - ``+python`` conflicts with ``default_library=static`` and sets ``PYTHONPATH`` and ``GPR_ENGINE_LIBRARY`` in ``setup_run_environment``. - ``+uma`` and ``+metatomic`` conflict with ``blas=openblas`` in Spack; select ``blas=flexiblas`` or ``blas=netlib``. .. code:: bash spack install "gpridge +mpi" spack install "gpridge +uma +metatomic blas=flexiblas" Run stand-alone tests and verify libraries ------------------------------------------ After installation, run Spack's stand-alone test suite and library resolution checks: .. code:: bash spack test run gpridge spack test results -l spack verify libraries gpridge The recipe implements seven test methods: 1. ``test_capi_smoke``: compiles and runs ``packaging/conda/smoke.c`` via ``pkg-config gpridge``. 2. ``test_capi_consumer``: compiles ``examples/capi_neb_muller_brown.c`` with strict C99 flags and verifies convergence. 3. ``test_cmake_consumer``: configures, builds, and runs ``packaging/native/cmake`` with ``find_package(gpridge CONFIG)``. 4. ``test_fortran_consumer``: compiles and runs ``examples/fortran_neb_muller_brown.f90`` against ``include/gpridge.mod`` and ``lib/libgpridge_fortran.a``. 5. ``test_python_smoke``: imports ``gpridge``, calls ``gpridge.check_abi()``, and runs ``python3 -m gpridge.wheel_smoke`` (skipped when ``~python``). 6. ``test_driver_help``: verifies ``gprd --help`` and ``gprn --help``. 7. ``test_lj_pentamer``: runs ``gprn`` on a seven-image Lennard-Jones pentamer band and asserts convergence. Companion recipes and private archive mirror -------------------------------------------- The nine companion packages in ``packaging/spack/packages`` record exact commit pins and patches. Five of them (``anneal``, ``readcon-core``, ``readcon-db``, ``rgmin`` and ``ira@2.2.0`` for the IRA wrap) match ``subprojects/*.wrap``. Four still lag the wraps: ``linkcell``, ``minimage``, ``rgpot`` and ``rgsaddle-headers`` pin older commits (and ``rgpot`` carries more patches) than the Meson subprojects use. ``packaging/spack/UPSTREAM_PR.md`` and each recipe's docstring list the split. ``gpridge`` keeps ``-Dwrap_mode=default`` so Meson builds those patched subprojects directly rather than skipping local wrap patches through an external ``pkg-config`` match. Verification status ------------------- Checked on Ubuntu 24.04.5 LTS (``linux-ubuntu24.04-icelake``) with Spack ``1.3.0.dev0`` and GCC 13.3.0: - ``spack audit packages`` passed (``PKG-DIRECTIVES``, ``PKG-ATTRIBUTES``, ``PKG-PROPERTIES``) across ``gpridge`` and all nine companion packages. - ``spack install`` succeeded for all nine companion packages, the default tagged release spec (``gpridge``, using a local archive mirror for the private tag tarball), and ``gpridge@develop +python +capnp +highway``. - ``spack verify libraries`` passed with zero missing shared libraries across all installed specs. - ``spack test run`` passed 6 of 7 parts (1 skipped: ``test_python_smoke``) on the tagged release spec and 7 of 7 parts on ``gpridge@develop +python +capnp +highway``. - ``spack spec`` resolved cleanly for the tagged release spec, ``gpridge@develop +python +capnp +highway``, ``gpridge +mpi``, ``gpridge +uma +metatomic blas=flexiblas``, ``gpridge linalg=stdpar``, and ``gpridge linalg=kokkos`` (with and without ``+cuda`` / ``+rocm``). See also -------- - :doc:`Installation <../getting-started/installation>`: comparison across Pixi, Meson, pip, Conda, EasyBuild, EESSI, and Spack. - :doc:`Native EasyBuild installation ` and :doc:`Run on an HPC cluster `. - :doc:`Build options <../reference/build_options>` and :doc:`Native packages and downstream bindings `.