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 :
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 :
| 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 (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