ROOT on Linux ARM

Hello, I am running Ubuntu 22 on a Window machine (using WSL1… cannot go with WSL2)

I am facing an issue I wasn’t able to tackle…

[ 74%] Generating G__RIO.cxx, ../../lib/libRIO.rootmap
Consolidate compiler generated dependencies of target cppyy2_7
Consolidate compiler generated dependencies of target cppyy3_10
In file included from <built-in>:418:
<command line>:1:9: error: macro name must be an identifier
#define -compilerI/usr/include/c++/11 1
        ^
In file included from input_line_3:2:
In file included from /home/marcomeyer/Software/root/6.26.06-build/include/Rtypes.h:23:
In file included from /home/marcomeyer/Software/root/6.26.06-build/include/RtypesCore.h:28:
In file included from /usr/include/c++/11/cstddef:50:
/home/marcomeyer/Software/root/6.26.06-build/etc/cling/lib/clang/9.0.1/include/stddef.h:35:9: error: unknown type name '__PTRDIFF_TYPE__'
typedef __PTRDIFF_TYPE__ ptrdiff_t;
        ^
/home/marcomeyer/Software/root/6.26.06-build/etc/cling/lib/clang/9.0.1/include/stddef.h:46:9: error: unknown type name '__SIZE_TYPE__'
typedef __SIZE_TYPE__ size_t;
        ^
/home/marcomeyer/Software/root/6.26.06-build/etc/cling/lib/clang/9.0.1/include/stddef.h:74:9: error: unknown type name '__WCHAR_TYPE__'
typedef __WCHAR_TYPE__ wchar_t;
        ^
In file included from input_line_3:2:
In file included from /home/marcomeyer/Software/root/6.26.06-build/include/Rtypes.h:28:
In file included from /home/marcomeyer/Software/root/6.26.06-build/include/strtok.h:6:
/usr/include/c++/11/cstring:75:1: error: unknown type name '_GLIBCXX_BEGIN_NAMESPACE_VERSION'
_GLIBCXX_BEGIN_NAMESPACE_VERSION
^
/usr/include/c++/11/cstring:77:3: error: expected unqualified-id
  using ::memchr;
  ^
/usr/include/c++/11/cstring:122:1: error: unknown type name '_GLIBCXX_END_NAMESPACE_VERSION'
_GLIBCXX_END_NAMESPACE_VERSION
^
/usr/include/c++/11/cstring:123:1: error: expected unqualified-id
} // namespace
^

Would you have an idea how to fix this ?
Sadly there is no ARM precompiled root :frowning:

marcomeyer@ubuntu:~/Software/root/6.26.06-build$ cmake ../6.26.06-src -DCMAKE_INSTALL_PREFIX=$SOFTWARE/root/6.26.06
-- Detected ROOT_VERSION 6.26.06
-- Checking internet connectivity...
-- Yes
-- Looking for Python
-- Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version "3.10.4")
-- Could NOT find Python2 (missing: Python2_NumPy_INCLUDE_DIRS NumPy) (found version "2.7.18")
-- Found GCC. Major version 11, minor version 2
-- ROOT Platform: linux
-- ROOT Compiler: GNU 11.2.0
-- ROOT Processor: aarch64
-- ROOT Architecture: linuxarm64
-- Build Type: 'Release' (flags = '-O3 -DNDEBUG')
-- Compiler Flags:  -std=c++17 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
-- ROOT default compression algorithm: zlib
-- PyROOT will be built for versions 3.10.4 (Main) and 2.7.18
-- Looking for ZLib
-- Looking for nlohmann/json.hpp
-- Found nlohmann/json.hpp in /home/marcomeyer/Software/nlohmann/3.11.1/include;/home/marcomeyer/Software/nlohmann/3.11.1/include (found version 3.11.1)
-- Looking for Freetype
CMake Warning (dev) at /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  builtins/pcre/CMakeLists.txt:37 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Building LZMA version 5.2.4 included in ROOT itself
CMake Warning (dev) at /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  cmake/modules/SearchInstalledSoftware.cmake:252 (ExternalProject_Add)
  CMakeLists.txt:245 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for ZSTD
-- Looking for X11
-- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR)
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Building AfterImage library included in ROOT itself
-- Looking for GSL
-- Looking for OpenGL
-- Looking for GLEW
-- Looking for LibXml2
-- Looking for MySQL
-- Looking for FFTW3
-- Downloading and building XROOTD version 5.4.3
CMake Warning (dev) at /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  builtins/xrootd/CMakeLists.txt:34 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  cmake/modules/SearchInstalledSoftware.cmake:1352 (ExternalProject_Add)
  CMakeLists.txt:245 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  cmake/modules/SearchInstalledSoftware.cmake:1608 (ExternalProject_Add)
  CMakeLists.txt:245 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Cannot select cudnn without selecting cuda or tmva-gpu. Option is ignored
