Add/remove conflicts for Apple silicon (M1/aarch64) (#28850)

* go: remove broken bootstrapping for macos aarch64

* qt: mark apple silicon conflict

* trilinos: remove apple silicon conflict

* Apply review suggestions

* python: add apple silicon conflict for 2.7
This commit is contained in:
Seth R. Johnson 2022-02-18 23:56:32 -05:00 committed by GitHub
parent e886a61a6c
commit f33770553f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 11 deletions

View file

@ -35,6 +35,9 @@ class GoBootstrap(Package):
depends_on('git', type=('build', 'link', 'run'))
conflicts('target=aarch64:', when='platform=darwin',
msg='Go bootstrap is too old for Apple Silicon')
def patch(self):
if self.spec.satisfies('@:1.4.3'):
# NOTE: Older versions of Go attempt to download external files that have

View file

@ -4,7 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import platform
import re
import llnl.util.tty as tty
@ -128,12 +127,7 @@ class Go(Package):
provides('golang')
depends_on('git', type=('build', 'link', 'run'))
# TODO: Make non-c self-hosting compilers feasible without backflips
# should be a dep on external go compiler
if platform.machine() == 'aarch64':
depends_on('gcc languages=go', type='build')
else:
depends_on('go-bootstrap', type='build')
depends_on('go-bootstrap', type='build')
# https://github.com/golang/go/issues/17545
patch('time_test.patch', when='@1.6.4:1.7.4')

View file

@ -253,6 +253,9 @@ class Python(AutotoolsPackage):
conflicts('%nvhpc')
conflicts('@:2.7', when='platform=darwin target=aarch64:',
msg='Python 2.7 is too old for Apple Silicon')
# Used to cache various attributes that are expensive to compute
_config_vars = {}

View file

@ -255,6 +255,8 @@ class Qt(Package):
else:
conflicts('platform=darwin', when='@:4.8.6',
msg="QT 4 for macOS is only patched for 4.8.7")
conflicts('target=aarch64:', when='@:5.15.3',
msg='Apple Silicon requires a very new version of qt')
use_xcode = True
@ -267,7 +269,7 @@ class Qt(Package):
def url_for_version(self, version):
# URL keeps getting more complicated with every release
url = self.list_url.replace('http:', 'https:')
url = self.list_url
if version < Version('5.12') and version.up_to(2) != Version('5.9'):
# As of 28 April 2021:
@ -721,6 +723,12 @@ def configure(self, spec, prefix):
'-no-alsa',
])
if spec.satisfies('platform=darwin target=aarch64:'):
# https://www.qt.io/blog/qt-on-apple-silicon
# Not currently working for qt@5
config_args.extend(['-device-option',
'QMAKE_APPLE_DEVICE_ARCHS=arm64'])
configure(*config_args)
def build(self, spec, prefix):

View file

@ -294,9 +294,6 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage):
conflicts('+stokhos', when='%xl')
conflicts('+stokhos', when='%xl_r')
# Fortran mangling fails on Apple M1 (see spack/spack#25900)
conflicts('@:13.0.1 +fortran', when='target=m1')
# ###################### Dependencies ##########################
depends_on('adios2', when='+adios2')