From dc8dd74edfc1acad1152af875fa969e3b957e946 Mon Sep 17 00:00:00 2001 From: Simon Foreman Date: Tue, 26 Jul 2022 22:24:18 -0700 Subject: [PATCH 1/2] Look for gcc in homebrew directory on macOS --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 50d3f127..4c3f0dc0 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,12 @@ sp.check_call('scripts/osx.sh', shell=True) except sp.CalledProcessError: raise DistutilsError('Failed to prepare Mac OS X properly. See earlier errors.') + # Try to find gcc in /usr/local/bin/ (which is where it's installed by homebrew on + # Intel) or, if that fails, /opt/homebrew/bin/ (which is where it's installed by + # homebrew on Silicon) gccpath = glob.glob('/usr/local/bin/gcc-*') + if not gccpath: + gccpath = glob.glob('/opt/homebrew/bin/gcc-*') if gccpath: # Use newest gcc found sint = lambda x: int(x) if x.isdigit() else 0 @@ -249,4 +254,3 @@ def run(self): ) print('\n[setup.py request was successful.]') - From 7cd80710a1def80285810f80cea1a6cd8f46f80e Mon Sep 17 00:00:00 2001 From: Simon Foreman Date: Tue, 26 Jul 2022 22:25:56 -0700 Subject: [PATCH 2/2] Disable inclusion of immintrin.h Including this file causes problems on Apple Silicon, since it implements x86 instructions that are not available on Silicon. --- cython/sharp_utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cython/sharp_utils.c b/cython/sharp_utils.c index 69af7389..8aa1d063 100644 --- a/cython/sharp_utils.c +++ b/cython/sharp_utils.c @@ -1,5 +1,7 @@ #include "sharp_utils.h" +#if 0 #include +#endif #include #include #include