-- Looking for BLAS for optional parts of TMVA
-- Could NOT find BLAS (missing: BLAS_LIBRARIES)
-- Using GSL CBLAS for optional parts of TMVA
CMake Warning (dev) at /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /home/marcomeyer/Software/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  cmake/modules/SearchInstalledSoftware.cmake:2066 (ExternalProject_Add)
  CMakeLists.txt:245 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Building LLVM in 'Release' mode.
-- Native target architecture is AArch64
-- Threads disabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- OCaml bindings disabled.
-- LLVM host triple: aarch64-unknown-linux-gnu
-- LLVM default target triple: aarch64-unknown-linux-gnu
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Linker detection: GNU ld
-- Targeting AArch64
-- Targeting NVPTX
-- Clang version: 9.0.1
-- Cling version (from VERSION file): ROOT_1.0~dev
-- Cling will look for C++ headers in '/usr/include/c++/11:/usr/include/aarch64-linux-gnu/c++/11:/usr/include/c++/11/backward' at runtime.
-- And then fallback to: 'aarch64-linux-gnu-g++-11'
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Success
-- Performing Test found_stod_stringview
-- Performing Test found_stod_stringview - Failed
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Success
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Success
-- Performing Test found_stdindexsequence
-- Performing Test found_stdindexsequence - Success
-- ROOT Configuration

System          Linux-4.4.0-22000-Microsoft
Processor       1 core 0 MHz Unknown family (aarch64)
Build type      Release
Install path    /home/marcomeyer/Software/root/6.26.06
Compiler        GNU 11.2.0
Compiler flags:
C                -Wno-implicit-fallthrough -pipe -Wall -W -pthread -O3 -DNDEBUG
C++              -std=c++17 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
Linker flags:
Executable       -rdynamic
Module
Shared           -Wl,--no-undefined -Wl,--hash-style="both"

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_ftgl builtin_gl2ps builtin_llvm builtin_lz4 builtin_lzma builtin_openui5 builtin_pcre builtin_tbb builtin_vdt builtin_xrootd builtin_xxhash clad dataframe exceptions fftw3 gdml http imt mathmore mlp minuit2 mysql opengl pyroot roofit webgui root7 rpath shared ssl tmva tmva-cpu spectrum vdt x11 xml xrootd
-- Configuring done
-- Generating done
-- Build files have been written to: /home/marcomeyer/Software/root/6.26.06-build

depending on what you want to do, groot (a Go-based implementation of R/W ROOT files) may help.
(as it’s a pure Go package, it is easily cross-compiled to a bunch of architectures and OSes)

and, “even if” it’s written in Go, groot can be faster than ROOT to read ROOT data:

Hi @meyerma ,

we have built ROOT on ARM before, it should work.

<command line>:1:9: error: macro name must be an identifier
#define -compilerI/usr/include/c++/11 1

That looks really weird, I can’t find any matches in the ROOT sources or in my build directory. Are you maybe mixing WSL and Windows compilers or environments?

Cheers,
Enrico

This is my code passing the compiler’s includes to rootcling - I don’t see how this can end up in a preprocessor #define.

It could be that the rootcling that’s invoked here isn’t the one from the build - but that would be terrible! Can you - after you see the error for the first time - execute make VERBOSE=1 again and post the output, please?

Hi, I am sorry I had to go on and I gave up installing ROOT on Linux ARM.
I may try again this week. And let you know the outcome and details

I just found some time to try installing ROOT from scratch (new Ubuntu WSL build).

I don’t get any error message as I shown before, but… anothers.
Using WSL 1, it happens that Window sometimes crashes because this is not loading a pure linux kernel.

So I cannot reproduce it anymore, but somehow I think this was related to unsuccessful prior package setup that ended up badly… Anyhow, for those who try to use WSL 1, please just switch to WSL 2 if you can.

1 Like

For the record, the problem was likely similar to:

On the surface the issue is that cmake produce rootcling command line for G__RIO.cxx which contains:

-writeEmptyRootPCM -D -compilerI/Application

Note the -D followed by nothing.

We noted this problem with a Spack build which is building ROOT with no builtin.

The one option on the cmake command line that triggered the problem is:

 -DCMAKE_PREFIX_PATH:STRING="....//nlohmann-json-3.11.2-rasey7y53ec7uab3r6dhiktct52doyti"

