Description
Building O2 on riscv64 works, but I need a few workarounds in our alidist recipe. Listing them here so we can maybe fix the causes in O2 and drop the hacks. I can send PRs for the easy ones.
Simple ones, just need a riscv64 branch added:
-
Framework/Foundation/3rdparty/x9/x9.c errors out on anything that isn't x86 or aarch64. RISC-V has a PAUSE hint we can emit as .4byte 0x0100000F, so adding a riscv64 branch fixes it. This one is vendored third-party, so it could also go upstream instead.
-
In Utilities/rANS/include/rANS/internal/common/defines.h the coder detection only knows x86 and aarch64, so riscv64 hits #error your hardware or compiler settings do not support librans. Adding riscv64 picks the existing scalar Compat coder and builds fine, no SIMD needed.
Ones that probably need a maintainer to decide:
-
In Utilities/rANS/CMakeLists.txt, with BUILD_TESTING=OFF the o2_add_test() call makes no target, but target_compile_options(${TEST_*}) still runs right after and config fails. This isn't riscv64 specific, it happens anywhere with testing off. Probably those lines should only run when the target exists.
-
ROOT on riscv64 has no asimage or opengl, so ROOT::Eve, ROOT::ASImage and ROOT::RGL are missing. That makes EventVisualisation, the MCH Geometry Test, and the ITS EVE macros fail to configure. They're all GUI things not needed for headless running, so right now I just skip those dirs. Is there a clean way to guard them on the ROOT GUI targets being available?
Skipping those dirs then makes cmake/O2ReportNonTestedMacros.cmake fatal because their macros aren't tested anymore. I get around it by demoting the check. Would be nicer if it could ignore dirs that are turned off on purpose for a given arch or build.
Env: riscv64, Ubuntu 26.04, GCC 15, O2 daily-20260309-0000
Activity
Add riscv64 support in x9 and rANS (#15669)
Mahsuba commentedon Oct 5, 2026
@ktf Reopening this ahead of the RISC-V org meeting this month, should get some pointers on hardware timeline. Items #3 and #4 from the original post are still open (CMakeLists testing issue and ROOT GUI dirs skip on riscv64).
ktf commentedon Oct 5, 2026
https://github.com/AliceO2Group/AliceO2/pull/15899/changes fixes 3. for 4, we should converge with alisw/alidist#6332 first.