-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To test installing the package, run ``` spack install -U -v [email protected] %[email protected] ^[email protected] ``` for compiling the serial executable, and ``` spack install -U -v [email protected] +mpi %[email protected] ^[email protected] ^[email protected] ``` for compiling the MPI executable.
- Loading branch information
1 parent
e57dc31
commit 67ddd8f
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# Copyright 2022 ACCESS-NRI | ||
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
from spack.package import * | ||
|
||
# See https://spack.readthedocs.io/en/latest/packaging_guide.html for a guide | ||
# on how this file works. | ||
|
||
|
||
class Cable(CMakePackage): | ||
"""The CSIRO Atmosphere Biosphere Land Exchange (CABLE) model.""" | ||
|
||
homepage = "https://github.com/CABLE-LSM/CABLE.git" | ||
git = "[email protected]:CABLE-LSM/CABLE.git" | ||
|
||
maintainers("SeanBryan51") | ||
|
||
variant( | ||
"mpi", | ||
default=False, | ||
description="Build MPI executable.", | ||
) | ||
variant( | ||
"build_type", | ||
default="Release", | ||
description="CMake build type", | ||
values=("Debug", "Release"), | ||
) | ||
|
||
depends_on("netcdf-fortran") | ||
depends_on("mpi", when="+mpi") | ||
|
||
def cmake_args(self): | ||
args = [] | ||
if self.spec.satisfies("+mpi"): | ||
args += [ | ||
self.define_from_variant("CABLE_MPI", "mpi"), | ||
# TODO(Sean): we should let CMake find the MPI compiler instead | ||
# of specifying it explicitly. However, this requires adding | ||
# find_package(MPI) to the CMakeLists.txt file. This was not | ||
# done in https://github.com/CABLE-LSM/CABLE/pull/200 so that | ||
# we can demonstrate binary equivalence in the executables when | ||
# transitioning from a Makefile based to a CMake based build | ||
# system. Once find_package(MPI) is added, this file should be | ||
# updated. | ||
self.define( | ||
"CMAKE_Fortran_COMPILER", | ||
self.spec["mpi"].mpifc, | ||
), | ||
] | ||
return args |