Skip to content

About

Spack package for the ADCIRC model

Resources

Stars

4 stars

Watchers

3 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

ADCIRC Spack Package

ADCIRC's cmake system can be used with the Spack (https://spack.io) package management system. This documentation provides a brief guide for setting up and building ADCIRC via the Spack system

This repository uses the Spack 1.x package repository layout (package API v2.0) and requires Spack 1.0 or newer.

Installation and Initial Setup

Installing Spack

If Spack is not currently installed on your system, you can install it using git:

$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git ~/spack

In the above example, Spack will be installed in the user's home directory in a directory called spack. Spack has few requirements and it is heavily customizable.

Once spack is installed, you will need to initialize the environment. Assuming that the environment was installed to the user's home path as shown above, the command to initialize is:

$ source ~/spack/share/spack/setup-env.sh

Note that this command will need to be run each time the shell is initialized. If you want to add spack to your default environment, you will need to modify your ~/.bashrc or ~/bash_profile to run this command at startup.

Often, rather than placing the source command in the ~/.bashrc directly, it is more useful to alias the command as follows:

$ alias spack-setup=`source ~/spack/share/spack/setup-env.sh`

Initializing the ADCIRC Spack repository

Spack organizes collections of packages into "repositories". In the case of ADCIRC, the repository is currently maintained outside the official spack repository (though this may change in the future after user testing occurs).

To add the ADCIRC spack repository to your instance, use the command:

$ spack repo add https://github.com/adcirc/adcirc-spack.git

Spack clones the repository and keeps it up to date. To use a local clone instead, point Spack at the package directory inside it:

$ spack repo add /path/to/adcirc-spack/spack_repo/adcirc

Note that this command only needs to be run once per spack installation. Within a Spack environment, the repository can also be pinned to a specific commit in spack.yaml:

spack:
  repos:
    adcirc:
      git: https://github.com/adcirc/adcirc-spack.git
      commit: <commit hash>

System Compiler Configuration

While Spack can easily build compilers from source or binary which are not currently installed on the target system, sometimes it is useful to use those which are already configured on the system to ensure compatibility with Infiniband or other system specific configurations.

Spack can locate available compilers on the system using the command:

$ spack compiler find

Note that for some systems which use modules, you may need to load the compilers before running the find command

Additionally, if you wish to use system libraries (including mpi), you can specify them as externals. You can allow spack to automatically detect these libraries using this command:

$ spack external find

or, by specifying manually using the packages.yaml file in either the user or system directory. Additional information for manual specification of external packages can be found here.

Note that this is not an exhaustive tutorial for the setup of Spack and users should consult the Spack documentation and tutorials directly for comprehensive instructions.

Building ADCIRC

The ADCIRC build process enabled by spack should be straight forward. To view the information on the ADCIRC package, you can run the command:

$ spack info adcirc

This will print out a listing of available versions and options for use within the spack package. Unless you have specific needs, it is recommended to use the preferred version.

$ spack install [email protected]

The default build will build adcirc and all dependencies from source as specified by your spack configuration. This will build (by default) ADCIRC in serial and parallel with netCDF enabled. Additional executables (such as adcswan, padcswan, and aswip) can be enabled by specificying additional flags to Spack as shown below:

$ spack install adcirc +swan +aswip

If you'd like to change the compiler that is used to build adcirc, you can pass that using:

$ spack install adcirc %oneapi

This will build ADCIRC using the Intel-LLVM (i.e. Intel OneAPI) compilers. Note that only ADCIRC version 56.00+ is compatible with the Intel-LLVM compiler suite. %oneapi refers to the intel-oneapi-compilers package, which is only available on x86_64 Linux.

Installing Intel OneAPI Compilers

In Spack 1.x, compilers are regular packages. Install the compilers once, and Spack will then use them for any spec that requests %oneapi:

$ spack install intel-oneapi-compilers
$ spack compilers

Compilers already present on the system (including a site-wide oneAPI installation) are registered as externals with spack compiler find.

Another variant would be to enable the system to build OpenMPI from source using Intel-LLVM with SLURM support:

$ spack install adcirc ^openmpi+legacylaunchers schedulers=slurm %oneapi

If you'd like to build with your specific mpi library, you should provide the specification that matches the one defined in your packages.yaml. This will force the system to build with the system MPI rather than one it tries to build itself.

$ spack install adcirc ^[email protected]%gcc

About

Spack package for the ADCIRC model

Resources

Stars

4 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages