Installing Software

Table of contents

  1. Before you install
  2. Spack
    1. Finding and installing a package
    2. Using installed packages
    3. Choosing a compiler
  3. Other methods
    1. Pre-built binaries
    2. Building from source

Before you install

First check whether the software is already available, e.g., with module avail or module spider (see Modules). If it isn’t, you can install it yourself in your own directories. Commands that require administrative privileges, such as sudo or dnf install, are not available to users.

Which approach to use depends on what you are installing:

Software Suggested approach
Python packages conda
R packages install.packages()
Scientific applications and libraries (e.g., GDAL, HDF5, compilers) Spack, or conda (many non-Python tools are packaged for conda)
Tools distributed as a Docker image Containers
Tools distributed as a ready-to-run download Pre-built binaries
Anything else Building from source

Installing software can be computationally intensive. For anything more than a quick install, start an interactive job and install from the compute node.

If you think a package would be useful to many users, contact mlinderman@middlebury.edu about installing it centrally.

Spack

Spack is a beta feature. Using the modules it creates requires enabling Lmod.

Spack is a package manager designed for HPC. It can install thousands of scientific packages, building each one (and its dependencies) from source with your choice of version, compiler and options. The centrally installed R versions and compilers on Ada are installed with Spack.

The spack command is available on all nodes. Packages you install go into your home directory (under ~/.spack). Spack automatically reuses packages already installed centrally or provided by the system, so you typically only build what’s missing.

Finding and installing a package

Task Command
Search for packages spack list gsl
Show a package’s versions and options spack info gsl
Preview what will be installed spack spec gsl
Install a package spack install gsl
Install a specific version and option (here, without MPI) spack install hdf5@1.14 ~mpi
List installed packages spack find
Uninstall a package spack uninstall gsl

Building can take from minutes to hours depending on the package and how many dependencies need to be built. Use an interactive job and pass the number of cores to Spack, e.g.,

[ada ~]$ srun --partition=standard --time=4:00:00 --cpus-per-task=8 --mem=16G --pty bash -i
[node002 ~]$ spack install -j 8 gsl

Packages are built to run on any of Ada’s nodes.

Using installed packages

There are two ways to use a package you installed with Spack:

  • spack load adds the package to your current shell, e.g., spack load gsl.
  • Modules: Spack creates a module for each package you install, which is automatically available (with Lmod enabled) via module avail and module load, e.g., module load gsl.

As with other modules, load the package in your job scripts.

Choosing a compiler

By default Spack builds with GCC 14.4. GCC 13.5 and 15.3 are also available, e.g., spack install gsl %gcc@15.3.0 (use spack load for packages built with these other compilers, as their modules aren’t automatically available). The same compilers are available for your own builds with module load gcc (GCC 14.4); run module spider gcc to see the other versions.

Other methods

Pre-built binaries

Many tools are distributed as ready-to-run Linux programs (look for downloads labeled “Linux x86_64” or “amd64”). Download the program into a directory you own, make it executable, and add that directory to your PATH, e.g.,

mkdir -p ~/bin
cd ~/bin
wget https://example.org/tool-linux-x86_64 -O tool
chmod +x tool
export PATH="$HOME/bin:$PATH"   # add this line to ~/.bashrc to make it permanent

Building from source

Most open-source software can be built and installed into your own directories by setting the installation “prefix”. Load a newer compiler first if needed (module load gcc). For software that uses configure (autotools):

./configure --prefix=$HOME/.local
make -j 4
make install

For software that uses CMake:

cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/.local
cmake --build build -j 4
cmake --install build

Then add $HOME/.local/bin to your PATH as shown above. If the build fails because of a missing library, check whether that library is available as a module or can be installed with Spack (and loaded before building).