Compiling Ph2_ACF on ARM Architecture
When attempting to compile Ph2_ACF on an ARM machine (such as a the docker-aarch64
runner #25760 in this job) an error occurs when Building CXX object Utils/CMakeFiles/Ph2_Utils.dir/CRCCalculator.cc.o
.
The error -
/home/cmsTkUser/Ph2_ACF/Utils/CRCCalculator.cc: In constructor 'CRCCalculator::CRCCalculator()':
/home/cmsTkUser/Ph2_ACF/Utils/CRCCalculator.cc:68:5: error: unknown register name '%edx' in 'asm'
68 | asm volatile("cpuid" : "=c"(ecx) : "a"(eax) : "%ebx", "%edx");
| ^~~
/home/cmsTkUser/Ph2_ACF/Utils/CRCCalculator.cc:68:5: error: unknown register name '%ebx' in 'asm'
make[2]: *** [Utils/CMakeFiles/Ph2_Utils.dir/build.make:104: Utils/CMakeFiles/Ph2_Utils.dir/CRCCalculator.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2697: Utils/CMakeFiles/Ph2_Utils.dir/all] Error 2
The issue is particularly with the register names (edx, ebx, etc...). These do not exist in ARM architecture. The purpose of this code (CRCCalculator) seems to be to verify that the CPU supports PCLMULQDQ and SSE42. These are instructions sets for x86 architecture CPUs and thus do not exist on ARM CPUs. Though, there does seem to be similar instruction sets like pmull which appears to be like PCLMULQDQ.
A similar error will likely appear in crc32.cc as it has similar code.
Since Ph2_ACF will ultimately need to support ARM, can we have support added for ARM architecture? Possibly we can have these functions return false if the CPU is ARM?