Installing a personal version of Nano¶
Now, as a simple example, let's imagine for some reason you specifically need an
older version of the nano
text editor, you've requested it from the ITSR Apps
Team and they have rejected your request as demand is low (which is very likely
what would happen). First, let's look at the available versions in upstream:
spack find
output
$ spack -C ${HOME}/spack-config-templates/0.23.1 find -x -p nano
-- linux-rocky9-x86_64_v4 / gcc@12.2.0 --------------------------
nano@7.2 /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/nano/7.2-4ew6nde
-- linux-rocky9-x86_64_v4 / gcc@14.2.0 --------------------------
nano@8.2 /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/nano/8.2-7onanyb
==> 2 installed packages
We can see that versions 7.2
and 8.2
of nano
are already installed
centrally. Let's see what other versions might be available:
spack info
output
$ spack -C ${HOME}/spack-config-templates/0.23.1 info nano
AutotoolsPackage: nano
Description:
Tiny little text editor
Homepage: https://www.nano-editor.org
Preferred version:
8.2 https://www.nano-editor.org/dist/v8/nano-8.2.tar.xz
Safe versions:
8.2 https://www.nano-editor.org/dist/v8/nano-8.2.tar.xz
8.1 https://www.nano-editor.org/dist/v8/nano-8.1.tar.xz
8.0 https://www.nano-editor.org/dist/v8/nano-8.0.tar.xz
7.2 https://www.nano-editor.org/dist/v7/nano-7.2.tar.xz
6.4 https://www.nano-editor.org/dist/v6/nano-6.4.tar.xz
(etc.)
Always run a spec
command before install
!
You should always check what is about to be installed using the spec
command as detailed below and then move onto the install
command.
And let's see if we can
spec
a personal installation of v6.4
:
spack spec
output
$ spack -C ${HOME}/spack-config-templates/0.23.1 spec nano@6.4
- nano@6.4%gcc@14.2.0 build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^gcc-runtime@14.2.0%gcc@14.2.0 build_system=generic arch=linux-rocky9-x86_64_v4
[^] ^gettext@0.22.5%gcc@11.4.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^bzip2@1.0.8%gcc@11.4.1~debug~pic+shared build_system=generic arch=linux-rocky9-x86_64_v4
[^] ^diffutils@3.10%gcc@11.4.1 build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^gcc-runtime@11.4.1%gcc@11.4.1 build_system=generic arch=linux-rocky9-x86_64_v4
[e] ^glibc@2.34%gcc@11.4.1 build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^libxml2@2.10.3%gcc@11.4.1+pic~python+shared build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^zlib-ng@2.1.6%gcc@11.4.1+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^tar@1.34%gcc@11.4.1 build_system=autotools zip=pigz arch=linux-rocky9-x86_64_v4
[^] ^pigz@2.8%gcc@11.4.1 build_system=makefile arch=linux-rocky9-x86_64_v4
[^] ^zstd@1.5.6%gcc@11.4.1+programs build_system=makefile compression=none libs=shared,static arch=linux-rocky9-x86_64_v4
[^] ^xz@5.4.6%gcc@11.4.1~pic build_system=autotools libs=shared,static arch=linux-rocky9-x86_64_v4
[e] ^glibc@2.34%gcc@14.2.0 build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^gmake@4.4.1%gcc@11.4.1~guile build_system=generic arch=linux-rocky9-x86_64_v4
[^] ^ncurses@6.5%gcc@11.4.1~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=linux-rocky9-x86_64_v4
[^] ^pkgconf@2.2.0%gcc@11.4.1 build_system=autotools arch=linux-rocky9-x86_64_v4
To explain the symbols in the above output:
-
means that the listed application/library is not installed anywhere at all, neither in upstream or personally[^]
means that the listed application/library is already installed in upstream and will be used to avoid re-installation[e]
means that the listed application/library is marked as external.glibc
is always marked as external and is provided from the compute node installation of Rocky 9 Linux because otherwise major issues can occur. It is also possible to define additional external packages in your custom packages.yaml should you wish.
So, let's follow through and install nano
v6.4
. I am using -j ${NSLOTS}
to
match the number of compilation threads used to the core request for the qlogin
session:
spack install
output
$ spack -C ${HOME}/spack-config-templates/0.23.1 install -j ${NSLOTS} nano@6.4
[+] /usr (external glibc-2.34-vjgsh5eoloariofarhttteo73mj5rgql)
[+] /usr (external glibc-2.34-xri56vcyzs7kkvakhoku3fefc46nw25y)
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/gcc-runtime/14.2.0-4w7sesu
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gcc-runtime/11.4.1-llid4hw
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/bzip2/1.0.8-uj4wyhx
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/xz/5.4.6-rwn7pno
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/zlib-ng/2.1.6-g2yruc3
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/ncurses/6.5-4n2uzha
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/zstd/1.5.6-my7tyw6
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gmake/4.4.1-xchit5a
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/pigz/2.8-somkvv4
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/libxml2/2.10.3-q6zmsq6
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/tar/1.34-ivzmnos
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gettext/0.22.5-udcuonu
==> Installing nano-6.4-6hegmjalyqmcthxzn2irc6yanfhx3b63 [15/15]
==> No binary for nano-6.4-6hegmjalyqmcthxzn2irc6yanfhx3b63 found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/41/4199ae8ca78a7796de56de1a41b821dc47912c0307e9816b56cc317df34661c0.tar.xz
==> No patches needed for nano
==> nano: Executing phase: 'autoreconf'
==> nano: Executing phase: 'configure'
==> nano: Executing phase: 'build'
==> nano: Executing phase: 'install'
==> nano: Successfully installed nano-6.4-6hegmjalyqmcthxzn2irc6yanfhx3b63
Stage: 0.26s. Autoreconf: 0.00s. Configure: 43.79s. Build: 3.56s. Install: 1.26s. Post-install: 0.92s. Total: 50.67s
[+] /data/scratch/abc123/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/nano/6.4-6hegmja
To break down what has happened above:
- The existing available upstream dependencies have been used from the central location as opposed to reinstalled
- Spack has noticed that the
nano
v6.4
source code tarball is missing and has thus pulled it into thesource_cache
directory defined inconfig.yaml
and then manually compiled it and installed it to the location defined asinstall_tree:
root:
inconfig.yaml
.
Let's now return to our spack find
command:
spack find
output
$ spack -C ${HOME}/spack-config-templates/0.23.1 find -x -p nano
-- linux-rocky9-x86_64_v4 / gcc@12.2.0 --------------------------
nano@7.2 /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/nano/7.2-4ew6nde
-- linux-rocky9-x86_64_v4 / gcc@14.2.0 --------------------------
nano@6.4 /data/scratch/abc123/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/nano/6.4-6hegmja
nano@8.2 /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/nano/8.2-7onanyb
==> 3 installed packages
So now we have nano
v6.4
installed personally, and v7.2
and v8.2
in
upstream. If we run our spec
command again:
spack spec output
$ spack -C ${HOME}/spack-config-templates/0.23.1 spec nano@6.4
[+] nano@6.4%gcc@14.2.0 build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^gcc-runtime@14.2.0%gcc@14.2.0 build_system=generic arch=linux-rocky9-x86_64_v4
[^] ^gettext@0.22.5%gcc@11.4.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^bzip2@1.0.8%gcc@11.4.1~debug~pic+shared build_system=generic arch=linux-rocky9-x86_64_v4
[^] ^diffutils@3.10%gcc@11.4.1 build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^gcc-runtime@11.4.1%gcc@11.4.1 build_system=generic arch=linux-rocky9-x86_64_v4
[e] ^glibc@2.34%gcc@11.4.1 build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^libxml2@2.10.3%gcc@11.4.1+pic~python+shared build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^zlib-ng@2.1.6%gcc@11.4.1+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^tar@1.34%gcc@11.4.1 build_system=autotools zip=pigz arch=linux-rocky9-x86_64_v4
[^] ^pigz@2.8%gcc@11.4.1 build_system=makefile arch=linux-rocky9-x86_64_v4
[^] ^zstd@1.5.6%gcc@11.4.1+programs build_system=makefile compression=none libs=shared,static arch=linux-rocky9-x86_64_v4
[^] ^xz@5.4.6%gcc@11.4.1~pic build_system=autotools libs=shared,static arch=linux-rocky9-x86_64_v4
[e] ^glibc@2.34%gcc@14.2.0 build_system=autotools arch=linux-rocky9-x86_64_v4
[^] ^gmake@4.4.1%gcc@11.4.1~guile build_system=generic arch=linux-rocky9-x86_64_v4
[^] ^ncurses@6.5%gcc@11.4.1~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=linux-rocky9-x86_64_v4
[^] ^pkgconf@2.2.0%gcc@11.4.1 build_system=autotools arch=linux-rocky9-x86_64_v4
We can see that nano@6.4
is marked with a [+]
which means it is already
installed in the install_tree:
root:
for this custom configuration scope
(as opposed to [^]
which means it is already installed upstream).
If we now add our specified private module path using module use
as specified
in modules.yaml
:
module use /data/scratch/${USER}/spack/privatemodules/linux-rocky9-x86_64_v4
Then we should see our personal version available for use:
Output from module avail
$ module avail -l nano
- Package/Alias -----------------------.- Versions --------.- Last mod. -------
/data/scratch/abc123/spack/privatemodules/linux-rocky9-x86_64_v4:
nano/6.4-gcc-14.2.0 2025/05/15 16:28:01
/share/apps/rocky9/environmentmodules/apocrita-modules/spack:
nano/7.2-gcc-12.2.0 2025/05/01 10:40:45
nano/8.2-gcc-14.2.0 2025/05/15 16:27:07
And indeed, we can load and use our personal version (use the full module name):
Output from module load
$ module load nano/6.4-gcc-14.2.0
$ which nano
/data/scratch/abc123/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/nano/6.4-6hegmja/bin/nano
$ nano --version
GNU nano, version 6.4
(C) 2022 the Free Software Foundation and various contributors
Compiled options: --disable-libmagic --enable-utf8