Documentation access will be interrupted from time to time due to some bug correction.


Page tree
Skip to end of metadata
Go to start of metadata

In order for a research article to be complete, the full environment used to produce the results (the description of the experiment, the code, data, etc) should be provided. It can then be used to reproduce the results and create new work based on the research. Reproducibility guarantees we are following the best practices by opening information for greater scrutiny by peers and an informed public.

Step-by-step guide

This page is a work in progress, come back later for a complete guide.


Hosting your code on c4science

One of the first steps to reproducible and open science is a healthy code base. Nowadays most of the projects use a versionning system called Git. It allows to collaborate easily with coworkers, keep track of what has been done and when, go back in a previous version, have seperate development done at the same time and then merged togother in due time. This is only a few examples of what can be achieved using Git. Git is a command line utility, which means you need a terminal to run and use the command (cmd.exe, Terminal.app, etc). There are also graphical frontends to Git like TortoiseGit or SourceTree).

Here's a more complete introduction to GIT: https://c4science.ch/w/c4science/introgit/

To use Git you have to create a repositories on a server where the Git history will be stored. You can use the c4science.ch service to host your code by following this guide. 

Create an account and setup authentication

Create an account on https://c4science.ch/auth/start/ by clicking in the "Login for Swiss Universities" box in the blue button. Select your university and login using your standard account. C4science will then confirm your email and username, after this step you're logged in. You will need to setup one of the two authentication method. They are described in detail on the following pages:

Create and use a repository

Follow the guide to create a repository https://c4science.ch/w/c4science/simplerepo/

Then you can go to the main page of your repository by clicking the View Repository green button on the right. The repository is empty by default, you have to clone it on your computer to start working with it. You need a Git client. On Windows, you should use Git Bash, on Linux you can simply download Git using your package manager (eg. apt-get install git)  and on MacOS you can just type git in the terminal and it will prompt you to install it if it's not available.

Open a terminal application (on Windows open Git Bash, on MacOS Terminal.app) and clone your repository using the URI that you find on the main page of your repository and by click on the green button Clone. Choose one of the two options according to the authentication method you choosed (VCS password or SSH key). Now you can clone the repository on your local machine, go to a folder where you want to put the repository and clone it:

mkdir repos
cd repos
git clone ssh://git@c4science.ch/source/myrepo.git myrepo
cd myrepo

Congratulations, you are now using Git ! 

Collaboration using Git

Git at its core is made to collaborate on source code. The first step is to have separate environment for specific work (like a feature), for this we use a branch. 

# Create a new branch with the name of the new feature you want to work on
git checkout -b feature/my-awesome-feature

You can then work on your branch and push the branch without interfering with other people work on other branches (master, other feature branches). When your work is done and ready to be published, you can merge a branch with an other, typically we want to merge the feature branch back to the master branch.

git checkout master
git merge feature/my-awesome-feature

At this point, conflicts are possible, in every files that git was unable to solve a conflict on you will then see a special syntax with the two branches version of the code. You'll have to remove this construct and replace it with a manual version of the two.

Conflict
If you have a problem,
<<<<<<< HEAD
open a ticket.
=======
ask on the chat.
>>>>>>> feature/my-awesome-feature

Here's an example of a resolution of the previous conflict

After conflict resolution
If you have a problem,
open a ticket or ask on the chat.


An important aspect of collaboration with Git is code review. On c4science you can use the Arcanist tool to allow easy code review. It means that the changes are not commited in your master branch before being validated by a person or a group. More information on the wiki: https://c4science.ch/w/c4science/code_review/

Retrieving information on the provenance of the software provided on the clusters

Nearly every library or application that is available on our clusters via module files has been installed using Spack. While this allows us (as maintainers of the systems) to have a way to automate complex builds and keep track of dependencies, it also permit our users to know how a particular software was built. First of all, configure information is reported directly in the module files for every CMake or Autotools package:

Getting configure options from module files
$ uname -a
Linux fidis 3.10.0-514.26.2.el7.x86_64 #1 SMP Fri Jun 30 05:26:04 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$ module whatis gnuplot
gnuplot/5.0.5       : Name : gnuplot
gnuplot/5.0.5       : Version : 5.0.5
gnuplot/5.0.5       : Short description : Gnuplot is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986
gnuplot/5.0.5       : Configure options : --disable-dependency-tracking --disable-silent-rules --without-tutorial --with-readline=/ssoft/spack/cornalin/v1/opt/spack/linux-rhel7-x86_E5v4_Mellanox/gcc-4.8.5/readline-7.0-dsxnhm75mwj2dybftesgcywb2z6t4f6d --without-bitmap-terminals --without-x --disable-wxwidgets --with-gd=/ssoft/spack/cornalin/v1/opt/spack/linux-rhel7-x86_E5v4_Mellanox/gcc-4.8.5/libgd-2.2.4-vocis5p4if7s5hy3hzsxr3gophepgdob --with-cairo --with-libcerf --without-pdf --with-qt=no --without-lua --without-latex --without-aquaterm


