Home SPACK Basic
Post
Cancel

SPACK Basic

SPACK

Showing installed version of a package

1
2
spack find [option] <package name>
$ spack find -v gromacs

load package

1
spack load <package name>

Compiler

1
2
3
4
spack find -p gcc
-- linux-ubuntu22.04-x86_64_v3 / gcc@11.4.0 ---------------------
gcc@12.3.0  /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-chmemdiqoycjlxz2myvdxqzt5don54uw
==> 1 installed package

We can add GCC to Spack as an available compiler using the spack compiler add command. This will allow future packages to build with gcc@12.3.0. To avoid having to copy and paste GCC’s path, we can use spack location -i to get the installation prefix.

1
2
3
4
5
spack compiler add "$(spack location -i gcc@12)"
==> Added 1 new compiler to /home/spack/.spack/linux/compilers.yaml
    gcc@12.3.0
==> Compilers are defined in the following files:
    /home/spack/.spack/linux/compilers.yaml

## 套件表示法

1
2
3
@ 開頭表示版本號
% 開頭表示編譯器
^ 開頭表示依賴項

Install Gromacs

Check the programs/packages to be installed

If you’ve added the installation specifications to the environment, then you can check the installation plan using the command

1
spack spec -lI

(the first letter after the hyphen is a lowercase “L” and the second letter is an uppercase “i”).

This command identifies what dependencies Spack needs in order to install your desired packages along with how it will obtain them. Assuming their are no problems, then it will print a list of the packages and their dependencies, where entries that begin with a green [+] have already been installed somewhere in your local Spack installation, while those that begin with a green [^] are referencing the system installation, and those beginning with a gray - will need to be downloaded and installed.

1
spack install -j 6 gromacs@2022.5%gcc@13.2

Reference:

Installing Software Using Spack
SPACK compiler

This post is licensed under CC BY 4.0 by the author.