ACCESS-NRI / ACCESS-OM2

ACCESS-OM2: ACCESS Ocean-Sea Ice Model
Apache License 2.0
5 stars 0 forks source link

Develop Spack build infrastructure #6

Closed aidanheerdegen closed 1 year ago

aidanheerdegen commented 2 years ago

Develop spack based build infrastructure.

ScottWales commented 1 year ago

@ScottWales mentioned this last Friday: https://git.nci.org.au/bom/ngm/spack-environments/-/blob/jopa/repos/bom-ngm/packages/nci-openmpi/package.py

For context - cmake gets the library and include paths by inspecting mpicc -show etc. which can be modified by setting OMPI_ prefixed environment variables (see man mpicc). The nci-openmpi spack package sets these variables when compiling packages that depend on it, it's intended to be used as a preinstalled system package in place of the normal openmpi package.

harshula commented 1 year ago

[Updated: 07/07/2023]

There are three scenarios of Spack built ACCESS-OM2 being discussed here:

a) Built with Spack built openmpi and runs with Spack built openmpi.

b) Built with Spack built openmpi and runs with system openmpi.

c) Built with system openmpi and run with system openmpi.

harshula commented 1 year ago

Hi @ScottWales, What are you thoughts about adding nci-openmpi to https://github.com/ACCESS-NRI/spack_packages ? If you would like to, please create a PR.

harshula commented 1 year ago

Installation instructions for model developers on Gadi v3 [27/11/2023: Updated to use spack-config]

  1. Login to Gadi:

    ssh USERNAME@gadi.nci.org.au
  2. Clone the relevant git repositories:

    git clone -c feature.manyFiles=true https://github.com/spack/spack.git --branch releases/v0.20 --single-branch --depth=1
    git clone https://github.com/ACCESS-NRI/spack-packages.git --branch main
    git clone https://github.com/ACCESS-NRI/spack-config.git --branch main
  3. Link spack-config configurations files to the Spack instance:

    ln -s -r -v spack-config/v0.20/gadi/* spack/etc/spack/
  4. Set Spack environment variables (required after each login):

    . spack-config/spack-start.bash
  5. Build ACCESS-OM2 (initialisation may take a long time without any output):

    spack install access-om2 ^netcdf-c@4.7.4 ^netcdf-fortran@4.5.2 ^nci-openmpi@4.0.2 %intel@19.0.5.281
harshula commented 1 year ago

It's the Intel 2019.5.281 compiler that represents itself as 19.0.5.281 (i.e. Not a Spack bug!):

$ module load intel-compiler/2019.5.281
$ ifort --version
ifort (IFORT) 19.0.5.281 20190815
Copyright (C) 1985-2019 Intel Corporation.  All rights reserved.

$ module load intel-compiler/2021.5.0
$ ifort --version
ifort (IFORT) 2021.5.0 20211109
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.
aidanheerdegen commented 1 year ago

Installation instructions on Gadi v1

Thanks @harshula. No criticism, but I think we really want to get to a point where people can use spack to build their own versions of packages without having to clone spack.

I guess something like this, or a development of this

https://forum.access-hive.org.au/t/shared-access-spack-configuration/227/

harshula commented 1 year ago

@aidanheerdegen You should open a separate issue, outside of the ACCESS-OM repository, instead of adding additional requests on a closed issue.