summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Book <43379611+ulmononian@users.noreply.github.com>2023-03-17 03:10:36 -0700
committerGitHub <noreply@github.com>2023-03-17 11:10:36 +0100
commitf2ba1d276b33850e23fd97eae865f0f1aae26f2b (patch)
tree602a9ca65e7c62c100d084e3b7f2a05138136480
parent4e060ba93337fbc239916c17fccbf780829f90da (diff)
downloadspack-f2ba1d276b33850e23fd97eae865f0f1aae26f2b.tar.gz
spack-f2ba1d276b33850e23fd97eae865f0f1aae26f2b.tar.bz2
spack-f2ba1d276b33850e23fd97eae865f0f1aae26f2b.tar.xz
spack-f2ba1d276b33850e23fd97eae865f0f1aae26f2b.zip
nccmp: add more constrain to dependencies, add configure args (#35539)
-rw-r--r--var/spack/repos/builtin/packages/nccmp/package.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/nccmp/package.py b/var/spack/repos/builtin/packages/nccmp/package.py
index b1be28cc47..56fdd3cfdc 100644
--- a/var/spack/repos/builtin/packages/nccmp/package.py
+++ b/var/spack/repos/builtin/packages/nccmp/package.py
@@ -2,6 +2,7 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
from spack.package import *
@@ -11,8 +12,31 @@ class Nccmp(CMakePackage):
homepage = "http://nccmp.sourceforge.net/"
url = "https://gitlab.com/remikz/nccmp/-/archive/1.9.0.1/nccmp-1.9.0.1.tar.gz"
+ maintainers("ulmononian", "climbfuji")
+
version("1.9.0.1", sha256="81e9753cf451afe8248d44c841e102349e07cde942b11d1f91b5f85feb622b99")
version("1.8.9.0", sha256="da5d2b4dcd52aec96e7d96ba4d0e97efebbd40fe9e640535e5ee3d5cd082ae50")
version("1.8.2.0", sha256="7f5dad4e8670568a71f79d2bcebb08d95b875506d3d5faefafe1a8b3afa14f18")
- depends_on("netcdf-c")
+ depends_on("cmake@3.12:", type="build")
+ depends_on("netcdf-c", type=("build", "run"))
+ depends_on("mpi", when="^netcdf-c+mpi~shared")
+
+ def cmake_args(self):
+ args = []
+ cflags = []
+
+ if self.spec.satisfies("%intel"):
+ cflags.append("-std=c99")
+
+ if cflags:
+ args.append(self.define("CMAKE_C_FLAGS", " ".join(cflags)))
+
+ nc = self.spec["netcdf-c"]
+ if "~shared" in nc:
+ nc_flags = Executable("nc-config")("--static", "--libs", output=str).strip()
+ args.append(self.define("CMAKE_EXE_LINKER_FLAGS", nc_flags))
+ if "+mpi" in nc:
+ args.append(self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc))
+
+ return args