Skip to content

Commit c295c14

Browse files
authored
Merge pull request #5139 from Thyre/llvm-toolchain-aarch64-native
switch native flag from `-march=native` to `-mcpu=native` for LLVM compilers on Arm 64-bit (aarch64)
2 parents 1f38202 + 468c7fb commit c295c14

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

easybuild/toolchains/compiler/llvm_compilers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ class LLVMCompilers(Compiler):
143143
# used when 'optarch' toolchain option is enabled (and --optarch is not specified)
144144
COMPILER_OPTIMAL_ARCHITECTURE_OPTION = {
145145
**(Compiler.COMPILER_OPTIMAL_ARCHITECTURE_OPTION or {}),
146-
(systemtools.AARCH64, systemtools.ARM): '-march=native',
146+
# -mcpu=native is recommended way to specify feature set for aarch64, see:
147+
# https://github.com/easybuilders/easybuild-framework/pull/5139#issuecomment-3961654073 and
148+
# https://developer.arm.com/community/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu
149+
(systemtools.AARCH64, systemtools.ARM): '-mcpu=native',
147150
(systemtools.POWER, systemtools.POWER): '-mcpu=native', # no support for march=native on POWER
148151
(systemtools.POWER, systemtools.POWER_LE): '-mcpu=native', # no support for march=native on POWER
149152
(systemtools.X86_64, systemtools.AMD): '-march=native',

0 commit comments

Comments
 (0)