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:
- Check the lab software folder
cd /ref/dblab/software - Check the spack lab instance:
spack find -x
Next, consult the software's documentation.
- Ensure dependancies are met.
- 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.
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
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:
- Invoke the python interpreter
python3 - Run a test command
yourModule - 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
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
Make sure you already installed the packages to the spack instance. Check this using spack find -x.
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 #.