spack: ARM compilers do not generate SVE code on a64fx
The default behavior of ARM compilers (I tested 20.3 and the latest 21.0) is not to generate SVE code, even on A64fx platforms. The -march=armv8.2a+sve flag is required in order to generate SVE code.
This is arguably an ARM bug/feature, and a manual workaround is to
export SPACK_CFLAGS=-march=armv8.2a+sve
and friends.
That being said, I believe spack can improve this and automatically set this flag (unless the -march flag is already set by the user/recipe) when building on a SVE capable platform such as a64fx.
I guess a first step would be to have spack
export SPACK_ARCH=$(spack arch)
or something similar, and enhance the spack compiler wrappers to set the -march flag when needed.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (14 by maintainers)
Commits related to this issue
- Update archspec to support arm compiler on a64fx fixes #24441 — committed to alalazo/spack by alalazo 5 years ago
I just issued the PR archspec/archspec-json#33
Sure, here it is
fwiw, here is my recipe
No problem, I used
straceto confirm the flags was not passed to thearmclangspack wrapper, nor the “real”armclangcompiler. Also, my test failed since it#include <arm_sve.h>, and can only work if-march=armv8...+sveis passed@alalazo I confirm
-march=armv8.2a+sveworks for the three compilersarmclang,armclang++andarmflang