In the snippet above we see, for instance, which are the flags used to build gnuplot with our system compilers. This information can be used either to retry the build or as a starting point for a custom build in some user's folder.

A more complete report of what happened at build time can then be found in the library or application prefix. Our modules always set a <package>_ROOT environment variable, pointing to the folder where the software has been installed. Within that folder you'll find a .spack directory that contains all the provenance information for the package. Going back to our gnuplot example:

Getting the full provenance information
$ module show gnuplot
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   /ssoft/spack/stable/v1/share/spack/lmod/linux-rhel7-x86_E5v4_Mellanox/Core/gnuplot/5.0.5.lua:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
whatis("Name : gnuplot")
whatis("Version : 5.0.5")
whatis("Short description : Gnuplot is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986")
whatis("Configure options : --disable-dependency-tracking --disable-silent-rules --without-tutorial --with-readline=/ssoft/spack/cornalin/v1/opt/spack/linux-rhel7-x86_E5v4_Mellanox/gcc-4.8.5/readline-7.0-dsxnhm75mwj2dybftesgcywb2z6t4f6d --without-bitmap-terminals --without-x --disable-wxwidgets --with-gd=/ssoft/spack/cornalin/v1/opt/spack/linux-rhel7-x86_E5v4_Mellanox/gcc-4.8.5/libgd-2.2.4-vocis5p4if7s5hy3hzsxr3gophepgdob --with-cairo --with-libcerf --without-pdf --with-qt=no --without-lua --without-latex --without-aquaterm")
help([[Gnuplot is a portable command-line driven graphing utility for Linux,
OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is
copyrighted but freely distributed (i.e., you don't have to pay for it).
It was originally created to allow scientists and students to visualize
mathematical functions and data interactively, but has grown to support
many non-interactive uses such as web scripting. It is also used as a
plotting engine by third-party applications like Octave. Gnuplot has
been supported and under active development since 1986]])
prepend_path("PATH","/ssoft/spack/cornalin/v1/opt/spack/linux-rhel7-x86_E5v4_Mellanox/gcc-4.8.5/gnuplot-5.0.5-nf6zg64fyqo27ug43n4slqwu6trb6ukt/bin")
prepend_path("CMAKE_PREFIX_PATH","/ssoft/spack/cornalin/v1/opt/spack/linux-rhel7-x86_E5v4_Mellanox/gcc-4.8.5/gnuplot-5.0.5-nf6zg64fyqo27ug43n4slqwu6trb6ukt/")
prepend_path("MANPATH","/ssoft/spack/cornalin/v1/opt/spack/linux-rhel7-x86_E5v4_Mellanox/gcc-4.8.5/gnuplot-5.0.5-nf6zg64fyqo27ug43n4slqwu6trb6ukt/share/man")
setenv("GNUPLOT_ROOT","/ssoft/spack/cornalin/v1/opt/spack/linux-rhel7-x86_E5v4_Mellanox/gcc-4.8.5/gnuplot-5.0.5-nf6zg64fyqo27ug43n4slqwu6trb6ukt")

$ module load gnuplot
$ ls -la ${GNUPLOT_ROOT}/.spack
total 896
drwxr-sr-x 3 scitasbuild scitas-ge   4096  4 lug  2017 .
drwxr-sr-x 6 scitasbuild scitas-ge   4096  4 lug  2017 ..
-rw-r--r-- 1 scitasbuild scitas-ge  33492  4 lug  2017 build.env
-rw-r--r-- 1 scitasbuild scitas-ge 334684  4 lug  2017 build.out
drwxr-sr-x 3 scitasbuild scitas-ge   4096  4 lug  2017 repos
-rw-r--r-- 1 scitasbuild scitas-ge  20479  4 lug  2017 spec.yaml

The content in this folder always includes:

  • build.env: a dump of the build-time environment
  • build.out: a complete log of the build, from configuration to installation
  • spec.yaml: a yaml representation of the DAG (directed acyclic graph) that represents the installation
  • repos: a folder with all the recipes that were used to build each node of the DAG

and represents the complete set of information one needs to know to reproduce a given build on our system.

Reproduce the build of a package

In principle, any user can reproduce the build of a package that is provided via module files. The first step towards this is to checkout the correct release of Spack in a folder:

Checkout the correct version of Spack
$ uname -a
Linux fidis 3.10.0-514.26.2.el7.x86_64 #1 SMP Fri Jun 30 05:26:04 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$ git clone https://github.com/epfl-scitas/spack.git
Cloning into 'spack'...
remote: Counting objects: 101257, done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 101257 (delta 10), reused 7 (delta 0), pack-reused 101215
Receiving objects: 100% (101257/101257), 34.47 MiB | 15.32 MiB/s, done.
Resolving deltas: 100% (48437/48437), done.

$ cd spack/
$ git checkout releases/paien
Already on 'releases/paien'

$ . share/spack/setup-env.sh 

and set it up to have the same configuration as the one used for module files:

Set up a local checkout of Spack
$ ln -s /ssoft/spack/paien/spack.v2/etc/spack/packages.yaml etc/spack/packages.yaml
$ ln -s /ssoft/spack/paien/spack.v2/etc/spack/compilers.yaml etc/spack/compilers.yaml
$ ln -s /ssoft/spack/paien/spack.v2/etc/spack/modules.yaml etc/spack/modules.yaml

$ ls -larth etc/spack/
total 0
drwxr-xr-x 3 culpo scitas-ge 4,0K 15 gen 15.44 ..
drwxr-xr-x 3 culpo scitas-ge 4,0K 15 gen 15.44 defaults
lrwxrwxrwx 1 culpo scitas-ge   51 15 gen 16.14 packages.yaml -> /ssoft/spack/paien/spack.v2/etc/spack/packages.yaml
lrwxrwxrwx 1 culpo scitas-ge   52 15 gen 16.14 compilers.yaml -> /ssoft/spack/paien/spack.v2/etc/spack/compilers.yaml
drwxr-xr-x 3 culpo scitas-ge 4,0K 15 gen 16.14 .
lrwxrwxrwx 1 culpo scitas-ge   50 15 gen 16.14 modules.yaml -> /ssoft/spack/paien/spack.v2/etc/spack/modules.yaml

Of course, these two operations needs to be done only the first time you checkout Spack. If the local copy was set up correctly, you should be able to see all the compilers available on our machines:

List known compilers
$ spack compiler list
==> Available compilers
-- gcc rhel6-x86_E5v1_IntelIB -----------------------------------
gcc@7.1.0  gcc@6.3.0  gcc@5.4.0  gcc@4.4.7

-- gcc rhel6-x86_E5v2 -------------------------------------------
gcc@7.1.0  gcc@6.3.0  gcc@5.4.0  gcc@4.4.7

-- gcc rhel6-x86_E5v2_IntelIB -----------------------------------
gcc@7.1.0  gcc@6.3.0  gcc@5.4.0  gcc@4.4.7

-- gcc rhel6-x86_E5v2_Mellanox_GPU ------------------------------
gcc@7.1.0  gcc@6.3.0  gcc@5.4.0  gcc@4.4.7

-- gcc rhel6-x86_E5v3_IntelIB -----------------------------------
gcc@7.1.0  gcc@6.3.0  gcc@5.4.0  gcc@4.4.7

-- gcc rhel7-x86_64 ---------------------------------------------
gcc@4.8.5

-- gcc rhel7-x86_E5v4_Mellanox ----------------------------------
gcc@7.1.0  gcc@6.3.0  gcc@5.4.0  gcc@4.8.5

-- intel rhel6-x86_E5v1_IntelIB ---------------------------------
intel@17.0.2

-- intel rhel6-x86_E5v2 -----------------------------------------
intel@17.0.2

-- intel rhel6-x86_E5v2_IntelIB ---------------------------------
intel@17.0.2

-- intel rhel6-x86_E5v2_Mellanox_GPU ----------------------------
intel@17.0.2

-- intel rhel6-x86_E5v3_IntelIB ---------------------------------
intel@17.0.2

-- intel rhel7-x86_E5v4_Mellanox --------------------------------
intel@17.0.2

Note that any time you want to build something with the Intel compiler, you need to load the corresponding module file. This is instead not necessary for GNU-GCC.

At this point you are ready to reproduce the build of any of the software provided via module files. Let's say you want to build the serial version of HDF5 with intel:

Build hdf5 in user's tree
$ module load intel hdf5
$ spack install -f $HDF5_ROOT/.spack/spec.yaml
==> Installing zlib
==> Fetching file:///ssoft/spack/mirror/zlib/zlib-1.2.11.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/zlib-1.2.11-bnwfiwf3kkvs5wtvlefto3k77fwgbmi3/zlib-1.2.11.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/zlib-1.2.11-bnwfiwf3kkvs5wtvlefto3k77fwgbmi3
==> Ran patch() for zlib
==> Building zlib [Package]
==> Executing phase : 'install'
==> Successfully installed zlib
  Fetch: 0.09s.  Build: 11.32s.  Total: 11.41s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/zlib-1.2.11-bnwfiwf3kkvs5wtvlefto3k77fwgbmi3
==> Installing szip
==> Fetching file:///ssoft/spack/mirror/szip/szip-2.1.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/szip-2.1-7nsvipktv6uxazgolreqw66bq6nfpgbm/szip-2.1.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/szip-2.1-7nsvipktv6uxazgolreqw66bq6nfpgbm
==> Ran patch() for szip
==> Building szip [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed szip
  Fetch: 0.05s.  Build: 25.02s.  Total: 25.07s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/szip-2.1-7nsvipktv6uxazgolreqw66bq6nfpgbm
==> Installing hdf5
==> Fetching file:///ssoft/spack/mirror/hdf5/hdf5-1.10.1.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/hdf5-1.10.1-nregnfa66p64fxsnl7pfpszeowwd7g6v/hdf5-1.10.1.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/hdf5-1.10.1-nregnfa66p64fxsnl7pfpszeowwd7g6v
==> Ran patch() for hdf5
==> Building hdf5 [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed hdf5
  Fetch: 0.18s.  Build: 4m 20.76s.  Total: 4m 20.94s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/hdf5-1.10.1-nregnfa66p64fxsnl7pfpszeowwd7g6v

As you can see the procedure is as simple as moving where the spec.yaml of interest resides and then ask Spack to reproduce the build in your installation root. In case you need to customize the build of a package and want to build just its dependencies, you can do that with the appropriate option to Spack:

Installing only the dependencies of a package
$ module load intel intel-mkl intel-mpi yambo
$ spack install --only=dependencies -f $YAMBO_ROOT/.spack/spec.yaml
==> Installing libxc
==> Fetching file:///ssoft/spack/mirror/libxc/libxc-3.0.0.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/libxc-3.0.0-yx3dycotwd37idy7rscr54qtcnccmtyi/libxc-3.0.0.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/libxc-3.0.0-yx3dycotwd37idy7rscr54qtcnccmtyi
==> Ran patch() for libxc
==> Building libxc [Package]
==> Executing phase : 'install'
==> Successfully installed libxc
  Fetch: 0.23s.  Build: 2m 3.53s.  Total: 2m 3.76s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/libxc-3.0.0-yx3dycotwd37idy7rscr54qtcnccmtyi
==> Installing zlib
==> Using cached archive: /home/culpo/custom-installations/spack/var/spack/cache/zlib/zlib-1.2.11.tar.gz
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/zlib-1.2.11-bnwfiwf3kkvs5wtvlefto3k77fwgbmi3/zlib-1.2.11.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/zlib-1.2.11-bnwfiwf3kkvs5wtvlefto3k77fwgbmi3
==> Ran patch() for zlib
==> Building zlib [Package]
==> Executing phase : 'install'
==> Successfully installed zlib
  Fetch: 0.03s.  Build: 6.16s.  Total: 6.19s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/zlib-1.2.11-bnwfiwf3kkvs5wtvlefto3k77fwgbmi3
==> Installing szip
==> Using cached archive: /home/culpo/custom-installations/spack/var/spack/cache/szip/szip-2.1.tar.gz
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/szip-2.1-7nsvipktv6uxazgolreqw66bq6nfpgbm/szip-2.1.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/szip-2.1-7nsvipktv6uxazgolreqw66bq6nfpgbm
==> Ran patch() for szip
==> Building szip [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed szip
  Fetch: 0.04s.  Build: 25.73s.  Total: 25.77s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/szip-2.1-7nsvipktv6uxazgolreqw66bq6nfpgbm
==> Installing hdf5
==> Using cached archive: /home/culpo/custom-installations/spack/var/spack/cache/hdf5/hdf5-1.10.1.tar.gz
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/hdf5-1.10.1-nregnfa66p64fxsnl7pfpszeowwd7g6v/hdf5-1.10.1.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/hdf5-1.10.1-nregnfa66p64fxsnl7pfpszeowwd7g6v
==> Ran patch() for hdf5
==> Building hdf5 [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed hdf5
  Fetch: 0.10s.  Build: 4m 24.34s.  Total: 4m 24.45s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/hdf5-1.10.1-nregnfa66p64fxsnl7pfpszeowwd7g6v
==> intel-mpi@2017.2.174 : externally installed in /ssoft/spack/external/intel/2017/impi/2017.2.174
==> intel-mpi@2017.2.174 : generating module file
==> intel-mpi@2017.2.174 : registering into DB
==> Installing fftw
==> Fetching file:///ssoft/spack/mirror/fftw/fftw-3.3.6-pl2.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/fftw-3.3.6-pl2-von3c3pgtwtvgnqg5rgkaqmueny7soxz/fftw-3.3.6-pl2.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/fftw-3.3.6-pl2-von3c3pgtwtvgnqg5rgkaqmueny7soxz
==> Ran patch() for fftw
==> Building fftw [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed fftw
  Fetch: 0.13s.  Build: 7m 24.44s.  Total: 7m 24.57s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/fftw-3.3.6-pl2-von3c3pgtwtvgnqg5rgkaqmueny7soxz
==> Installing libsigsegv
==> Fetching file:///ssoft/spack/mirror/libsigsegv/libsigsegv-2.11.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/libsigsegv-2.11-ctoqtpmxupvz3dnsbcmubc2uqpytamxs/libsigsegv-2.11.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/libsigsegv-2.11-ctoqtpmxupvz3dnsbcmubc2uqpytamxs
==> Ran patch() for libsigsegv
==> Building libsigsegv [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed libsigsegv
  Fetch: 0.09s.  Build: 17.94s.  Total: 18.03s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/libsigsegv-2.11-ctoqtpmxupvz3dnsbcmubc2uqpytamxs
==> Installing m4
==> Fetching file:///ssoft/spack/mirror/m4/m4-1.4.18.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/m4-1.4.18-vgeh4a6acefqm74xtjifpawsl44r3igi/m4-1.4.18.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/m4-1.4.18-vgeh4a6acefqm74xtjifpawsl44r3igi
==> Applied patch gnulib-pgi.patch
==> Ran patch() for m4
==> Building m4 [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed m4
  Fetch: 0.09s.  Build: 1m 27.36s.  Total: 1m 27.45s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/m4-1.4.18-vgeh4a6acefqm74xtjifpawsl44r3igi
==> zlib is already installed in /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/zlib-1.2.11-bnwfiwf3kkvs5wtvlefto3k77fwgbmi3
==> hdf5 is already installed in /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/hdf5-1.10.1-nregnfa66p64fxsnl7pfpszeowwd7g6v
==> Installing netcdf
==> Fetching file:///ssoft/spack/mirror/netcdf/netcdf-4.4.1.1.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/netcdf-4.4.1.1-5cziwx52tgjm2exoztohivhm4gipezzl/netcdf-4.4.1.1.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/netcdf-4.4.1.1-5cziwx52tgjm2exoztohivhm4gipezzl
==> Ran patch() for netcdf
==> Building netcdf [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed netcdf
  Fetch: 0.11s.  Build: 1m 8.61s.  Total: 1m 8.72s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/netcdf-4.4.1.1-5cziwx52tgjm2exoztohivhm4gipezzl
==> netcdf is already installed in /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/netcdf-4.4.1.1-5cziwx52tgjm2exoztohivhm4gipezzl
==> Installing netcdf-fortran
==> Fetching file:///ssoft/spack/mirror/netcdf-fortran/netcdf-fortran-4.4.4.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/culpo/custom-installations/spack/var/spack/stage/netcdf-fortran-4.4.4-m3nfulf3il3zjp5sci22amwddzbw74ne/netcdf-fortran-4.4.4.tar.gz
==> Created stage in /home/culpo/custom-installations/spack/var/spack/stage/netcdf-fortran-4.4.4-m3nfulf3il3zjp5sci22amwddzbw74ne
==> Ran patch() for netcdf-fortran
==> Building netcdf-fortran [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Executing phase : 'install'
==> Successfully installed netcdf-fortran
  Fetch: 0.09s.  Build: 47.13s.  Total: 47.22s.
[+] /home/culpo/custom-installations/spack/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/netcdf-fortran-4.4.4-m3nfulf3il3zjp5sci22amwddzbw74ne
==> intel-mkl@2017.2.174 : externally installed in /ssoft/spack/external/intel/2017/compilers_and_libraries_2017.2.174/linux/mkl
==> intel-mkl@2017.2.174 : generating module file
==> intel-mkl@2017.2.174 : registering into DB

After this is done you can modify your package (more information on how to do that in this tutorial), and then install your modified version. Remember that to pin your dependencies, you can always specify them by hash:

Check dependencies are correct when installing
$ spack find -l
==> 11 installed packages.
-- linux-rhel7-x86_E5v4_Mellanox / intel@17.0.2 -----------------
von3c3p fftw@3.3.6-pl2  cpry34b intel-mkl@2017.2.174  ctoqtpm libsigsegv@2.11  vgeh4a6 m4@1.4.18       m3nfulf netcdf-fortran@4.4.4  bnwfiwf zlib@1.2.11
nregnfa hdf5@1.10.1     dshqioo intel-mpi@2017.2.174  yx3dyco libxc@3.0.0      5cziwx5 netcdf@4.4.1.1  7nsvipk szip@2.1


$ spack spec -Il yambo ^/m3nfulf ^/von3c3p
Input spec
--------------------------------
     er75iiv  yambo
[+]  von3c3p      ^fftw@3.3.6-pl2%intel@17.0.2+double+float+long_double+mpi~openmp~pfft_patches~quad arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  m3nfulf      ^netcdf-fortran@4.4.4%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  5cziwx5          ^netcdf@4.4.1.1%intel@17.0.2~cdmremote~dap~hdf4 maxdims=1024 maxvars=8192 ~mpi~parallel-netcdf+shared arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  nregnfa              ^hdf5@1.10.1%intel@17.0.2+cxx~debug+fortran~mpi+pic+shared+szip~threadsafe arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  7nsvipk                  ^szip@2.1%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  bnwfiwf                  ^zlib@1.2.11%intel@17.0.2+pic+shared arch=linux-rhel7-x86_E5v4_Mellanox 

Normalized
--------------------------------
     adbv64z  yambo
     tlulk6o      ^blas
[+]  von3c3p      ^fftw@3.3.6-pl2%intel@17.0.2+double+float+long_double+mpi~openmp~pfft_patches~quad arch=linux-rhel7-x86_E5v4_Mellanox 
     2xnea7r          ^mpi
[+]  nregnfa      ^hdf5@1.10.1%intel@17.0.2+cxx~debug+fortran~mpi+pic+shared+szip~threadsafe arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  7nsvipk          ^szip@2.1%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  bnwfiwf          ^zlib@1.2.11%intel@17.0.2+pic+shared arch=linux-rhel7-x86_E5v4_Mellanox 
     qyk5ol5      ^lapack
     cttafm2      ^libxc
[+]  5cziwx5      ^netcdf@4.4.1.1%intel@17.0.2~cdmremote~dap~hdf4 maxdims=1024 maxvars=8192 ~mpi~parallel-netcdf+shared arch=linux-rhel7-x86_E5v4_Mellanox 
     zwmnoet          ^m4
[+]  m3nfulf      ^netcdf-fortran@4.4.4%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox 
     s5h7dk6      ^scalapack

Concretized
--------------------------------
     ix4fnyp  yambo@4.1.3%intel@17.0.2~openmp arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  von3c3p      ^fftw@3.3.6-pl2%intel@17.0.2+double+float+long_double+mpi~openmp~pfft_patches~quad arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  dshqioo          ^intel-mpi@2017.2.174%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  nregnfa      ^hdf5@1.10.1%intel@17.0.2+cxx~debug+fortran~mpi+pic+shared+szip~threadsafe arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  7nsvipk          ^szip@2.1%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  bnwfiwf          ^zlib@1.2.11%intel@17.0.2+pic+shared arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  cpry34b      ^intel-mkl@2017.2.174%intel@17.0.2~ilp64~openmp+shared arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  yx3dyco      ^libxc@3.0.0%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  5cziwx5      ^netcdf@4.4.1.1%intel@17.0.2~cdmremote~dap~hdf4 maxdims=1024 maxvars=8192 ~mpi~parallel-netcdf+shared arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  vgeh4a6          ^m4@1.4.18%intel@17.0.2+sigsegv arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  ctoqtpm              ^libsigsegv@2.11%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox 
[+]  m3nfulf      ^netcdf-fortran@4.4.4%intel@17.0.2 arch=linux-rhel7-x86_E5v4_Mellanox