A Spack repo for some MICe-developed and -maintained software packages, some of which are of general interest to MINC users and others mostly for internal use.
Initial setup:
- git clone https://github.com/spack/spack.git
- git clone https://github.com/Mouse-Imaging-Centre/mice-spack-packages.git
- source spack/share/spack/setup-env.sh
- configure main spack repo to point to this repo (repo-wide via
spack repo add ...
or per-env basis) - detect compilers:
spack compiler find --scope=site
- (highly recommended) detect external packages (--scope=site)
- configure etc/spack/modules.yaml -- in particular, if using tcl modules instead of lmod (not recommended), set 'autoload: direct' or generated modulefiles won't respect Python dependencies
Building the set of packages:
- export MY_SPACK_ENV="my-new-env-yy-mm-dd"
- spack env create ${MY_SPACK_ENV}
- edit
var/spack/environments/${MY_SPACK_ENV}/spack.yaml
as appropriate - spack env activate ${MY_SPACK_ENV}
- spack concretize (optional)
- spack install
- (after running spack concretize or spack install you'll have to delete var/spack/environments/${MY_SPACK_ENV}/spack.lock after changing spack.yaml (including via
spack add
,spack remove
, etc), and after editing a package that's successfully installed you'll have to remove the lockfile and also uninstall the package--Spack seemingly doesn't track changes to the package.py in the hash) - spack module lmod refresh # generate module files (or
tcl
instead oflmod
) - spack env loads -m lmod # generate "loads" file (a shell file to be sourced)
- convert the
loads
file to a modulefile - install R packages and make a module (assumes you have devtools and packrat installed e.g. as a user, from previous Spack env, Packrat env, etc.):
echo 'depends_on('r-packages/<version>') >> /path/to/StdEnv.lua
- configure qbatch, RMINC, and Pydpiper by setting PYDPIPER_CONFIG_FILE, RMINC_BATCH_CONF, and relevant QBATCH vars (e.g. in modulefiles)
- if you blacklisted LD_LIBRARY_PATH in the module generation, hack the modules to add ${pkgs.{flex}/lib to LD_LIBRARY_PATH in order for minccalc to work (and similarly for libtiff if using opencv Python package, etc.)
- check that the generated modules actually work -- Spack might have generated them out-of-order (see e.g. github.com/spack/spack/issues/26771) or even left some out entirely