We recommend that you try using Spack to install software locally to your path. Spack is a tool that conveniently installs software packages to your local path. Please refer to the Spack documentation for the latest information about the packages that Spack contains. To use Spack, you first need to copy it to your /home directory, then have it in your local environment. Use the procedure below to get started with Spack on Discovery.
Getting started with Spack¶
- Connect to Discovery.
git clone https://github.com/spack/spack.gitto copy Spack to your /home directory.
srun -p short --pty --export=ALL -N 1 -n 28 --exclusive /bin/bashto allocate an interactive node. Spack will attempt to run
makein parallel, so this
srunrequest is for 28 cores on one node (-N 1 -n 28).
- To have Spack in your local environment so you can use the Spack commands, type
- Then type
- After you have the Spack commands in your path, type
spack listto see all of the software that you can install with Spack.
spack info <software name>to see information about a specific software package, including options and dependencies. Make sure to note the options and/or dependencies that you want to add or not add before installing the software.
spack install <software name> +<any dependencies or options>to install a software package plus any dependencies or options. You can also specify
-<any dependencies or options>.You can list
-different options and dependencies within the same line. Do not put a space between each option/dependency that you list.
spack findto view your installed software packages, or type
spack find <software package name>to view information about a specific installed package.
When you have installed a software package, you can add it to the module system by typing:
Installing LAMMPS with Spack example¶
This section details how to install an application called LAMMPS with the KOKKOS and User-reaxc packages using Spack.
This example assumes that you do not have any previous versions of LAMMPS installed. If you
have any previous versions of LAMMPS, you must uninstall them before using this procedure. To see if you have any previous versions of LAMMPS, type
spack find lammps. If you do have a previous version, type
spack uninstall --dependents lammps to uninstall LAMMPS. Then, you
can try the example procedure below. Note that the installation can take about two hours to complete. As part of the procedure, we recommend that you initiate a screen session
so that you can have the installation running as a separate process if you need to do other work on Discovery. If you decide to use screen, make note of the compute node number (compute node numbers start with c or d with four numbers, such as c0123)
to make it easier to check on the progress of the installation.
Install Spack by following steps 1 through 5 in the Getting started with Spack procedure above.
exitto exit from the compute node you requested in step 2 above.
Type the following to request a GPU node for 8 hours:
srun --partition=gpu --nodes=1 --ntasks=14 --pty --export=All --gres=gpu:1 --mem=0 --time=08:00:00 /bin/bash
(Optional) Initiate a
screen -S lammps-installto create a screen session.
screen -lsto check to see if the session was created (you’ll see it listed if it was successfully created).
screen -rd lammps-installto enter that screen session.
echo $STYto check that you are in the screen session.
CTRL+A+Dto exit the screen.
spack install lammps +asphere +body +class2 +colloid +compress +coreshell +cuda cuda_arch=70 +cuda_mps +dipole +granular +kokkos +kspace +manybody +mc +misc +molecule +mpiio +peri +python +qeq +replica +rigid +shock +snap +spin +srd +user-reaxc +user-misc
spack find LAMMPSto view your installed software package.
spack load lammps.