From 52225c7a6905be5bdf5e7731dbc6f47d34341c1b Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 18 Mar 2022 07:34:42 -0600 Subject: [PATCH] Add guard to prevent building eckit statically, bug fix in py-numpy for detecting gcc version on cray --- var/spack/repos/builtin/packages/eckit/package.py | 10 +++++++++- var/spack/repos/builtin/packages/py-numpy/package.py | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/eckit/package.py b/var/spack/repos/builtin/packages/eckit/package.py index 2934fef99e216a..b303c6e5f3c6cf 100644 --- a/var/spack/repos/builtin/packages/eckit/package.py +++ b/var/spack/repos/builtin/packages/eckit/package.py @@ -26,6 +26,7 @@ class Eckit(CMakePackage): version('1.16.0', sha256='9e09161ea6955df693d3c9ac70131985eaf7cf24a9fa4d6263661c6814ebbaf1') + variant('shared', default=True, description='Build shared libraries') variant('tools', default=True, description='Build the command line tools') variant('mpi', default=True, description='Enable MPI support') variant('admin', default=True, @@ -50,7 +51,8 @@ class Eckit(CMakePackage): 'parsers') variant('aio', default=True, description='Enable asynchronous IO') - depends_on('cmake@3.12:', type='build') + # Build issues with cmake 3.20, not sure about 3.21 + depends_on('cmake@3.12:3.19,3.22:', type='build') depends_on('ecbuild@3.5:', type='build') depends_on('mpi', when='+mpi') @@ -137,6 +139,12 @@ def cmake_args(self): self.define('ENABLE_SANDBOX', False) ] + # Static build of eckit not working, many places in eckit's build + # system have SHARED hardcoded (in several CMakeLists.txt files). + if '~shared' in self.spec: + #args.append('-DBUILD_SHARED_LIBS=OFF') + raise InstrallError("eckit static build not supported") + if '+mpi' in self.spec: args += [ '-DCMAKE_C_COMPILER=%s' % self.spec['mpi'].mpicc, diff --git a/var/spack/repos/builtin/packages/py-numpy/package.py b/var/spack/repos/builtin/packages/py-numpy/package.py index 331fadf70d594d..79e8c34ba5b5e7 100644 --- a/var/spack/repos/builtin/packages/py-numpy/package.py +++ b/var/spack/repos/builtin/packages/py-numpy/package.py @@ -146,7 +146,13 @@ def flag_handler(self, name, flags): # This will essentially check the system gcc compiler unless a gcc # module is already loaded. if self.spec.satisfies('%intel') and name == 'cflags': - if "platform=cray" in self.spec: + # Note that the compiler environment variables and modules + # aren't loaded for the flag_handler phase ... + # See https://github.com/spack/spack/issues/2056 + # + # Newer/other flavors of Cray systems using the Intel compilers directly + # (icc, ...), therefore use this workaround only if 'cc' is used. + if self.compiler.cc == 'cc': gcc_version = Version(spack.compiler.get_compiler_version_output('gcc', '-dumpversion')) # Note that this only returns the major versions on some systems, # to be on the safe side add a guard here to prevent versions <6