Skip to content

Commit e73397f

Browse files
authored
Fix installation on Apple Silicon and older Python versions (#444)
1 parent 739f782 commit e73397f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Support for Python 3.6 and earlier is now deprecated
1717
- Moved package metadata into pyproject.toml
1818

19+
### Fixed
20+
21+
- Fixed installation on Apple Silicon with older Python versions (< 3.9)
22+
1923
### Repository
2024

2125
- Update `docker/setup-qemu-action` GitHub action to v2

setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,17 @@ def _configure_intrinsics(self):
523523
'/arch:AVX',
524524
]
525525

526+
if int(os.environ.get('PROJECTQ_NOINTRIN', '0')) or (
527+
sys.platform == 'darwin'
528+
and platform.machine() == 'arm64'
529+
and (sys.version_info.major == 3 and sys.version_info.minor < 9)
530+
):
531+
important_msgs(
532+
'Either requested no-intrinsics or detected potentially unsupported Python version on '
533+
'Apple Silicon: disabling intrinsics'
534+
)
535+
self.compiler.define_macro('NOINTRIN')
536+
return
526537
if os.environ.get('PROJECTQ_DISABLE_ARCH_NATIVE'):
527538
flags = flags[1:]
528539

0 commit comments

Comments
 (0)