Skip to content

Latest commit

 

History

History
132 lines (118 loc) · 3.52 KB

File metadata and controls

132 lines (118 loc) · 3.52 KB

Installing new software

Start an interactive session prior to beginning installation. If the install is expected to take a significant amount of time, consider submitting a bash script using sbatch.

First, confirm that the software has not already been installed:

  1. Check the lab software folder
    cd /ref/dblab/software
    
  2. Check the spack lab instance:
    spack find -x
    

Next, consult the software's documentation.

  1. Ensure dependancies are met.
  2. Look for suggested installation steps.

Not all software can be installed using spack. To see if the software exists as a spack package:

spack list yourKeyword

Available packages are also searchable here.

Install the package to the lab spack instance:

spack install yourSpackPackage

The package can now be added to a spack environment.

Adding spack packages to an existing environment

Display all spack environments that exist in the lab spack instance:

spack env list

Activate one of the pre-existing environments:

spack env activate -p yourEnvironment

View the spack packages that are already in the environment. The x flag is used to omit dependancies.

spack find -x

Add spack packages, seperating each with a space. Use @ to denote version:

spack add samtools [email protected]  # add spack packages

Exit the environment:

spack env deactivate

Reactivate the environment:

spack env activate -p yourEnvironment

Finalize the new updates:

spack concretize

Adding modules to python in a spack environment

Activate one of the pre-existing environments:

spack env activate -p yourEnvironment

Check if pip is installed.

python3 -m pip --version

If pip is not working, try to install it.

python3 -m ensurepip

If that doesn't work, upgrade pip to the latest version.

python -m pip install --upgrade pip

Load new python modules using the pip installer:

python3 -m pip install yourModule yourModule2

To confirm that a module was loaded:

  1. Invoke the python interpreter
    python3
    
  2. Run a test command
    yourModule
    
  3. Exit python interactive mode
    exit
    

Adding spack packages to an environment will wipe out existing python modules. Prior to adding new spack packages, back up your pip environment:

python3 -m pip freeze > my-reqs.txt

Reinstall after concretization:

python3 -m pip install -r my-reqs.txt

Creating a new environment

Create a new environment if there is a specific set of software and dependancies that you want to isolate and be able to reload in future sessions. This example will create an enviornment with everything needed to run Jupyter notebooks on the server.

spack env create jupyter

Activate the new environment:

spack env activate -p jupyter

Add spack packages, seperating each with a space. Use @ to denote version of a spack spec:

This assumes we've already installed the spack packages for this version of python and Jupyter lab to the spack instance. 
spack add [email protected] py-jupyterlab py-nbconvert  # add spack packages

Troubleshooting

Can't add a spack package

Make sure you already installed the packages to the spack instance. Check this using spack find -x.

Namespace issues

Occasionally, you may run into namespace issues if another user installed the spec to the lab spack instance. You can install another copy to the same spack instance and reference the spec you installed in this case. Reference specific specs using #.