Skip to content

Commit

Permalink
Merge pull request spack#21 from climbfuji/bugfix/numpy_eckit_hera
Browse files Browse the repository at this point in the history
Add guard to prevent static eckit and building with cmake 3.20 and 3.21 / bug fix in py-numpy for detecting gcc version on cray
  • Loading branch information
kgerheiser authored Mar 18, 2022
2 parents b0da366 + 52225c7 commit ba4871d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion var/spack/repos/builtin/packages/eckit/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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')
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion var/spack/repos/builtin/packages/py-numpy/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba4871d

Please sign in to comment.