This package enables installation of Loci/CHEM via Spack.
First obtain Spack and source the activation script:
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
. spack/share/spack/setup-env.shSecond, run spack list to pull down the built-in repositories. Next,
have Spack search your system for compilers and other software it can
reuse. Make sure any software you want it to find is on your path:
spack compiler find
spack external findNext, add this and the Loci Spack repo as git-based repositories and pull them both down:
spack repo add --name loci_repo https://github.com/TimothyEDawson/loci_spack.git
spack repo add --name chem_repo https://github.com/TimothyEDawson/chem_spack.git
spack repo update loci_repo
spack repo update chem_repoAnd you're good to go! You can verify that Spack is able to find the packages with
spack info chem and spack info loci. You can also pull in any updates by
rerunning the update commands, or update all repos (including built-ins) with:
spack repo updateLoci/CHEM is currently export-controlled, and access is restricted accordingly.
This Spack repo is set up to use either tarballs or a git bundle, both of which
are distributed via CAVS SimSys. To use the
tarballs, first download the encrypted .tgz files and decrypt them. You may
then either execute your spack commands from the directory containing them, or
set the environment variable CHEM_TARBALL_DIR to their location.
To use the git bundle, likewise download and decrypt the .bundle file, then set
the CHEM_GIT_REPO environment variable to point to the file (or to your own
hosted mirror of its contents). Note that this will take precedence over the
tarball option if set.
I generally recommend installing your own Python version so that Spack will
use that instead of the older system-installed version, making sure it's on
your path and running spack external find again. This should add lines like:
packages:
python:
externals:
- spec: python@3.14.0rc1+bz2+ctypes+dbm+lzma+pyexpat+pythoncmd+readline+sqlite3+ssl~tix+tkinter+uuid+zlib
prefix: /home/tim.dawson/python_venvs/uv-py3p14to your ~/.spack/packages.yaml file. I highly recommend using
uv to manage your Python installation.
You can now install the latest snapshot version directly from the Git repository:
spack install chem@developYou can also specify the compiler to use, e.g. to install with LLVM compilers:
spack install chem@develop %llvmSpecific tagged releases will be added over time. They will then be installable with the version syntax:
spack install chem@4.1.b7We recommend utilizing Spack environments to manage your Spack installations. To create and activate an environment called "chem", execute:
spack env create chem
spack env activate -p chemWhere the -p option will prepend the terminal with the name of the activated
environment (highly recommended). To deactivate an active environment, run:
despacktivateWith the environment active, you will need to manually add specs before you
will be able to install them. It is also recommended to manually concretize
the specs before installation, which performs the dependency analysis and shows
which packages will be installed and which already-installed packages will be
reused.
spack add chem@develop
spack concretizeYou can now install the requested packages via spack install. If you did not
manually concretize, it will automatically concretize when you install.
Spack will not set the CHEMISTRY_DATABASE environment variable, so it will
need to be set manually. I recommend creating a copy of the data_base folder
in a separate, fixed location, for use with any CHEM installations. This can be
easily obtained by cloning or extracting the CHEM source code, e.g.:
cd $HOME/code
git clone chem-4.1-b8.bundle chem
export CHEMISTRY_DATABASE=$HOME/code/chemNote that $CHEMISTRY_DATABASE must point to folder which contains the
data_base folder, not to the data_base folder itself.
As this repository is updated, you only need to pull the latest version using Spack:
spack repo updateIn order to utilize Spack while actively developing for Loci and CHEM you can
follow the instructions for creating an environment, adding the spack develop
command before concretizing:
spack add chem@develop
spack develop chem@develop
spack develop loci@develop
spack concretizeBy adding these commands, Spack will clone the specified packages into the
environment directory instead of a temporary directory, and use these
directories as-is during the build and install process. Thus the developer
may cd into these directories and make changes to the source code before
executing spack install.
To enter the directories, use the convenience function to enter the
environment directory and then cd into the code directory:
spack cd -e
cd chemAfter making changes you can re-run spack install to rebuild the code, and it
should automatically skip unnecessarily rebuilding files in the standard make
fashion.