Inside nlohmann the line of nlohmann_jsonTargets.cmake that caused the problem is:

  INTERFACE_COMPILE_DEFINITIONS "\$<\$<NOT:\$<BOOL:ON>>:JSON_USE_GLOBAL_UDLS=0>;\$<\$<NOT:\$<BOOL:ON>>:JSON_USE_IMPLICIT_CONVERSIONS=0>;\$<\$<BOOL:OFF>:JSON_DISABLE_ENUM_SERIALIZATION=1>;\$<\$<BOOL:OFF>:JSON_DIAGNOSTICS=1>;\$<\$<BOOL:OFF>:JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON=1>"

This information is used in ROOT in ROOT_GENERATE_DICTIONARY:

set(module_defs $<TARGET_PROPERTY:${ARG_MODULE},COMPILE_DEFINITIONS>)
...
${definitions} "$<$<BOOL:${module_defs}>:-D$<JOIN:${module_defs},;-D>>"

Experimentally having INTERFACE_COMPILE_DEFINITIONS contains a single value:

  "SOMETHING"

or a value plus one or more ‘empty’ generator expressions:

  "SOMETHING;\$<\$<NOT:\$<BOOL:ON>>:JSON_USE_GLOBAL_UDLS=0>"

or a single ‘empy’ generator expressions:

  "\$<\$<NOT:\$<BOOL:ON>>:JSON_USE_GLOBAL_UDLS=0>"

However if INTERFACE_COMPILE_DEFINITIONS contains 2 or more ‘empty’ generator
expressions and no other values:

  "\$<\$<NOT:\$<BOOL:ON>>:JSON_USE_GLOBAL_UDLS=0>;\$<\$<NOT:\$<BOOL:ON>>:JSON_USE_IMPLICIT_CONVERSIONS=0>;\$<\$<BOOL:OFF>:JSON_DISABLE_ENUM_SERIALIZATION=1>;\$<\$<BOOL:OFF>:JSON_DIAGNOSTICS=1>;\$<\$<BOOL:OFF>:JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON=1>"

It also appears to works if you don’t quote the expressions:

   $<$<NOT:$<BOOL:ON>>:JSON_USE_GLOBAL_UDLS=0> $<$<NOT:$<BOOL:ON>>:JSON_USE_IMPLICIT_CONVERSIONS=0>    ..

However since those lines of cmake are generated by CMake as part of the install,
we have to deal with the way they are.CMake

It is fixed on the ROOT side with:

commit 08ab7e03061e551647d707637957252d121f9c39 (HEAD)
Author: Jonas Rembser <jonas.rembser@cern.ch>
Date:   Tue Sep 21 15:15:17 2021 +0200

    [cmake] Protect against empty `COMPILE_DEFINITIONS` in rootcint command

but it should be applied also to REFLEX_GENERATE_DICTIONARY:

diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake
index a19ee4e363..22816fdc8e 100644
--- a/cmake/modules/RootMacros.cmake
+++ b/cmake/modules/RootMacros.cmake
@@ -174,12 +174,16 @@ function(REFLEX_GENERATE_DICTIONARY dictionary)

   get_directory_property(defs COMPILE_DEFINITIONS)
   foreach( d ${defs})
+   # Note: should we check for empty definitions here?
    list(APPEND definitions ${d})
   endforeach()

   IF(TARGET ${dictionary})
     LIST(APPEND include_dirs $<TARGET_PROPERTY:${dictionary},INCLUDE_DIRECTORIES>)
-    LIST(APPEND definitions $<TARGET_PROPERTY:${dictionary},COMPILE_DEFINITIONS>)
+    # The COMPILE_DEFINITIONS list might contain empty elements. These are
+    # removed with the FILTER generator expression, excluding elements that
+    # match the ^$ regexp (only matches empty strings).
+    LIST(APPEND definitions "$<FILTER:$<TARGET_PROPERTY:${ARG_MODULE},COMPILE_DEFINITIONS>,EXCLUDE,^$>")
   ENDIF()

   add_custom_command(

Additional notes:

  • nlohmann_json v3.9 only had one COMPILE_DEFINITIONS so it was working
  • nlohmann_json v3.10.5 had two COMPILE_DEFINITIONS but one of them defaulted to ON
  • nlohmann_json v3.11.0 increase to 5 BUT more importantly they are now ALL off
    the option that default to ON still default to on but now lead to a define only when OFF

So ROOT without Jonas patch should be working with v3.10.5 and older but not with
v3.11.0 and newer.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.