Skip to content

Commit 045003a

Browse files
authored
Added Apple M4 (#23)
* Added Apple M4 * Set PSYDAC_BACKEND_GPYCCEL with lower + replace (should work for any M-version)
1 parent 89fcf8f commit 045003a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

psydac/api/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
# Apple silicon requires architecture-specific flags (see https://github.com/pyccel/psydac/pull/411)
5555
# which are only available on GCC version >= 14
5656
cpu_brand = subprocess.check_output(['sysctl','-n','machdep.cpu.brand_string']).decode('utf-8') # nosec B603, B607
57-
if "Apple M1" in cpu_brand: PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mcpu=apple-m1'
58-
elif "Apple M2" in cpu_brand: PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mcpu=apple-m2'
59-
elif "Apple M3" in cpu_brand: PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mcpu=apple-m3'
57+
if "Apple M" in cpu_brand:
58+
# Example: Apple M1 --> apple-m1
59+
PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mcpu=' + cpu_brand.lower().replace(" ","-")
6060
else:
6161
# TODO: Support later Apple CPU models. Perhaps the CPU naming scheme could be easily guessed
6262
# based on the output of 'sysctl -n machdep.cpu.brand_string', but I wouldn't rely on this

0 commit comments

Comments
 (0)