# Compiling ROOT 6.24 for ARM (Zynq Ultrascale+)

**URL:** <https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201>\
**Category:** ROOT\
**Created:** [June 1, 2021, 4:32pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201 "2021-06-01T16:32:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathieubenoit](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@mathieubenoit](https://root-forum.cern.ch/u/mathieubenoit)\
**Post date:** [June 1, 2021, 4:32pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/1 "2021-06-01T16:32:12Z")

</div>

Dear ROOTers,

I have been trying to write a recipe to compile ROOT for the Zynq Ultrascale+ processor (ARM64). The idea is to provide this recipe to people building and OS for their SoC so that root is compiled along the OS and deployed in the image. This would be EXTREMELY useful for many ATLAS projects and beyond.

I use the petalinux tools from Xilinx to generate the OS image, and I provide the recipe to cross-compile ROOT on the host PC for the target architecture. My recipe goes as follow :

```auto
SUMMARY = "Numerical data analysis framework (OO)"
DESCRIPTION = "Object oriented framework for large scale data analysis"
HOMEPAGE = "http://root.cern.ch"
LICENSE = "LGPLv2.1"
PV = "6.24.00"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5ec773ab82cbea1f17ec5b98e8ce60cf"
SRC_URI = "https://root.cern.ch/download/root_v${PV}.source.tar.gz"

S = "${WORKDIR}/${BPN}-${PV}"

inherit cmake pkgconfig clang

TOOLCHAIN = "clang"

DEPENDS += "cmake llvm-native clang-native llvm-native libx11 libxpm libxft libxext libgcc glibc packagegroup-core-buildessential python python3 dpkg binutils gcc gcc-runtime \
autoconf automake ccache chkconfig glib-networking glibmm \
packagegroup-core-buildessential pkgconfig \
boost cmake zlib glib-2.0 "
SECURITY_STRINGFORMAT = ""

do_configure_prepend(){
	export FC=${GFORTRAN}
}

# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = "\
    -Drootfit=ON \
    -Dminuit2=ON \
    -Dssl=ON \
    -Dbuiltin_freetype=OFF \
    -Dbuiltin_llvm=ON \
    -Dbuiltin_clang=OFF \
    -Dbuiltin_cling=ON \
    -DCMAKE_CXX_STANDARD=14\
    -DCMAKE_CXX_STANDARD_REQUIRED=ON\
    -DPYTHON_EXECUTABLE=python3\
"

SRC_URI[md5sum] = "d3d63eb2b3dc41ff392de66090a6859a"
SRC_URI[sha256sum] = "9da30548a289211c3122d47dacb07e85d35e61067fac2be6c5a5ff7bda979989"

```

From this recipe, the OS building tool (bitbake) download the source code and all the dependencies listed, and attempt to configure and build for the target system. This seems to work OK, but I am having a lot of trouble getting the configuration to finish. I must admit this is a bit over my head!

In this case I provide clang as toolchain for ROOT, but it seems there is a parameter related to the processor that is not understood by clang :

```auto
| Run Build Command(s):ninja cmTC_401eb && [1/2] Building C object CMakeFiles/cmTC_401eb.dir/testCCompiler.c.o
| FAILED: CMakeFiles/cmTC_401eb.dir/testCCompiler.c.o
| /home/mbenoit/projects/Mercury_XU1_ST1_Reference_Design/FETB2-OS/build/tmp/work/aarch64-xilinx-linux/root/6.24.00-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-clang -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -mlittle-endian -Wno-error=unused-command-line-argument -Qunused-arguments -fstack-protector-strong -D_FORTIFY_SOURCE=2 --sysroot=/home/mbenoit/projects/Mercury_XU1_ST1_Reference_Design/FETB2-OS/build/tmp/work/aarch64-xilinx-linux/root/6.24.00-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/mbenoit/projects/Mercury_XU1_ST1_Reference_Design/FETB2-OS/build/tmp/work/aarch64-xilinx-linux/root/6.24.00-r0=/usr/src/debug/root/6.24.00-r0 -fdebug-prefix-map=/home/mbenoit/projects/Mercury_XU1_ST1_Reference_Design/FETB2-OS/build/tmp/work/aarch64-xilinx-linux/root/6.24.00-r0=/usr/src/debug/root/6.24.00-r0 -fdebug-prefix-map=/home/mbenoit/projects/Mercury_XU1_ST1_Reference_Design/FETB2-OS/build/tmp/work/aarch64-xilinx-linux/root/6.24.00-r0/recipe-sysroot= -fdebug-prefix-map=/home/mbenoit/projects/Mercury_XU1_ST1_Reference_Design/FETB2-OS/build/tmp/work/aarch64-xilinx-linux/root/6.24.00-r0/recipe-sysroot-native= -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -mlittle-endian -Wno-error=unused-command-line-argument -Qunused-arguments -fstack-protector-strong -D_FORTIFY_SOURCE=2 --sysroot=/home/mbenoit/projects/Mercury_XU1_ST1_Reference_Design/FETB2-OS/build/tmp/work/aarch64-xilinx-linux/root/6.24.00-r0/recipe-sysroot -o CMakeFiles/cmTC_401eb.dir/testCCompiler.c.o -c testCCompiler.c
| clang-9: error: the clang compiler does not support '-mtune=cortex-a72.cortex-a53'
| ninja: build stopped: subcommand failed.

```

I attached the full CMake output and error log. Is there a way to suppress this option ?

* * *

If, instead, I ask clang to be builtin with -Dbuiltin\_clang=ON , and provide gcc as toolchain, I get a different error during LLVMBuild part of configuration, but I cannot really indentify the issue. I attached the output of CMake in this case.

## [ROOT6\_ARM\_LOGs.zip](https://root-forum.cern.ch/uploads/short-url/hxbkoeJpg36t3ifZxLoNmqwF0l7.zip) (16.5 KB)

I am not sure how to proceed next, so I would appreciate a better trained eye or advice on how to proceed. If you are aware of other user doing the same compilation for Xilinx SoC, I would certainly also be interested in hearing from them. I know this is not the typical way to compile root, so bear with me …

Thanks a lot in advance for any insight or info,

Mathieu

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [June 2, 2021, 2:30pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/2 "2021-06-02T14:30:45Z")

</div>

@mathieubenoit thank you so much trying to build ROOT with such an interesting build combination! (cc @axel)

> [@mathieubenoit](#):
>
> ```auto
> -Dbuiltin_llvm=ON \
> -Dbuiltin_clang=OFF \
> -Dbuiltin_cling=ON \
> 
> ```

So about `builtin_llvm` and `builting_clang` we are not using just any version of LLVM and Clang but only LLVM/Clang 9 that should be build with set of ROOT specific patches on the top. So basically in your case all mentioned before option should be on.

About error, it looks like a bug, Cmake thinks that you are using macox ARM64 (?) and running test to check if timers signpost passes in Xcode Instruments, which is definitely not true:

```auto
CheckSymbolExists.c:2:10: fatal error: os/signpost.h: No such file or directory
    2 | #include <os/signpost.h>
      | ^ ~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

```

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [June 2, 2021, 2:35pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/3 "2021-06-02T14:35:48Z")

</div>

Adding @vvassilev in CC as well.  
Vassil, could it be `#include <os/signpost.h>` check is handled somewhere here? [root/HandleLLVMOptions.cmake at master · root-project/root · GitHub](https://github.com/root-project/root/blob/master/interpreter/llvm/src/cmake/modules/HandleLLVMOptions.cmake#L943-L970)

---

<div class="post-metadata">

**Author:** ![mathieubenoit](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@mathieubenoit](https://root-forum.cern.ch/u/mathieubenoit)\
**Post date:** [June 2, 2021, 3:35pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/4 "2021-06-02T15:35:37Z")

</div>

Thanks a lot for having a look! Indeed I saw this in the log, but I was not sure what is a normal failure and what is not. I suspected there was something to do with ROOT for arm macs 🙂 So I will wait for you investigation,

Cheers,

Mathieu

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [June 4, 2021, 8:50am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/5 "2021-06-04T08:50:15Z")

</div>

We don’t have really a place to reproduce your build so it could be a bit hard…

---

<div class="post-metadata">

**Author:** ![mathieubenoit](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@mathieubenoit](https://root-forum.cern.ch/u/mathieubenoit)\
**Post date:** [June 4, 2021, 12:07pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/6 "2021-06-04T12:07:33Z")

</div>

Indeed.

We have a docker image that could be used for that, or I could write instructions to use the xilinx petalinux tool, which is free.

I will have a look.

---

<div class="post-metadata">

**Author:** ![mathieubenoit](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@mathieubenoit](https://root-forum.cern.ch/u/mathieubenoit)\
**Post date:** [June 4, 2021, 8:28pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/7 "2021-06-04T20:28:45Z")

</div>

Hi, so I have created a docker image that can be used to reproduce this issue and test a possible fix.

The image can be found [here](https://gitlab-registry.cern.ch/mbenoit/meta-caribou:latest).

I wrote some instructions on how to use the image and switch between different ROOT commits, that I have put [here](https://gitlab.cern.ch/mbenoit/meta-caribou/-/blob/ROOT-compilation-test/ROOT_instructions.md).

With that it should be possible to test it if you have a place to run docker.

Cheers,

Mathieu

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [June 17, 2021, 9:15am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/8 "2021-06-17T09:15:02Z")

</div>

@mathieubenoit sorry for late reply could you please if the image is still available via the link [https://gitlab-registry.cern.ch/mbenoit/meta-caribou:latest](https://gitlab-registry.cern.ch/mbenoit/meta-caribou:latest) ?

---

<div class="post-metadata">

**Author:** ![mathieubenoit](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@mathieubenoit](https://root-forum.cern.ch/u/mathieubenoit)\
**Post date:** [June 17, 2021, 1:05pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/9 "2021-06-17T13:05:28Z")

</div>

Hi, this is correct, or you can see it here : [Container Registry · Mathieu Benoit / meta-caribou · GitLab](https://gitlab.cern.ch/mbenoit/meta-caribou/container_registry) .

Cheers,

Mathieu

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 21, 2021, 8:11am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/10 "2021-06-21T08:11:23Z")

</div>

Hi Mathieu,

I’ll try to set-up an environment to debug your issue as soon as possible. But since I’m fairly new to CMake, new to Docker, and usually working on Windows, it might take a bit of time. Sorry about that

Cheers, Bertrand.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 21, 2021, 8:59am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/11 "2021-06-21T08:59:41Z")

</div>

So I tried following your instructions and here is what I get:

```auto
[caribou@bbcc7x64 build]$ bitbake root
NOTE: Started PRServer with DBfile: /home/caribou/poky/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 40283, PID: 64
WARNING: Host distribution "centos-8" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Failed to create a file in SSTATE_DIR: Permission denied.
You could try using /sstate-cache in SSTATE_MIRRORS rather than as an SSTATE_CACHE.

Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

```

I set write access to all to the download folder, but it doesn’t change anything…

---

<div class="post-metadata">

**Author:** ![simonspa](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/simonspa/32/17624_2.png) [@simonspa](https://root-forum.cern.ch/u/simonspa)\
**Post date:** [June 21, 2021, 9:32am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/12 "2021-06-21T09:32:12Z")

</div>

Hi @bellenot

are you using @mbenoit 's Docker command?

```auto
docker run -it --net=host -v ${PWD}/downloads:/downloads -v ${PWD}/sstate-cache:/sstate-cache gitlab-registry.cern.ch/mbenoit/meta-caribou bash

```

If yes, then you have to make sure the Docker user has access to the folder `${PWD}/sstate-cache` on the host machine (so on your computer). Here, `${PWD}` is the folder from where you start the docker container. Same holds for `${PWD}/downloads`.

Simon

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 21, 2021, 9:33am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/13 "2021-06-21T09:33:33Z")

</div>

OK, thanks, I’ll try

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 21, 2021, 11:53am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/14 "2021-06-21T11:53:55Z")

</div>

OK, I tried everything, nothing works so far. I’ll try to find out what’s going on and I’ll keep you in touch

---

<div class="post-metadata">

**Author:** ![mathieubenoit](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@mathieubenoit](https://root-forum.cern.ch/u/mathieubenoit)\
**Post date:** [June 21, 2021, 12:17pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/15 "2021-06-21T12:17:34Z")

</div>

Thanks a lot Bertrand for having a look ! Let us know if we can be of any help. This framework is a bit cumbersome indeed …

Cheers,

Mathieu

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [June 21, 2021, 12:36pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/16 "2021-06-21T12:36:18Z")

</div>

(if there is a simpler recipe with just a Dockerfile that still fails in the same way it might make things easier)

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 21, 2021, 12:39pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/17 "2021-06-21T12:39:13Z")

</div>

OK, so the build is ongoing. But looking more carefully at your log, it looks like the main issue is the `-mtune=cortex-a72.cortex-a53` flag not supported by `clang`. So it’s maybe due to the version of `clang` used by ROOT.  
EDIT: Well, maybe not, I’m lost with the informations in the log files. I’ll try to figure out in the docker build itself

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 22, 2021, 5:06am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/18 "2021-06-22T05:06:56Z")

</div>

@mathieubenoit @simonspa OK, so it build, and fails. Now, how (and where) can I run cmake to try to change some options? where is the build directory of ROOT? Where is the source directory of ROOT?

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 23, 2021, 7:41am UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/19 "2021-06-23T07:41:17Z")

</div>

@mathieubenoit @simonspa Any help about my last question?

---

<div class="post-metadata">

**Author:** ![mathieubenoit](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@mathieubenoit](https://root-forum.cern.ch/u/mathieubenoit)\
**Post date:** [June 24, 2021, 1:26pm UTC](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201/20 "2021-06-24T13:26:03Z")

</div>

Hi @bellenot , sorry, got a bit busy.

The easiest way, in the current image you have, is to mount an extra volume with a checkout of root git repo :

```auto
mkir root_src 
cd root_src && git clone git://github.com/root-project/root.git && cd ..
docker run -it --net=host -v ${PWD}/root_src:/root_src -v ${PWD}/downloads:/downloads -v ${PWD}/sstate-cache:/sstate-cache gitlab-registry.cern.ch/mbenoit/meta-caribou bash

```

Then from inside the image, there is a convenient tool call devtool, that you can use to point to bitbake where to pick the source to compile :

```auto
devtool modify -n root /root_src/root

```

```auto
[caribou@docker-desktop build]$ devtool modify -n root /root_src/root
NOTE: Starting bitbake server...
INFO: Creating workspace layer in /home/caribou/poky/build/workspace
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
NOTE: Started PRServer with DBfile: /home/caribou/poky/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 58659, PID: 73
WARNING: Host distribution "centos-8" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |################################################################################################################################################| Time: 0:00:54
Parsing of 2276 .bb files complete (0 cached, 2276 parsed). 3404 targets, 135 skipped, 0 masked, 0 errors.

Summary: There was 1 WARNING message shown.
INFO: Recipe root now set up to build from /root_src/root

```

From now on the local copy of root in root\_src in the host PC will be used to compile.

So when you issue `bitbake root`, it will use this version, that you can modify at will.

The cmake options are defined , inside the image in file at `/home/caribou/poky/meta-caribou/recipes-caribou/root/root_git.bb`

You can modify the EXTRA\_OECMAKE variable there. I know it is not the most convenient.

@simonspa , is there a way to override the EXTRA\_OECMAKE directly from command line, that you know of ?

Would that work for you ?

Cheers,

Mathieu

[Next page](https://root-forum.cern.ch/t/compiling-root-6-24-for-arm-zynq-ultrascale/45201.md?page=2)
