Building and Installing NCL

Unfortunately there has still been sufficient need for NCL on Derecho and Casper to require an installation. Ideally, this will be the last install of NCL we need to do, but the process is documented here if this proves too optimistic!

NCL does, in fact, have a Spack recipe and you can build it via Spack. However, there are two reasons not to do this:

  1. The dependencies it requires have become quite old, and Spack maintainers are increasingly deprecating and then removing old versions of packages, so things may eventually fail to concretize.
  2. The Spack-built NCL still produces some errors which are and will likely remain unresolved. For example, the WRAPIT command provided by NCL fails with the Spack build.

To work around these issues, I have a manual installer that was developed when the NCL team was active, but I've modified it to use dependencies built by Spack. If you ever need to rebuild NCL, you may need to reference new versions of these dependencies. The script is in this repo in etc/installers. If you need to modify the script, most likely you will need to modify the SWDEPS array to point to new dependencies.

Adding to Spack

Once NCL is installed, it can be added to Spack as an external via the constraints.cfg file and then "installed" into the cluster. By "installing" it in Spack, we motivate Spack to generate a module for that NCL version.

NCARG Library

In the past, users have requested a path containing the libraries used to build NCARG (NCAR Graphics - part of NCL) as their codes need these for linking. To produce this collection of libraries, another script uses the same dependencies as NCL and copies them into the specified path. This is also provided in the etc/installers folder.

We then add a convenient reference to this path into the NCL module generated by Spack, as follows:

        ncl:
          environment:
            set:
              NCARG_LIBS_ROOT: /glade/u/apps/opt/ncl/ncarglibs/{version}