Open tom91136 opened 1 month ago
Dear Tom,
First, really appreciate your input, which is extremely insightful and helpful. To properly acknowledge you, would you mind opening a PR and fix it? I will merge it so some proper credits can be given to you.
Once again, thanks a lot for sharing your expertise.
Kaiguang
While installing this package on a AArch64 Linux machine, I got the following error at link time:
What happened was that the following function uses the compiler built-in
__builtin_readcyclecounter
: https://github.com/zhaokg/Rbeast/blob/master/R/src/abc_timer.h#L101__builtin_readcyclecounter
is not implemented in GCC when targeting AArch64, but Clang does so M1 Mac linked OK.I propose we handle the
cpu_ARM64
case following the patch to a similar issue that resolved it for MariaDB: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=216668&action=diffEssentially they check if the built-in exists and if not fallback to inline ASM, and since we know it's AArch64, it should be relatively safe. I'm happy to open a PR to fix this.