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/1.1.1 find -x -p nano
-- linux-rocky9-x86_64_v4 / no compilers ------------------------
nano@7.2 /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/nano/7.2-4ew6nde
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/1.1.1 info nano
AutotoolsPackage: nano
Description:
Tiny little text editor
Homepage: https://www.nano-editor.org
Preferred version:
8.7 https://www.nano-editor.org/dist/v8/nano-8.7.tar.xz
Safe versions:
8.7 https://www.nano-editor.org/dist/v8/nano-8.7.tar.xz
8.6 https://www.nano-editor.org/dist/v8/nano-8.6.tar.xz
8.5 https://www.nano-editor.org/dist/v8/nano-8.5.tar.xz
8.4 https://www.nano-editor.org/dist/v8/nano-8.4.tar.xz
8.3 https://www.nano-editor.org/dist/v8/nano-8.3.tar.xz
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/1.1.1 spec nano@6.4
- nano@6.4 build_system=autotools platform=linux os=rocky9 target=x86_64_v4 %c=gcc@14.2.0
[^] ^compiler-wrapper@1.0 build_system=generic platform=linux os=rocky9 target=x86_64_v4
[e] ^gcc@14.2.0+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rocky9 target=x86_64
- ^gcc-runtime@14.2.0 build_system=generic platform=linux os=rocky9 target=x86_64_v4
[^] ^gettext@0.22.5+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=rocky9 target=x86_64_v4
[^] ^diffutils@3.10 build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^gcc-runtime@11.4.1 build_system=generic platform=linux os=rocky9 target=x86_64_v4
[e] ^glibc@2.34 build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^libxml2@2.10.3+pic~python+shared build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^zlib-ng@2.1.6+compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^tar@1.34 build_system=autotools zip=pigz platform=linux os=rocky9 target=x86_64_v4
[^] ^pigz@2.8 build_system=makefile platform=linux os=rocky9 target=x86_64_v4
[^] ^zstd@1.5.6+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=rocky9 target=x86_64_v4
[^] ^xz@5.4.6~pic build_system=autotools libs:=shared,static platform=linux os=rocky9 target=x86_64_v4
[e] ^glibc@2.34 build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^gmake@4.4.1~guile build_system=generic platform=linux os=rocky9 target=x86_64_v4
[^] ^ncurses@6.5~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=rocky9 target=x86_64_v4
[^] ^pkgconf@2.2.0 build_system=autotools platform=linux os=rocky9 target=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.glibcis 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 ${SLURM_NTASKS} to match the number of compilation threads used to the core
request for the salloc session:
spack install output
$ spack -C ${HOME}/spack-config-templates/1.1.1 install -j ${SLURM_NTASKS} nano@6.4
[+] /usr (external glibc-2.34-xri56vcyzs7kkvakhoku3fefc46nw25y)
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/gcc/14.2.0-4hynq53 (external gcc-14.2.0-bgwfu7hktlwbqpowsmnwitqvfhxjwqhb)
[+] /usr (external glibc-2.34-vjgsh5eoloariofarhttteo73mj5rgql)
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/none-none/compiler-wrapper/1.0-oqjjbmb
[+] /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gcc-runtime/11.4.1-llid4hw
==> No binary for gcc-runtime-14.2.0-qbvayhowqp7ngq5ghzeox54cii5b2s2d found: installing from source
==> Installing gcc-runtime-14.2.0-qbvayhowqp7ngq5ghzeox54cii5b2s2d [6/17]
==> No patches needed for gcc-runtime
==> gcc-runtime: Executing phase: 'install'
==> gcc-runtime: Successfully installed gcc-runtime-14.2.0-qbvayhowqp7ngq5ghzeox54cii5b2s2d
Stage: 0.00s. Install: 0.96s. Post-install: 0.21s. Total: 1.30s
[+] /gpfs/scratch/abc123/spack/apps/linux-rocky9-x86_64_v4/none-none/gcc-runtime/14.2.0-qbvayho
[+] /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/zstd/1.5.6-my7tyw6
[+] /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/bzip2/1.0.8-uj4wyhx
[+] /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/xz/5.4.6-rwn7pno
[+] /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
==> No binary for nano-6.4-muklb7ygd3kdlf3khq2tke2nkzx2zn5m found: installing from source
==> Installing nano-6.4-muklb7ygd3kdlf3khq2tke2nkzx2zn5m [17/17]
==> Fetching https://mirror.spack.io/_source-cache/archive/41/4199ae8ca78a7796de56de1a41b821dc47912c0307e9816b56cc317df34661c0.tar.xz
[100%] 1.59 MB @ 97.4 MB/s
==> 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-muklb7ygd3kdlf3khq2tke2nkzx2zn5m
Stage: 0.67s. Autoreconf: 0.00s. Configure: 28.28s. Build: 1.84s. Install: 0.53s. Post-install: 0.21s. Total: 32.55s
[+] /gpfs/scratch/abc123/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/nano/6.4-muklb7y
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
nanov6.4source code tarball is missing and has thus pulled it into thesource_cachedirectory defined inconfig.yamland 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/1.1.1 find -x -p nano
-- linux-rocky9-x86_64_v4 / %c=gcc@14.2.0 -----------------------
nano@6.4 /gpfs/scratch/abc123/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/nano/6.4-lav3t25
-- linux-rocky9-x86_64_v4 / no compilers ------------------------
nano@7.2 /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/nano/7.2-4ew6nde
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/1.1.1 spec nano@6.4
[+] nano@6.4 build_system=autotools platform=linux os=rocky9 target=x86_64_v4 %c=gcc@14.2.0
[^] ^compiler-wrapper@1.0 build_system=generic platform=linux os=rocky9 target=x86_64_v4
[e] ^gcc@14.2.0+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rocky9 target=x86_64
[+] ^gcc-runtime@14.2.0 build_system=generic platform=linux os=rocky9 target=x86_64_v4
[^] ^gettext@0.22.5+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=rocky9 target=x86_64_v4
[^] ^diffutils@3.10 build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^gcc-runtime@11.4.1 build_system=generic platform=linux os=rocky9 target=x86_64_v4
[e] ^glibc@2.34 build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^libxml2@2.10.3+pic~python+shared build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^zlib-ng@2.1.6+compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^tar@1.34 build_system=autotools zip=pigz platform=linux os=rocky9 target=x86_64_v4
[^] ^pigz@2.8 build_system=makefile platform=linux os=rocky9 target=x86_64_v4
[^] ^zstd@1.5.6+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=rocky9 target=x86_64_v4
[^] ^xz@5.4.6~pic build_system=autotools libs:=shared,static platform=linux os=rocky9 target=x86_64_v4
[e] ^glibc@2.34 build_system=autotools platform=linux os=rocky9 target=x86_64_v4
[^] ^gmake@4.4.1~guile build_system=generic platform=linux os=rocky9 target=x86_64_v4
[^] ^ncurses@6.5~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=rocky9 target=x86_64_v4
[^] ^pkgconf@2.2.0 build_system=autotools platform=linux os=rocky9 target=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 /gpfs/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. -------
/gpfs/scratch/abc123/spack/privatemodules/linux-rocky9-x86_64_v4:
nano/6.4-gcc-14.2.0 2026/06/15 16:54:02
/share/apps/rocky9/environmentmodules/apocrita-modules/spack:
nano/7.2-gcc-12.2.0 2026/05/11 15:15:15
nano/8.2-gcc-14.2.0 2026/05/11 15:15:15
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
/gpfs/scratch/abc123/spack/apps/linux-rocky9-x86_64_v4/gcc-14.2.0/nano/6.4-lav3t25/bin/nano
$ nano --version
GNU nano, version 6.4
(C) 2022 the Free Software Foundation and various contributors
Compiled options: --disable-libmagic --enable-utf8