Various package fixes for macOS (#29024)

* trilinos: disable dl on macOS

* py-sphinx-argparse: add explicit poetry dependency

* libzmq: fix libbsd dependency

libbsd is *always* required when +libbsd (introduced in #28503) . #20893
had previously removed the macos dependency because libbsd wasn't always
enabled. Libbsd support is only available after 4.3.2 so change it to a
conflict rather than bumping the dependency.

* hdf5: work around GCC11.2 monterey fortran bug

* go-bootstrap: mark conflict for monterey
This commit is contained in:
Seth R. Johnson 2022-02-21 03:08:08 -05:00 committed by GitHub
parent 2852126196
commit 7459aa6c95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 5 deletions

View file

@ -35,6 +35,7 @@ class GoBootstrap(Package):
depends_on('git', type=('build', 'link', 'run'))
conflicts('os=monterey', msg="go-bootstrap won't build on new macOS")
conflicts('target=aarch64:', when='platform=darwin',
msg='Go bootstrap is too old for Apple Silicon')

View file

@ -0,0 +1,24 @@
From 598df49b738fd99df9f2671e4e967fd9c33ae8a9 Mon Sep 17 00:00:00 2001
From: Seth R Johnson <johnsonsr@ornl.gov>
Date: Wed, 16 Feb 2022 20:38:03 -0500
Subject: [PATCH] Close file to work around GCC11.2/macOS12 bug
---
m4/aclocal_fc.f90 | 1 +
1 file changed, 1 insertion(+)
diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90
index e9a11c0ab5..bfda49aa40 100644
--- a/m4/aclocal_fc.f90
+++ b/m4/aclocal_fc.f90
@@ -151,6 +151,7 @@ PROGRAM FC_AVAIL_KINDS
WRITE(8,'(I0)') max_decimal_prec
WRITE(8,'(I0)') num_ikinds
WRITE(8,'(I0)') num_rkinds
+ CLOSE(8)
END PROGRAM FC_AVAIL_KINDS
!---- END ----- Determine the available KINDs for REALs and INTEGERs
--
2.32.0

View file

@ -162,6 +162,14 @@ class Hdf5(CMakePackage):
patch('fortran-kinds.patch', when='@1.10.7')
# This patch may only be needed with GCC11.2 on macOS, but it's valid for
# any of the head HDF5 versions as of 12/2021. Since it's impossible to
# tell what Fortran version is part of a mixed apple-clang toolchain on
# macOS (which is the norm), and this might be an issue for other compilers
# as well, we just apply it to all platforms.
# See https://github.com/HDFGroup/hdf5/issues/1157
patch('fortran-kinds-2.patch', when='@1.10.8,1.12.1')
# The argument 'buf_size' of the C function 'h5fget_file_image_c' is
# declared as intent(in) though it is modified by the invocation. As a
# result, aggressive compilers such as Fujitsu's may do a wrong

View file

@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import sys
class Libzmq(AutotoolsPackage):
@ -37,7 +37,7 @@ class Libzmq(AutotoolsPackage):
variant("docs", default=True,
description="Build documentation")
variant("libbsd", default=True,
variant("libbsd", when='@4.3.3:', default=(sys.platform != 'darwin'),
description="Use strlcpy from libbsd " +
"(will use own implementation if false)")
@ -51,8 +51,7 @@ class Libzmq(AutotoolsPackage):
depends_on('docbook-xml', type='build', when='+docs')
depends_on('docbook-xsl', type='build', when='+docs')
depends_on('libbsd', when='@4.3.3: platform=linux +libbsd')
depends_on('libbsd', when='@4.3.3: platform=cray +libbsd')
depends_on('libbsd', when='+libbsd')
conflicts('%gcc@8:', when='@:4.2.2')

View file

@ -18,4 +18,5 @@ class PySphinxArgparse(PythonPackage):
depends_on('python@2.7.0:2.7,3.5:', type=('build', 'run'))
depends_on('py-sphinx@1.2.0:', type=('build', 'run'))
depends_on('py-poetry-core', type='build')
depends_on('py-setuptools', type='build')

View file

@ -528,7 +528,6 @@ def define_enable(suffix, value=None):
define_trilinos_enable('TrilinosCouplings'),
define_trilinos_enable('Zoltan'),
define_trilinos_enable('Zoltan2'),
define_tpl_enable('Cholmod', False),
define_from_variant('EpetraExt_BUILD_BTF', 'epetraextbtf'),
define_from_variant('EpetraExt_BUILD_EXPERIMENTAL',
'epetraextexperimental'),
@ -688,6 +687,13 @@ def define_tpl(trilinos_name, spack_name, have_dep):
define('PNetCDF_ROOT', spec['parallel-netcdf'].prefix),
])
options.append(define_tpl_enable('Cholmod', False))
if spec.satisfies('platform=darwin'):
# Don't let TriBITS define `libdl` as an absolute path to
# the MacOSX{nn.n}.sdk since that breaks at every xcode update
options.append(define_tpl_enable('DLlib', False))
# ################# Explicit template instantiation #################
complex_s = spec.variants['complex'].value