From b618f30f32489987f87152f37522c1085d9abc1b Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Thu, 22 Aug 2024 16:07:45 +0200 Subject: [PATCH 01/30] Merge branch 'ROOT-1' --- R/ROOT/build_tarballs.jl | 147 +++++++++++++ .../patches/rootcling-cross-compile.patch | 197 ++++++++++++++++++ 2 files changed, 344 insertions(+) create mode 100644 R/ROOT/build_tarballs.jl create mode 100644 R/ROOT/bundled/patches/rootcling-cross-compile.patch diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl new file mode 100644 index 00000000000..4382bf14e8e --- /dev/null +++ b/R/ROOT/build_tarballs.jl @@ -0,0 +1,147 @@ +# Note that this script can accept some limited command-line arguments, run +# `julia build_tarballs.jl --help` to see a usage message. +using BinaryBuilder, Pkg + +name = "ROOT" +version = v"6.32.2" + +# Collection of sources required to complete build +sources = [ + ArchiveSource("https://root.cern/download/root_v6.32.02.source.tar.gz", "3d0f76bf05857e1807ccfb2c9e014f525bcb625f94a2370b455f4b164961602d"), + DirectorySource("./bundled") +] + +# Bash recipe for building across all platforms +script = raw""" + +cd $WORKSPACE +install_license srcdir/root-*/LICENSE + +# Release type and C++ standard +CMAKE_FLAGS+=(-DCMAKE_BUILD_TYPE=Release) +CMAKE_FLAGS+=(-DCMAKE_CXX_STANDARD=17) + +# ROOT options to enable/disable +CMAKE_FLAGS+=(-Dgnuinstall=OFF) +CMAKE_FLAGS+=(-Drpath=ON) +CMAKE_FLAGS+=(-Dshared=ON) +CMAKE_FLAGS+=(-Dsoversion=OFF) +CMAKE_FLAGS+=(-Dfail-on-missing=ON) +CMAKE_FLAFS+=(-Dbuiltin_afterimage=ON) +CMAKE_FLAGS+=(-Druntime_cxxmodules=OFF) + +# LLVM tries to run a bunch of configure tests. Tell it what the output would have been. +CMAKE_FLAGS+=(-Dfound_urandom_EXITCODE=0) +CMAKE_FLAGS+=(-Dfound_urandom_EXITCODE__TRYRUN_OUTPUT='') + +export SYSTEM_INCLUDE_PATH= /opt/$MACHTYPE/$MACHTYPE/sys-root/usr/include:/opt/$MACHTYPE/$MACHTYPE/sys-root/usr/local/include +export CPLUS_INCLUDE_PATH=$SYSTEM_INCLUDE_PATH # Needed for the native build (musl) + +#---Build host native rootcling, llvm-tblgen, clang-tblgen for cross-compilation------------------------ +if [ $target != $MACHTYPE ]; then + # Patch the sources to use the native binary for rootcling + (cd srcdir/root-*/ + atomic_patch -p2 ../patches/rootcling-cross-compile.patch + ) + + # Build for the host binary native used in second step build process + mkdir native + cmake -GNinja -DCMAKE_INSTALL_PREFIX=$prefix \ + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_HOST_TOOLCHAIN} \ + -DLLVM_HOST_TRIPLE=$MACHTYPE \ + -DLLVM_DEFAULT_TARGET_TRIPLE=$target \ + -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=OFF \ + -DCMAKE_PREFIX_PATH=$host_prefix \ + -DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath-link,$host_prefix/lib \ + -Dminimal=ON \ + ${CMAKE_FLAGS[@]} \ + -B native -S srcdir/root-*/ + ninja -C native -j${nproc} rootcling_stage1 rootcling llvm-tblgen clang-tblgen llvm-config llvm-symbolizer + + # Add extra options to use the built native binaries + CMAKE_EXTRA_OPTS+=(-DNATIVE_BINARY_DIR=$PWD/native) + CMAKE_EXTRA_OPTS+=(-DLLVM_TABLEGEN=$PWD/native/interpreter/llvm-project/llvm/bin/llvm-tblgen) + CMAKE_EXTRA_OPTS+=(-DCLANG_TABLEGEN=$PWD/native/interpreter/llvm-project/llvm/bin/clang-tblgen) + CMAKE_EXTRA_OPTS+=(-DLLVM_CONFIG_PATH=$PWD/native/interpreter/llvm-project/llvm/bin/llvm-config) + + # Define ROOTCLINGNATIVE to use the native rootcling + export ROOTCLINGNATIVE="env CPLUS_INCLUDE_PATH=${SYSTEM_INCLUDE_PATH} $PWD/native/bin/rootcling" + + # Remove the CPLUS_INCLUDE_PATH environment variable. Was needed for the native build only + unset CPLUS_INCLUDE_PATH +fi + +#---Standard build (cross-compilation)------------------------------------------------------------- +mkdir build +cmake -GNinja \ + -DCMAKE_INSTALL_PREFIX=$prefix \ + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ + ${CMAKE_FLAGS[@]} \ + -Dgminimal=ON \ + ${CMAKE_EXTRA_OPTS[@]} \ + -B build -S srcdir/root-*/ +ninja -C build -j${nproc} install +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = [ + Platform("x86_64", "linux"; libc = "glibc"), + Platform("x86_64", "linux"; libc = "musl"), + # Platform("aarch64", "linux"; libc = "glibc"), + # Platform("armv6l", "linux", libc = "glibc"), + # Platform("armv7l", "linux", libc = "glibc"), + # Platform("powerpc64le", "linux"; libc = "glibc"), + Platform("aarch64", "macos"), + # Platform("x86_64", "macos"), +] |> expand_cxxstring_abis + +# The products that we will ensure are always built +products = [ + LibraryProduct("libCore", :libCore), + LibraryProduct("libCling", :libCling), + ExecutableProduct("root", :root), +] + +# Some dependencies are needed only on Linux and FreeBSD +x11_platforms = filter(p ->Sys.islinux(p) || Sys.isfreebsd(p), platforms) + +# Dependencies that must be installed before this package can be built +dependencies = [ + BuildDependency("Xorg_xorgproto_jll"; platforms=x11_platforms) + HostBuildDependency("Zlib_jll") + HostBuildDependency("Zstd_jll") + HostBuildDependency("Lz4_jll") + HostBuildDependency("nlohmann_json_jll") + HostBuildDependency("FreeType2_jll") + HostBuildDependency("PCRE_jll") + HostBuildDependency("XZ_jll") + HostBuildDependency("xxHash_jll") + Dependency("Zlib_jll") + Dependency("Zstd_jll") + Dependency("Lz4_jll") + Dependency("nlohmann_json_jll") + Dependency("FreeType2_jll") + Dependency("PCRE_jll") + Dependency("XZ_jll") + Dependency("xxHash_jll") + Dependency("OpenSSL_jll"; compat="1.1.10") + Dependency("Xorg_libX11_jll"; platforms=x11_platforms) + Dependency("Xorg_libXpm_jll"; platforms=x11_platforms) + Dependency("Xorg_libXft_jll"; platforms=x11_platforms) + Dependency("Xorg_libICE_jll"; platforms=x11_platforms) + Dependency("Xorg_libSM_jll"; platforms=x11_platforms) + Dependency("Xorg_libXfixes_jll"; platforms=x11_platforms) + Dependency("Xorg_libXi_jll"; platforms=x11_platforms) + Dependency("Xorg_libXinerama_jll"; platforms=x11_platforms) + Dependency("Xorg_libXmu_jll"; platforms=x11_platforms) + Dependency("Xorg_libXt_jll"; platforms=x11_platforms) + Dependency("Xorg_libXtst_jll"; platforms=x11_platforms) + Dependency("Xorg_xcb_util_jll"; platforms=x11_platforms) + Dependency("Xorg_libxkbfile_jll"; platforms=x11_platforms) + #Dependency("libLVM_jll") +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; + preferred_gcc_version=v"11", julia_compat="1.6") diff --git a/R/ROOT/bundled/patches/rootcling-cross-compile.patch b/R/ROOT/bundled/patches/rootcling-cross-compile.patch new file mode 100644 index 00000000000..6e6421d5fa3 --- /dev/null +++ b/R/ROOT/bundled/patches/rootcling-cross-compile.patch @@ -0,0 +1,197 @@ +--- a/root/cmake/modules/RootMacros.cmake 2024-01-31 09:17:06.000000000 +0100 ++++ c/root/cmake/modules/RootMacros.cmake 2024-06-29 18:12:28.081464326 +0200 +@@ -8,6 +8,8 @@ + # RootMacros.cmake + #--------------------------------------------------------------------------------------------------- + ++set(NATIVE_BINARY_DIR FALSE CACHE FILEPATH "Path of native built in case of cross compiling.") ++ + if(WIN32) + set(libprefix lib) + set(ld_library_path PATH) +@@ -603,20 +605,37 @@ + #---what rootcling command to use-------------------------- + if(ARG_STAGE1) + if(MSVC AND CMAKE_ROOTTEST_DICT) +- set(command ${CMAKE_COMMAND} -E ${CMAKE_BINARY_DIR}/bin/rootcling_stage1.exe) ++ if(NATIVE_BINARY_DIR) ++ set(command ${CMAKE_COMMAND} -E ${NATIVE_BINARY_DIR}/bin/rootcling_stage1.exe) ++ else() ++ set(command ${CMAKE_COMMAND} -E ${CMAKE_BINARY_DIR}/bin/rootcling_stage1.exe) ++ endif() + else() +- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $) ++ if(NATIVE_BINARY_DIR) ++ set(command ${CMAKE_COMMAND} -E env "CPLUS_INCLUDE_PATH=$ENV{SYSTEM_INCLUDE_PATH}" "LD_LIBRARY_PATH=${NATIVE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" ${NATIVE_BINARY_DIR}/core/rootcling_stage1/src/rootcling_stage1) ++ else() ++ set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $) ++ endif() + endif() + set(ROOTCINTDEP rconfigure) + set(pcm_name) + else() + if(CMAKE_PROJECT_NAME STREQUAL ROOT) + if(MSVC AND CMAKE_ROOTTEST_DICT) +- set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${CMAKE_BINARY_DIR}/bin/rootcling.exe) ++ if(NATIVE_BINARY_DIR) ++ set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${NATIVE_BINARY_DIR}/bin/rootcling.exe) ++ else() ++ set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${CMAKE_BINARY_DIR}/core/rootcling_stage1/src/rootcling.exe) ++ endif() + else() +- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" +- "ROOTIGNOREPREFIX=1" $ -rootbuild) +- # Modules need RConfigure.h copied into include/. ++ if(NATIVE_BINARY_DIR) ++ set(command ${CMAKE_COMMAND} -E env "CPLUS_INCLUDE_PATH=$ENV{SYSTEM_INCLUDE_PATH}" "LD_LIBRARY_PATH=${NATIVE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" ++ "ROOTIGNOREPREFIX=1" ${NATIVE_BINARY_DIR}/bin/rootcling -rootbuild) ++ else() ++ set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" ++ "ROOTIGNOREPREFIX=1" $ -rootbuild) ++ endif() ++ # Modules need RConfigure.h copied into include/. + set(ROOTCINTDEP rootcling rconfigure) + endif() + elseif(TARGET ROOT::rootcling) + +--- a/root/CMakeLists.txt ++++ b/root/CMakeLists.txt +@@ -547,9 +547,11 @@ else() + ${CMAKE_SOURCE_DIR}/build/unix/makepchinput.py + ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py + ) +- add_custom_target(onepcm ALL DEPENDS etc/allDict.cxx.pch) +- install(FILES ${CMAKE_BINARY_DIR}/etc/allDict.cxx.pch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) +- install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/dictpch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) ++ if(NOT CMAKE_CROSSCOMPILING) ++ add_custom_target(onepcm ALL DEPENDS etc/allDict.cxx.pch) ++ install(FILES ${CMAKE_BINARY_DIR}/etc/allDict.cxx.pch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) ++ install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/dictpch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) ++ endif() + endif() + + # FIXME: move installation of PCMS in ROOT_GENERATE_DICTIONARY(). +@@ -601,24 +603,26 @@ if(runtime_cxxmodules) + endif() + + #---hsimple.root---------(use the executable for clearer dependencies and proper return code)--- +-add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root) +-add_dependencies(hsimple onepcm) +-if(WIN32) +- add_custom_command(OUTPUT tutorials/hsimple.root +- COMMAND set PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} && +- set ROOTIGNOREPREFIX=1 && set ROOT_HIST=0 && +- $ -l -q -b -n -x hsimple.C -e return +- WORKING_DIRECTORY tutorials +- DEPENDS $ Cling Hist Tree Gpad Graf HistPainter move_artifacts) +-else() +- add_custom_command(OUTPUT tutorials/hsimple.root +- COMMAND ${MODULES_ROOT_INCPATH} ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}} +- ROOTIGNOREPREFIX=1 ROOT_HIST=0 +- $ -l -q -b -n -x hsimple.C -e return +- WORKING_DIRECTORY tutorials +- DEPENDS $ Cling Hist Tree Gpad Graf HistPainter move_artifacts) ++if(NOT CMAKE_CROSSCOMPILING) ++ add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root) ++ add_dependencies(hsimple onepcm) ++ if(WIN32) ++ add_custom_command(OUTPUT tutorials/hsimple.root ++ COMMAND set PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} && ++ set ROOTIGNOREPREFIX=1 && set ROOT_HIST=0 && ++ $ -l -q -b -n -x hsimple.C -e return ++ WORKING_DIRECTORY tutorials ++ DEPENDS $ Cling Hist Tree Gpad Graf HistPainter move_artifacts) ++ else() ++ add_custom_command(OUTPUT tutorials/hsimple.root ++ COMMAND ${MODULES_ROOT_INCPATH} ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}} ++ ROOTIGNOREPREFIX=1 ROOT_HIST=0 ++ $ -l -q -b -n -x hsimple.C -e return ++ WORKING_DIRECTORY tutorials ++ DEPENDS $ Cling Hist Tree Gpad Graf HistPainter move_artifacts) ++ endif() ++ install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests) + endif() +-install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests) + + if(runtime_cxxmodules) + add_dependencies(hsimple modules_idx) +@@ -805,4 +809,6 @@ Linker flags: + ROOT_SHOW_ENABLED_OPTIONS() + + #---Packaging------------------------------------------------------------------------------------- +-include(RootCPack) ++if(NOT CMAKE_CROSSCOMPILING) ++ include(RootCPack) ++endif() +--- a/root/cmake/modules/SetUpMacOS.cmake ++++ b/root/cmake/modules/SetUpMacOS.cmake +@@ -113,15 +113,14 @@ endif() + + #---Avoid using a x86_64 Ninja executable with on a arm64 MacOS + #---This issue leads to the external being build for x86_64 instead of arm64 +-execute_process(COMMAND lipo -archs ${CMAKE_MAKE_PROGRAM} OUTPUT_VARIABLE _NINJA_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) +-if(CMAKE_GENERATOR MATCHES Ninja) +- +- set( _NINJA_ARCH_LIST ${_NINJA_ARCH} ) +- separate_arguments(_NINJA_ARCH_LIST) # This replace space with semi-colons +- if (NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" IN_LIST _NINJA_ARCH_LIST) +- message(FATAL_ERROR +- " ${CMAKE_MAKE_PROGRAM} does not support ${CMAKE_HOST_SYSTEM_PROCESSOR}.\n" +- " It only supports ${_NINJA_ARCH_LIST}.\n" +- " Downloading the latest version of Ninja might solve the problem.\n") +- endif() +-endif() ++#execute_process(COMMAND lipo -archs ${CMAKE_MAKE_PROGRAM} OUTPUT_VARIABLE _NINJA_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) ++#if(CMAKE_GENERATOR MATCHES Ninja) ++# set( _NINJA_ARCH_LIST ${_NINJA_ARCH} ) ++# separate_arguments(_NINJA_ARCH_LIST) # This replace space with semi-colons ++# if (NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" IN_LIST _NINJA_ARCH_LIST) ++# message(FATAL_ERROR ++# " ${CMAKE_MAKE_PROGRAM} does not support ${CMAKE_HOST_SYSTEM_PROCESSOR}.\n" ++# " It only supports ${_NINJA_ARCH_LIST}.\n" ++# " Downloading the latest version of Ninja might solve the problem.\n") ++# endif() ++#endif() +--- a/root/cmake/modules/SearchInstalledSoftware.cmake ++++ b/root/cmake/modules/SearchInstalledSoftware.cmake +@@ -37,7 +37,9 @@ endif() + if(cocoa) + if(APPLE) + set(x11 OFF CACHE BOOL "Disabled because cocoa requested (${x11_description})" FORCE) +- set(builtin_freetype ON CACHE BOOL "Enabled because needed for Cocoa graphics (${builtin_freetype_description})" FORCE) ++ if(NOT CMAKE_CROSSCOMPILING) # leave freetype as external on cross-compiling ++ set(builtin_freetype ON CACHE BOOL "Enabled because needed for Cocoa graphics (${builtin_freetype_description})" FORCE) ++ endif() + else() + message(STATUS "Cocoa option can only be enabled on MacOSX platform") + set(cocoa OFF CACHE BOOL "Disabled because only available on MacOSX (${cocoa_description})" FORCE) +--- a/root/etc/dictpch/makepch.py ++++ b/root/etc/dictpch/makepch.py +@@ -99,7 +99,12 @@ def makepch(): + allheadersFilename.replace("\\","/") + alllinkdefsFilename.replace("\\","/") + +- rootclingExe = os.path.join(rootdir,"bin","rootcling") ++ if "ROOTCLINGNATIVE" in os.environ: ++ rootclingExe = os.environ["ROOTCLINGNATIVE"] ++ crosscomp = True ++ else: ++ rootclingExe = os.path.join(rootdir,"bin","rootcling") ++ crosscomp = False + command = "%s %s -generate-pch -f allDict.cxx -noDictSelection %s %s %s %s" %(rootclingExe, + rootbuildFlag, + allCppFlags, +@@ -111,9 +116,10 @@ def makepch(): + print(command) + + my_env = os.environ.copy() +- existing_ldlib = my_env.get("LD_LIBRARY_PATH") +- if not existing_ldlib: existing_ldlib = "" +- my_env["LD_LIBRARY_PATH"] = os.path.join(rootdir, "lib") + ":" + existing_ldlib ++ if not crosscomp: ++ existing_ldlib = my_env.get("LD_LIBRARY_PATH") ++ if not existing_ldlib: existing_ldlib = "" ++ my_env["LD_LIBRARY_PATH"] = os.path.join(rootdir, "lib") + ":" + existing_ldlib + + ret = subprocess.call(command.split(), env=my_env) + if ret == 0: From a503434165b0e25f2c61b4d13c6031fb3f67cc6f Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Fri, 23 Aug 2024 15:00:54 +0200 Subject: [PATCH 02/30] Added more library products --- R/ROOT/build_tarballs.jl | 57 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 4382bf14e8e..64b5a3a2764 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -34,7 +34,7 @@ CMAKE_FLAGS+=(-Druntime_cxxmodules=OFF) CMAKE_FLAGS+=(-Dfound_urandom_EXITCODE=0) CMAKE_FLAGS+=(-Dfound_urandom_EXITCODE__TRYRUN_OUTPUT='') -export SYSTEM_INCLUDE_PATH= /opt/$MACHTYPE/$MACHTYPE/sys-root/usr/include:/opt/$MACHTYPE/$MACHTYPE/sys-root/usr/local/include +export SYSTEM_INCLUDE_PATH="`$MACHTYPE-g++ --sysroot="/opt/$MACHTYPE/$MACHTYPE/sys-root" -E -x c++ -v /dev/null 2>&1 | awk '{gsub("^ ", "")} /End of search list/{a=0} {if(a==1){s=s d \$0;d=":"}} /#include <...> search starts here/{a=1} END{print s}'`" export CPLUS_INCLUDE_PATH=$SYSTEM_INCLUDE_PATH # Needed for the native build (musl) #---Build host native rootcling, llvm-tblgen, clang-tblgen for cross-compilation------------------------ @@ -60,8 +60,8 @@ if [ $target != $MACHTYPE ]; then # Add extra options to use the built native binaries CMAKE_EXTRA_OPTS+=(-DNATIVE_BINARY_DIR=$PWD/native) - CMAKE_EXTRA_OPTS+=(-DLLVM_TABLEGEN=$PWD/native/interpreter/llvm-project/llvm/bin/llvm-tblgen) - CMAKE_EXTRA_OPTS+=(-DCLANG_TABLEGEN=$PWD/native/interpreter/llvm-project/llvm/bin/clang-tblgen) + CMAKE_EXTRA_OPTS+=(-DLLVM_TABLEGEN_EXE=$PWD/native/interpreter/llvm-project/llvm/bin/llvm-tblgen) + CMAKE_EXTRA_OPTS+=(-DCLANG_TABLEGEN_EXE=$PWD/native/interpreter/llvm-project/llvm/bin/clang-tblgen) CMAKE_EXTRA_OPTS+=(-DLLVM_CONFIG_PATH=$PWD/native/interpreter/llvm-project/llvm/bin/llvm-config) # Define ROOTCLINGNATIVE to use the native rootcling @@ -98,9 +98,56 @@ platforms = [ # The products that we will ensure are always built products = [ - LibraryProduct("libCore", :libCore), - LibraryProduct("libCling", :libCling), ExecutableProduct("root", :root), + LibraryProduct("libCling", :libCling; dont_dlopen=true), + LibraryProduct("libCore", :libCore; dont_dlopen=true), + LibraryProduct("libEG", :libEG; dont_dlopen=true), + LibraryProduct("libFitPanel", :libFitPanel; dont_dlopen=true), + LibraryProduct("libFoam", :libFoam; dont_dlopen=true), + LibraryProduct("libFumili", :libFumili; dont_dlopen=true), + LibraryProduct("libGed", :libGed; dont_dlopen=true), + LibraryProduct("libGenVector", :libGenVector; dont_dlopen=true), + LibraryProduct("libGeomBuilder", :libGeomBuilder; dont_dlopen=true), + LibraryProduct("libGeomPainter", :libGeomPainter; dont_dlopen=true), + LibraryProduct("libGeom", :libGeom; dont_dlopen=true), + LibraryProduct("libGpad", :libGpad; dont_dlopen=true), + LibraryProduct("libGraf3d", :libGraf3d; dont_dlopen=true), + LibraryProduct("libGraf", :libGraf; dont_dlopen=true), + LibraryProduct("libGuiBld", :libGuiBld; dont_dlopen=true), + LibraryProduct("libGuiHtml", :libGuiHtml; dont_dlopen=true), + LibraryProduct("libGui", :libGui; dont_dlopen=true), + LibraryProduct("libGX11", :libGX11; dont_dlopen=true), + LibraryProduct("libGX11TTF", :libGX11TTF; dont_dlopen=true), + LibraryProduct("libHistPainter", :libHistPainter; dont_dlopen=true), + LibraryProduct("libHist", :libHist; dont_dlopen=true), + LibraryProduct("libHtml", :libHtml; dont_dlopen=true), + LibraryProduct("libImt", :libImt; dont_dlopen=true), + LibraryProduct("libMathCore", :libMathCore; dont_dlopen=true), + LibraryProduct("libMatrix", :libMatrix; dont_dlopen=true), + LibraryProduct("libMinuit2", :libMinuit2; dont_dlopen=true), + LibraryProduct("libMinuit", :libMinuit; dont_dlopen=true), + LibraryProduct("libMLP", :libMLP; dont_dlopen=true), + LibraryProduct("libMultiProc", :libMultiProc; dont_dlopen=true), + LibraryProduct("libNet", :libNet; dont_dlopen=true), + LibraryProduct("libNew", :libNew; dont_dlopen=true), + LibraryProduct("libPhysics", :libPhysics; dont_dlopen=true), + LibraryProduct("libPostscript", :libPostscript; dont_dlopen=true), + LibraryProduct("libQuadp", :libQuadp; dont_dlopen=true), + LibraryProduct("libRCsg", :libRCsg; dont_dlopen=true), + LibraryProduct("libRecorder", :libRecorder; dont_dlopen=true), + LibraryProduct("libRint", :libRint; dont_dlopen=true), + LibraryProduct("libRIO", :libRIO; dont_dlopen=true), + LibraryProduct("libRootAuth", :libRootAuth; dont_dlopen=true), + LibraryProduct("libROOTVecOps", :libROOTVecOps; dont_dlopen=true), + LibraryProduct("libSmatrix", :libSmatrix; dont_dlopen=true), + LibraryProduct("libSPlot", :libSPlot; dont_dlopen=true), + LibraryProduct("libSQLIO", :libSQLIO; dont_dlopen=true), + LibraryProduct("libThread", :libThread; dont_dlopen=true), + LibraryProduct("libTreePlayer", :libTreePlayer; dont_dlopen=true), + LibraryProduct("libTree", :libTree; dont_dlopen=true), + LibraryProduct("libTreeViewer", :libTreeViewer; dont_dlopen=true), + LibraryProduct("libX3d", :libX3d; dont_dlopen=true), + LibraryProduct("libXMLIO", :libXMLIO; dont_dlopen=true) ] # Some dependencies are needed only on Linux and FreeBSD From 19cf8bfee6a8a2e08d96f26800623dfab85ca3dc Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Fri, 23 Aug 2024 16:34:18 +0200 Subject: [PATCH 03/30] Build the global PCH --- .../patches/rootcling-cross-compile.patch | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/R/ROOT/bundled/patches/rootcling-cross-compile.patch b/R/ROOT/bundled/patches/rootcling-cross-compile.patch index 6e6421d5fa3..fa159a12b0c 100644 --- a/R/ROOT/bundled/patches/rootcling-cross-compile.patch +++ b/R/ROOT/bundled/patches/rootcling-cross-compile.patch @@ -54,24 +54,9 @@ endif() elseif(TARGET ROOT::rootcling) ---- a/root/CMakeLists.txt -+++ b/root/CMakeLists.txt -@@ -547,9 +547,11 @@ else() - ${CMAKE_SOURCE_DIR}/build/unix/makepchinput.py - ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py - ) -- add_custom_target(onepcm ALL DEPENDS etc/allDict.cxx.pch) -- install(FILES ${CMAKE_BINARY_DIR}/etc/allDict.cxx.pch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) -- install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/dictpch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) -+ if(NOT CMAKE_CROSSCOMPILING) -+ add_custom_target(onepcm ALL DEPENDS etc/allDict.cxx.pch) -+ install(FILES ${CMAKE_BINARY_DIR}/etc/allDict.cxx.pch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) -+ install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/dictpch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) -+ endif() - endif() - - # FIXME: move installation of PCMS in ROOT_GENERATE_DICTIONARY(). -@@ -601,24 +603,26 @@ if(runtime_cxxmodules) +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -601,24 +601,26 @@ if(runtime_cxxmodules) endif() #---hsimple.root---------(use the executable for clearer dependencies and proper return code)--- @@ -115,7 +100,7 @@ if(runtime_cxxmodules) add_dependencies(hsimple modules_idx) -@@ -805,4 +809,6 @@ Linker flags: +@@ -805,4 +807,6 @@ Linker flags: ROOT_SHOW_ENABLED_OPTIONS() #---Packaging------------------------------------------------------------------------------------- From 423106811f821e2367796ae0c2ea740b5ccc2db3 Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Fri, 23 Aug 2024 16:37:44 +0200 Subject: [PATCH 04/30] typo in patch --- R/ROOT/bundled/patches/rootcling-cross-compile.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ROOT/bundled/patches/rootcling-cross-compile.patch b/R/ROOT/bundled/patches/rootcling-cross-compile.patch index fa159a12b0c..0ad3948f06b 100644 --- a/R/ROOT/bundled/patches/rootcling-cross-compile.patch +++ b/R/ROOT/bundled/patches/rootcling-cross-compile.patch @@ -54,8 +54,8 @@ endif() elseif(TARGET ROOT::rootcling) ---- a/CMakeLists.txt -+++ b/CMakeLists.txt +--- a/root/CMakeLists.txt ++++ b/root/CMakeLists.txt @@ -601,24 +601,26 @@ if(runtime_cxxmodules) endif() From 717866fc02033e0ea90fd760d8889ed87f520407 Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Wed, 4 Sep 2024 11:28:03 +0200 Subject: [PATCH 05/30] Temporary fix for host local prefix to simplify recipe --- R/ROOT/build_tarballs.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 64b5a3a2764..2303b9257b7 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -43,16 +43,16 @@ if [ $target != $MACHTYPE ]; then (cd srcdir/root-*/ atomic_patch -p2 ../patches/rootcling-cross-compile.patch ) + # host $sysroot/local should point to $host_prefix (issue BinaryBuilder) + rm /opt/$MACHTYPE/$MACHTYPE/sys-root/usr/local + ln -s $host_prefix /opt/$MACHTYPE/$MACHTYPE/sys-root/usr/local # Build for the host binary native used in second step build process mkdir native cmake -GNinja -DCMAKE_INSTALL_PREFIX=$prefix \ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_HOST_TOOLCHAIN} \ -DLLVM_HOST_TRIPLE=$MACHTYPE \ - -DLLVM_DEFAULT_TARGET_TRIPLE=$target \ - -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=OFF \ - -DCMAKE_PREFIX_PATH=$host_prefix \ - -DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath-link,$host_prefix/lib \ + -DLLVM_TARGET_TRIPLE=$target \ -Dminimal=ON \ ${CMAKE_FLAGS[@]} \ -B native -S srcdir/root-*/ From dc427fa1aeb8cfd6d1dd67140ba95686677f61e4 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Thu, 30 Jan 2025 17:45:02 +0100 Subject: [PATCH 06/30] First working version. Cross-compiling related issues with root-cling fixed for linux with glibc. MacOS not yet supported. --- R/ROOT/build_tarballs.jl | 333 +++++++++--------- .../patches/afterimage-cross-compile.patch | 10 + .../patches/rootcling-cross-compile.patch | 182 ---------- .../rootcling-cross-compile_6.32.6.patch | 189 ++++++++++ .../rootcling-cross-compile_6.32.8.patch | 190 ++++++++++ .../patches/x86_64-linux-gnu-g++.patch | 12 + .../patches/x86_64-linux-gnu-variant.patch | 11 + .../patches/x86_64-linux-musl-variant.patch | 11 + 8 files changed, 599 insertions(+), 339 deletions(-) create mode 100644 R/ROOT/bundled/patches/afterimage-cross-compile.patch delete mode 100644 R/ROOT/bundled/patches/rootcling-cross-compile.patch create mode 100644 R/ROOT/bundled/patches/rootcling-cross-compile_6.32.6.patch create mode 100644 R/ROOT/bundled/patches/rootcling-cross-compile_6.32.8.patch create mode 100644 R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch create mode 100644 R/ROOT/bundled/patches/x86_64-linux-gnu-variant.patch create mode 100644 R/ROOT/bundled/patches/x86_64-linux-musl-variant.patch diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 2303b9257b7..9206f1e9cb9 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -1,194 +1,213 @@ # Note that this script can accept some limited command-line arguments, run # `julia build_tarballs.jl --help` to see a usage message. + using BinaryBuilder, Pkg name = "ROOT" -version = v"6.32.2" +version = v"6.32.8" + +rootgithash = Dict(v"6.32.6" => "5380676d1f0ed3055048f305de917572f976a090", + v"6.32.8" => "a1748a069d2d5f27ec528cfd89b54b12dcba793e") + # Collection of sources required to complete build sources = [ - ArchiveSource("https://root.cern/download/root_v6.32.02.source.tar.gz", "3d0f76bf05857e1807ccfb2c9e014f525bcb625f94a2370b455f4b164961602d"), + GitSource("https://github.com/root-project/root.git", rootgithash[version]), DirectorySource("./bundled") ] # Bash recipe for building across all platforms script = raw""" - cd $WORKSPACE -install_license srcdir/root-*/LICENSE - -# Release type and C++ standard -CMAKE_FLAGS+=(-DCMAKE_BUILD_TYPE=Release) -CMAKE_FLAGS+=(-DCMAKE_CXX_STANDARD=17) - -# ROOT options to enable/disable -CMAKE_FLAGS+=(-Dgnuinstall=OFF) -CMAKE_FLAGS+=(-Drpath=ON) -CMAKE_FLAGS+=(-Dshared=ON) -CMAKE_FLAGS+=(-Dsoversion=OFF) -CMAKE_FLAGS+=(-Dfail-on-missing=ON) -CMAKE_FLAFS+=(-Dbuiltin_afterimage=ON) -CMAKE_FLAGS+=(-Druntime_cxxmodules=OFF) - -# LLVM tries to run a bunch of configure tests. Tell it what the output would have been. -CMAKE_FLAGS+=(-Dfound_urandom_EXITCODE=0) -CMAKE_FLAGS+=(-Dfound_urandom_EXITCODE__TRYRUN_OUTPUT='') - -export SYSTEM_INCLUDE_PATH="`$MACHTYPE-g++ --sysroot="/opt/$MACHTYPE/$MACHTYPE/sys-root" -E -x c++ -v /dev/null 2>&1 | awk '{gsub("^ ", "")} /End of search list/{a=0} {if(a==1){s=s d \$0;d=":"}} /#include <...> search starts here/{a=1} END{print s}'`" -export CPLUS_INCLUDE_PATH=$SYSTEM_INCLUDE_PATH # Needed for the native build (musl) - -#---Build host native rootcling, llvm-tblgen, clang-tblgen for cross-compilation------------------------ -if [ $target != $MACHTYPE ]; then - # Patch the sources to use the native binary for rootcling - (cd srcdir/root-*/ - atomic_patch -p2 ../patches/rootcling-cross-compile.patch - ) - # host $sysroot/local should point to $host_prefix (issue BinaryBuilder) - rm /opt/$MACHTYPE/$MACHTYPE/sys-root/usr/local - ln -s $host_prefix /opt/$MACHTYPE/$MACHTYPE/sys-root/usr/local - - # Build for the host binary native used in second step build process - mkdir native - cmake -GNinja -DCMAKE_INSTALL_PREFIX=$prefix \ - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_HOST_TOOLCHAIN} \ - -DLLVM_HOST_TRIPLE=$MACHTYPE \ - -DLLVM_TARGET_TRIPLE=$target \ - -Dminimal=ON \ - ${CMAKE_FLAGS[@]} \ - -B native -S srcdir/root-*/ - ninja -C native -j${nproc} rootcling_stage1 rootcling llvm-tblgen clang-tblgen llvm-config llvm-symbolizer - - # Add extra options to use the built native binaries - CMAKE_EXTRA_OPTS+=(-DNATIVE_BINARY_DIR=$PWD/native) - CMAKE_EXTRA_OPTS+=(-DLLVM_TABLEGEN_EXE=$PWD/native/interpreter/llvm-project/llvm/bin/llvm-tblgen) - CMAKE_EXTRA_OPTS+=(-DCLANG_TABLEGEN_EXE=$PWD/native/interpreter/llvm-project/llvm/bin/clang-tblgen) - CMAKE_EXTRA_OPTS+=(-DLLVM_CONFIG_PATH=$PWD/native/interpreter/llvm-project/llvm/bin/llvm-config) - - # Define ROOTCLINGNATIVE to use the native rootcling - export ROOTCLINGNATIVE="env CPLUS_INCLUDE_PATH=${SYSTEM_INCLUDE_PATH} $PWD/native/bin/rootcling" - - # Remove the CPLUS_INCLUDE_PATH environment variable. Was needed for the native build only - unset CPLUS_INCLUDE_PATH +if echo "$target" | grep -q musl; then #build wih musl library +# Disabling what is not working with musl: + CMAKE_EXTRA_OPTS=(-Ddavix=OFF -Dxrootd=OFF -Dssl=OFF -Druntime_cxxmodules=OFF -Droofit=OFF) +else + CMAKE_EXTRA_OPTS=(-Druntime_cxxmodules=OFF) fi -#---Standard build (cross-compilation)------------------------------------------------------------- +#Uncomment for a minimal build for debugging purposes +#CMAKE_EXTRA_OPTS+=(-Dclad=OFF -Dhtml=OFF -Dwebgui=OFF -Dcxxmodules=OFF -Dproof=OFF -Dtmva=OFF -Drootfit=OFF -Dxproofd=OFF -Dxrootd=OFF -Dssl=OFF -Dpyroot=OFF -Dtesting=OFF -Droot7=OFF -Dspectrum=OFF -Dunfold=OFF -Dasimage=OFF -Dgviz=OFF -Dfitiso=OFF -Dcocoa=OFF -Dopengl=OFF -Dproof=OFF -Dxml=OFF -Dgfal=OFF -Dmpi=OFF) + +export SYSTEM_INCLUDE_PATH="`g++ --sysroot="/opt/$target/$target/sys-root" -E -x c++ -v /dev/null 2>&1 | awk '{gsub(\"^ \", \"\")} /End of search list/{a=0} {if(a==1){s=s d $0;d=":"}} /#include <...> search starts here/{a=1} END{print s}'`" + +# build-in compilation of the libAfterImage library needs this directory +mkdir -p /tmp/user/0 + +cd / +[ -f /opt/bin/x86_64-linux-gnu-libgfortran5-cxx11/x86_64-linux-gnu-g++ ] && atomic_patch -p1 ${WORKSPACE}/srcdir/patches/x86_64-linux-gnu-g++.patch + +cd "$WORKSPACE" + +# For the cross-compiling, LLVM needs to compile the llvm-tblgen tool +# for the host. The ROOT LLVM code tree does not include the test and +# benchmark directories cmake will need to configure for the host for +# this bootstrap. Therefore, we need to disable the build of the test and +# benchmarks. +sed -i 's/\(option(LLVM_INCLUDE_TESTS[[:space:]].*[[:space:]]\)on)\(.*\)/\1OFF)\2/i + s/\(option(LLVM_INCLUDE_BENCHMARKS[[:space:]].*[[:space:]]\)on)\(.*\)/\1OFF)\2/i' \ + srcdir/root/interpreter/llvm-project/llvm/CMakeLists.txt +echo "set(CXX_STANDARD 17)" >> srcdir/root/interpreter/llvm-project/llvm/CMakeLists.txt + +# N llvm links. LLVM link command needs 15GB +njobs=$((2*`nproc`)) +LLVM_PARALLEL_LINK_JOBS=`grep MemTot /proc/meminfo | awk '{a=int($2/15100000); if(a>'"$njobs"') a='"$njobs"'; if(a<1) a=1; print a;}'` + +# For the rootcling execution performed during the build: +echo "include_directories(SYSTEM /opt/$target/$target/sys-root/usr/include)" >> ${CMAKE_TARGET_TOOLCHAIN} + +# Build with or without debug information: Debug / Release +BUILD_TYPE=Release + +#Patch needed for gcc [9.1.0, 9.3.0) +cat < "\$WORKSPACE/recipe.sh" < "\\\\", "\$" => "\\\$", "`" => "\\`")) +END_OF_SCRIPT + +chmod a+x "\$WORKSPACE/recipe.sh" +$script """ # These are the platforms we will build for by default, unless further # platforms are passed in on the command line -platforms = [ +platforms = [ + # Platform("i686", "linux"; libc = "glibc"), Platform("x86_64", "linux"; libc = "glibc"), - Platform("x86_64", "linux"; libc = "musl"), # Platform("aarch64", "linux"; libc = "glibc"), - # Platform("armv6l", "linux", libc = "glibc"), - # Platform("armv7l", "linux", libc = "glibc"), + # Platform("armv6l", "linux"; call_abi = "eabihf", libc = "glibc"), + # Platform("armv7l", "linux"; call_abi = "eabihf", libc = "glibc"), # Platform("powerpc64le", "linux"; libc = "glibc"), - Platform("aarch64", "macos"), - # Platform("x86_64", "macos"), -] |> expand_cxxstring_abis + # Platform("i686", "linux"; libc = "musl"), + # Platform("x86_64", "linux"; libc = "musl"), + # Platform("aarch64", "linux"; libc = "musl"), + # Platform("armv6l", "linux"; call_abi = "eabihf", libc = "musl"), + # Platform("armv7l", "linux"; call_abi = "eabihf", libc = "musl") +] + # The products that we will ensure are always built -products = [ - ExecutableProduct("root", :root), - LibraryProduct("libCling", :libCling; dont_dlopen=true), - LibraryProduct("libCore", :libCore; dont_dlopen=true), - LibraryProduct("libEG", :libEG; dont_dlopen=true), - LibraryProduct("libFitPanel", :libFitPanel; dont_dlopen=true), - LibraryProduct("libFoam", :libFoam; dont_dlopen=true), - LibraryProduct("libFumili", :libFumili; dont_dlopen=true), - LibraryProduct("libGed", :libGed; dont_dlopen=true), - LibraryProduct("libGenVector", :libGenVector; dont_dlopen=true), - LibraryProduct("libGeomBuilder", :libGeomBuilder; dont_dlopen=true), - LibraryProduct("libGeomPainter", :libGeomPainter; dont_dlopen=true), - LibraryProduct("libGeom", :libGeom; dont_dlopen=true), - LibraryProduct("libGpad", :libGpad; dont_dlopen=true), - LibraryProduct("libGraf3d", :libGraf3d; dont_dlopen=true), - LibraryProduct("libGraf", :libGraf; dont_dlopen=true), - LibraryProduct("libGuiBld", :libGuiBld; dont_dlopen=true), - LibraryProduct("libGuiHtml", :libGuiHtml; dont_dlopen=true), - LibraryProduct("libGui", :libGui; dont_dlopen=true), - LibraryProduct("libGX11", :libGX11; dont_dlopen=true), - LibraryProduct("libGX11TTF", :libGX11TTF; dont_dlopen=true), - LibraryProduct("libHistPainter", :libHistPainter; dont_dlopen=true), - LibraryProduct("libHist", :libHist; dont_dlopen=true), - LibraryProduct("libHtml", :libHtml; dont_dlopen=true), - LibraryProduct("libImt", :libImt; dont_dlopen=true), - LibraryProduct("libMathCore", :libMathCore; dont_dlopen=true), - LibraryProduct("libMatrix", :libMatrix; dont_dlopen=true), - LibraryProduct("libMinuit2", :libMinuit2; dont_dlopen=true), - LibraryProduct("libMinuit", :libMinuit; dont_dlopen=true), - LibraryProduct("libMLP", :libMLP; dont_dlopen=true), - LibraryProduct("libMultiProc", :libMultiProc; dont_dlopen=true), - LibraryProduct("libNet", :libNet; dont_dlopen=true), - LibraryProduct("libNew", :libNew; dont_dlopen=true), - LibraryProduct("libPhysics", :libPhysics; dont_dlopen=true), - LibraryProduct("libPostscript", :libPostscript; dont_dlopen=true), - LibraryProduct("libQuadp", :libQuadp; dont_dlopen=true), - LibraryProduct("libRCsg", :libRCsg; dont_dlopen=true), - LibraryProduct("libRecorder", :libRecorder; dont_dlopen=true), - LibraryProduct("libRint", :libRint; dont_dlopen=true), - LibraryProduct("libRIO", :libRIO; dont_dlopen=true), - LibraryProduct("libRootAuth", :libRootAuth; dont_dlopen=true), - LibraryProduct("libROOTVecOps", :libROOTVecOps; dont_dlopen=true), - LibraryProduct("libSmatrix", :libSmatrix; dont_dlopen=true), - LibraryProduct("libSPlot", :libSPlot; dont_dlopen=true), - LibraryProduct("libSQLIO", :libSQLIO; dont_dlopen=true), - LibraryProduct("libThread", :libThread; dont_dlopen=true), - LibraryProduct("libTreePlayer", :libTreePlayer; dont_dlopen=true), - LibraryProduct("libTree", :libTree; dont_dlopen=true), - LibraryProduct("libTreeViewer", :libTreeViewer; dont_dlopen=true), - LibraryProduct("libX3d", :libX3d; dont_dlopen=true), - LibraryProduct("libXMLIO", :libXMLIO; dont_dlopen=true) +products = Product[ + ExecutableProduct("root", :root) + ExecutableProduct("rootcling", :rootcling) + ExecutableProduct("rootcling_stage1", :rootcling_stage1) ] -# Some dependencies are needed only on Linux and FreeBSD -x11_platforms = filter(p ->Sys.islinux(p) || Sys.isfreebsd(p), platforms) - # Dependencies that must be installed before this package can be built dependencies = [ - BuildDependency("Xorg_xorgproto_jll"; platforms=x11_platforms) - HostBuildDependency("Zlib_jll") - HostBuildDependency("Zstd_jll") - HostBuildDependency("Lz4_jll") - HostBuildDependency("nlohmann_json_jll") - HostBuildDependency("FreeType2_jll") - HostBuildDependency("PCRE_jll") - HostBuildDependency("XZ_jll") - HostBuildDependency("xxHash_jll") - Dependency("Zlib_jll") - Dependency("Zstd_jll") + #Mandatory dependencies + BuildDependency("Xorg_xorgproto_jll") + Dependency("Xorg_libX11_jll") + Dependency("Xorg_libXpm_jll") + Dependency("Xorg_libXft_jll") + + #Optionnal dependencies (if absent, either a feature will be disabled or a built-in version will be compiled) + Dependency("VDT_jll") + Dependency("XRootD_jll") + Dependency(PackageSpec(name="LAPACK_jll", uuid="51474c39-65e3-53ba-86ba-03b1b862ec14")) Dependency("Lz4_jll") - Dependency("nlohmann_json_jll") - Dependency("FreeType2_jll") - Dependency("PCRE_jll") + Dependency(PackageSpec(name="FFTW_jll", uuid="f5851436-0d7a-5f13-b9de-f02708fd171a")) + Dependency(PackageSpec(name="Giflib_jll", uuid="59f7168a-df46-5410-90c8-f2779963d0ec")) + Dependency(PackageSpec(name="Zstd_jll", uuid="3161d3a3-bdf6-5164-811a-617609db77b4")) + Dependency(PackageSpec(name="PCRE2_jll", uuid="efcefdf7-47ab-520b-bdef-62a2eaa19f15")) + Dependency(PackageSpec(name="Graphviz_jll", uuid="3c863552-8265-54e4-a6dc-903eb78fde85")) + Dependency(PackageSpec(name="xxHash_jll", uuid="5fdcd639-92d1-5a06-bf6b-28f2061df1a9")) Dependency("XZ_jll") - Dependency("xxHash_jll") - Dependency("OpenSSL_jll"; compat="1.1.10") - Dependency("Xorg_libX11_jll"; platforms=x11_platforms) - Dependency("Xorg_libXpm_jll"; platforms=x11_platforms) - Dependency("Xorg_libXft_jll"; platforms=x11_platforms) - Dependency("Xorg_libICE_jll"; platforms=x11_platforms) - Dependency("Xorg_libSM_jll"; platforms=x11_platforms) - Dependency("Xorg_libXfixes_jll"; platforms=x11_platforms) - Dependency("Xorg_libXi_jll"; platforms=x11_platforms) - Dependency("Xorg_libXinerama_jll"; platforms=x11_platforms) - Dependency("Xorg_libXmu_jll"; platforms=x11_platforms) - Dependency("Xorg_libXt_jll"; platforms=x11_platforms) - Dependency("Xorg_libXtst_jll"; platforms=x11_platforms) - Dependency("Xorg_xcb_util_jll"; platforms=x11_platforms) - Dependency("Xorg_libxkbfile_jll"; platforms=x11_platforms) - #Dependency("libLVM_jll") + Dependency(PackageSpec(name="Librsvg_jll", uuid="925c91fb-5dd6-59dd-8e8c-345e74382d89")) + Dependency("FreeType2_jll") + Dependency("Xorg_libICE_jll") + Dependency("Xorg_libSM_jll") + Dependency("Xorg_libXfixes_jll") + Dependency("Xorg_libXi_jll") + Dependency("Xorg_libXinerama_jll") + Dependency("Xorg_libXmu_jll") + Dependency("Xorg_libXt_jll") + Dependency("Xorg_libXtst_jll") + Dependency("Xorg_xcb_util_jll") + Dependency("Xorg_libxkbfile_jll") + Dependency("Libglvnd_jll") + Dependency("OpenBLAS_jll") + Dependency("oneTBB_jll") ] # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; - preferred_gcc_version=v"11", julia_compat="1.6") +build_tarballs(ARGS, name, version, sources, scriptwrapper, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version=v"9") + diff --git a/R/ROOT/bundled/patches/afterimage-cross-compile.patch b/R/ROOT/bundled/patches/afterimage-cross-compile.patch new file mode 100644 index 00000000000..01894043c23 --- /dev/null +++ b/R/ROOT/bundled/patches/afterimage-cross-compile.patch @@ -0,0 +1,10 @@ +--- a/root/cmake/modules/SearchInstalledSoftware.cmake 2024-06-28 12:55:26.471599664 +0200 ++++ b/root/cmake/modules/SearchInstalledSoftware.cmake 2024-06-28 12:57:58.417875621 +0200 +@@ -499,6 +499,7 @@ + DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/graf2d/asimage/src/libAfterImage AFTERIMAGE + INSTALL_DIR ${CMAKE_BINARY_DIR} + CONFIGURE_COMMAND ./configure --prefix ++ --host=$ENV{target} + --libdir=/lib + --with-ttf ${_ttf_include} --with-afterbase=no + --without-svg --disable-glx ${_after_mmx} diff --git a/R/ROOT/bundled/patches/rootcling-cross-compile.patch b/R/ROOT/bundled/patches/rootcling-cross-compile.patch deleted file mode 100644 index 0ad3948f06b..00000000000 --- a/R/ROOT/bundled/patches/rootcling-cross-compile.patch +++ /dev/null @@ -1,182 +0,0 @@ ---- a/root/cmake/modules/RootMacros.cmake 2024-01-31 09:17:06.000000000 +0100 -+++ c/root/cmake/modules/RootMacros.cmake 2024-06-29 18:12:28.081464326 +0200 -@@ -8,6 +8,8 @@ - # RootMacros.cmake - #--------------------------------------------------------------------------------------------------- - -+set(NATIVE_BINARY_DIR FALSE CACHE FILEPATH "Path of native built in case of cross compiling.") -+ - if(WIN32) - set(libprefix lib) - set(ld_library_path PATH) -@@ -603,20 +605,37 @@ - #---what rootcling command to use-------------------------- - if(ARG_STAGE1) - if(MSVC AND CMAKE_ROOTTEST_DICT) -- set(command ${CMAKE_COMMAND} -E ${CMAKE_BINARY_DIR}/bin/rootcling_stage1.exe) -+ if(NATIVE_BINARY_DIR) -+ set(command ${CMAKE_COMMAND} -E ${NATIVE_BINARY_DIR}/bin/rootcling_stage1.exe) -+ else() -+ set(command ${CMAKE_COMMAND} -E ${CMAKE_BINARY_DIR}/bin/rootcling_stage1.exe) -+ endif() - else() -- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $) -+ if(NATIVE_BINARY_DIR) -+ set(command ${CMAKE_COMMAND} -E env "CPLUS_INCLUDE_PATH=$ENV{SYSTEM_INCLUDE_PATH}" "LD_LIBRARY_PATH=${NATIVE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" ${NATIVE_BINARY_DIR}/core/rootcling_stage1/src/rootcling_stage1) -+ else() -+ set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $) -+ endif() - endif() - set(ROOTCINTDEP rconfigure) - set(pcm_name) - else() - if(CMAKE_PROJECT_NAME STREQUAL ROOT) - if(MSVC AND CMAKE_ROOTTEST_DICT) -- set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${CMAKE_BINARY_DIR}/bin/rootcling.exe) -+ if(NATIVE_BINARY_DIR) -+ set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${NATIVE_BINARY_DIR}/bin/rootcling.exe) -+ else() -+ set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${CMAKE_BINARY_DIR}/core/rootcling_stage1/src/rootcling.exe) -+ endif() - else() -- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" -- "ROOTIGNOREPREFIX=1" $ -rootbuild) -- # Modules need RConfigure.h copied into include/. -+ if(NATIVE_BINARY_DIR) -+ set(command ${CMAKE_COMMAND} -E env "CPLUS_INCLUDE_PATH=$ENV{SYSTEM_INCLUDE_PATH}" "LD_LIBRARY_PATH=${NATIVE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" -+ "ROOTIGNOREPREFIX=1" ${NATIVE_BINARY_DIR}/bin/rootcling -rootbuild) -+ else() -+ set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" -+ "ROOTIGNOREPREFIX=1" $ -rootbuild) -+ endif() -+ # Modules need RConfigure.h copied into include/. - set(ROOTCINTDEP rootcling rconfigure) - endif() - elseif(TARGET ROOT::rootcling) - ---- a/root/CMakeLists.txt -+++ b/root/CMakeLists.txt -@@ -601,24 +601,26 @@ if(runtime_cxxmodules) - endif() - - #---hsimple.root---------(use the executable for clearer dependencies and proper return code)--- --add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root) --add_dependencies(hsimple onepcm) --if(WIN32) -- add_custom_command(OUTPUT tutorials/hsimple.root -- COMMAND set PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} && -- set ROOTIGNOREPREFIX=1 && set ROOT_HIST=0 && -- $ -l -q -b -n -x hsimple.C -e return -- WORKING_DIRECTORY tutorials -- DEPENDS $ Cling Hist Tree Gpad Graf HistPainter move_artifacts) --else() -- add_custom_command(OUTPUT tutorials/hsimple.root -- COMMAND ${MODULES_ROOT_INCPATH} ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}} -- ROOTIGNOREPREFIX=1 ROOT_HIST=0 -- $ -l -q -b -n -x hsimple.C -e return -- WORKING_DIRECTORY tutorials -- DEPENDS $ Cling Hist Tree Gpad Graf HistPainter move_artifacts) -+if(NOT CMAKE_CROSSCOMPILING) -+ add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root) -+ add_dependencies(hsimple onepcm) -+ if(WIN32) -+ add_custom_command(OUTPUT tutorials/hsimple.root -+ COMMAND set PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} && -+ set ROOTIGNOREPREFIX=1 && set ROOT_HIST=0 && -+ $ -l -q -b -n -x hsimple.C -e return -+ WORKING_DIRECTORY tutorials -+ DEPENDS $ Cling Hist Tree Gpad Graf HistPainter move_artifacts) -+ else() -+ add_custom_command(OUTPUT tutorials/hsimple.root -+ COMMAND ${MODULES_ROOT_INCPATH} ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}} -+ ROOTIGNOREPREFIX=1 ROOT_HIST=0 -+ $ -l -q -b -n -x hsimple.C -e return -+ WORKING_DIRECTORY tutorials -+ DEPENDS $ Cling Hist Tree Gpad Graf HistPainter move_artifacts) -+ endif() -+ install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests) - endif() --install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests) - - if(runtime_cxxmodules) - add_dependencies(hsimple modules_idx) -@@ -805,4 +807,6 @@ Linker flags: - ROOT_SHOW_ENABLED_OPTIONS() - - #---Packaging------------------------------------------------------------------------------------- --include(RootCPack) -+if(NOT CMAKE_CROSSCOMPILING) -+ include(RootCPack) -+endif() ---- a/root/cmake/modules/SetUpMacOS.cmake -+++ b/root/cmake/modules/SetUpMacOS.cmake -@@ -113,15 +113,14 @@ endif() - - #---Avoid using a x86_64 Ninja executable with on a arm64 MacOS - #---This issue leads to the external being build for x86_64 instead of arm64 --execute_process(COMMAND lipo -archs ${CMAKE_MAKE_PROGRAM} OUTPUT_VARIABLE _NINJA_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) --if(CMAKE_GENERATOR MATCHES Ninja) -- -- set( _NINJA_ARCH_LIST ${_NINJA_ARCH} ) -- separate_arguments(_NINJA_ARCH_LIST) # This replace space with semi-colons -- if (NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" IN_LIST _NINJA_ARCH_LIST) -- message(FATAL_ERROR -- " ${CMAKE_MAKE_PROGRAM} does not support ${CMAKE_HOST_SYSTEM_PROCESSOR}.\n" -- " It only supports ${_NINJA_ARCH_LIST}.\n" -- " Downloading the latest version of Ninja might solve the problem.\n") -- endif() --endif() -+#execute_process(COMMAND lipo -archs ${CMAKE_MAKE_PROGRAM} OUTPUT_VARIABLE _NINJA_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) -+#if(CMAKE_GENERATOR MATCHES Ninja) -+# set( _NINJA_ARCH_LIST ${_NINJA_ARCH} ) -+# separate_arguments(_NINJA_ARCH_LIST) # This replace space with semi-colons -+# if (NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" IN_LIST _NINJA_ARCH_LIST) -+# message(FATAL_ERROR -+# " ${CMAKE_MAKE_PROGRAM} does not support ${CMAKE_HOST_SYSTEM_PROCESSOR}.\n" -+# " It only supports ${_NINJA_ARCH_LIST}.\n" -+# " Downloading the latest version of Ninja might solve the problem.\n") -+# endif() -+#endif() ---- a/root/cmake/modules/SearchInstalledSoftware.cmake -+++ b/root/cmake/modules/SearchInstalledSoftware.cmake -@@ -37,7 +37,9 @@ endif() - if(cocoa) - if(APPLE) - set(x11 OFF CACHE BOOL "Disabled because cocoa requested (${x11_description})" FORCE) -- set(builtin_freetype ON CACHE BOOL "Enabled because needed for Cocoa graphics (${builtin_freetype_description})" FORCE) -+ if(NOT CMAKE_CROSSCOMPILING) # leave freetype as external on cross-compiling -+ set(builtin_freetype ON CACHE BOOL "Enabled because needed for Cocoa graphics (${builtin_freetype_description})" FORCE) -+ endif() - else() - message(STATUS "Cocoa option can only be enabled on MacOSX platform") - set(cocoa OFF CACHE BOOL "Disabled because only available on MacOSX (${cocoa_description})" FORCE) ---- a/root/etc/dictpch/makepch.py -+++ b/root/etc/dictpch/makepch.py -@@ -99,7 +99,12 @@ def makepch(): - allheadersFilename.replace("\\","/") - alllinkdefsFilename.replace("\\","/") - -- rootclingExe = os.path.join(rootdir,"bin","rootcling") -+ if "ROOTCLINGNATIVE" in os.environ: -+ rootclingExe = os.environ["ROOTCLINGNATIVE"] -+ crosscomp = True -+ else: -+ rootclingExe = os.path.join(rootdir,"bin","rootcling") -+ crosscomp = False - command = "%s %s -generate-pch -f allDict.cxx -noDictSelection %s %s %s %s" %(rootclingExe, - rootbuildFlag, - allCppFlags, -@@ -111,9 +116,10 @@ def makepch(): - print(command) - - my_env = os.environ.copy() -- existing_ldlib = my_env.get("LD_LIBRARY_PATH") -- if not existing_ldlib: existing_ldlib = "" -- my_env["LD_LIBRARY_PATH"] = os.path.join(rootdir, "lib") + ":" + existing_ldlib -+ if not crosscomp: -+ existing_ldlib = my_env.get("LD_LIBRARY_PATH") -+ if not existing_ldlib: existing_ldlib = "" -+ my_env["LD_LIBRARY_PATH"] = os.path.join(rootdir, "lib") + ":" + existing_ldlib - - ret = subprocess.call(command.split(), env=my_env) - if ret == 0: diff --git a/R/ROOT/bundled/patches/rootcling-cross-compile_6.32.6.patch b/R/ROOT/bundled/patches/rootcling-cross-compile_6.32.6.patch new file mode 100644 index 00000000000..520ced2d6b2 --- /dev/null +++ b/R/ROOT/bundled/patches/rootcling-cross-compile_6.32.6.patch @@ -0,0 +1,189 @@ +diff -r -u a/root/etc/dictpch/makepch.py b/root/etc/dictpch/makepch.py +--- a/root/etc/dictpch/makepch.py 2024-09-21 20:21:53.000000000 +0200 ++++ b/root/etc/dictpch/makepch.py 2025-01-30 22:13:47.783673060 +0100 +@@ -82,8 +82,6 @@ + cppFlags = getCppFlags(cppflagsFilename) + + cppflagsList=["-D__CLING__", +- "-D__STDC_LIMIT_MACROS", +- "-D__STDC_CONSTANT_MACROS", + "-DROOT_PCH", + "-I%s" %os.path.join(rootdir,"include"), + "-I%s" %os.path.join(rootdir,"etc"), +diff -r -u a/root/cmake/modules/RootMacros.cmake b/root/cmake/modules/RootMacros.cmake +--- a/root/cmake/modules/RootMacros.cmake 2024-09-21 20:21:53.000000000 +0200 ++++ b/root/cmake/modules/RootMacros.cmake 2024-12-18 22:51:27.159808704 +0100 +@@ -8,6 +8,21 @@ + # RootMacros.cmake + #--------------------------------------------------------------------------------------------------- + ++set(NATIVE_BINARY_DIR FALSE CACHE FILEPATH "Path of native built in case of cross compiling.") ++set(CLING_SYSTEM_INCLUDE_PATH FALSE CACHE FILEPATH "List of system paths for rootcling. This option is relevant for a cross compilation that require change of the default path.") ++ ++set(CLING_TARGET_GLIBC FALSE CACHE BOOL "Force rootcling to generate code for glibc. The option is relevant if rootcling is run on one platform to build code for another platform that uses a different libc library") ++ ++if(CLING_TARGET_GLIBC) ++ add_compile_definitions(TARGET_GLIBC=1) ++endif() ++ ++set(CLING_TARGET_GLIBCXX FALSE CACHE BOOL "Force rootcling to generate code for GNU libstdc++. The option is relevant if rootcling is run on one platform to build code for another platform that uses a different standard c++ library") ++ ++if(CLING_TARGET_GLIBCXX) ++ add_compile_definitions(TARGET_GLIBCXX=1) ++endif() ++ + if(WIN32) + set(libprefix lib) + set(ld_library_path PATH) +@@ -302,6 +317,12 @@ + # list of include directories for dictionary generation + set(incdirs) + ++ # for cross compilation ++ set(system_include_dir_opt "") ++ if(CLING_SYSTEM_INCLUDE_PATH) ++ set(system_include_dir_opt "CPLUS_INCLUDE_PATH=${CLING_SYSTEM_INCLUDE_PATH}") ++ endif() ++ + if((CMAKE_PROJECT_NAME STREQUAL ROOT) AND (TARGET ${ARG_MODULE})) + set(headerdirs) + +@@ -602,33 +623,47 @@ + set(newargs -cxxmodule ${newargs}) + endif() + ++ set(rootcling_env "${system_include_dir_opt}") ++ ++ if(NATIVE_BINARY_DIR) ++ set(rootcling_libdir "${NATIVE_BINARY_DIR}/lib") ++ set(rootcling "${NATIVE_BINARY_DIR}/bin/rootcling") ++ set(rootcling_stage1 "${NATIVE_BINARY_DIR}/core/rootcling_stage1/src/rootcling_stage1") ++ set(rootcling_env ${rootcling_env} LLVM_SYMBOLIZER_PATH=${NATIVE_BINARY_DIR}/tools/llvm-symbolizer) ++ else() ++ set(rootcling_libdir "${CMAKE_BINARY_DIR}/lib") ++ set(rootcling "$") ++ set(rootcling_stage1 "$") ++ endif() ++ ++ if(APPLE) ++ set(rootcling_env ${rootcling_env} DYLD_LIBRARY_PATH=${rootcling_libdir}:$ENV{DYLD_LIBRARY_PATH}) ++ else() ++ set(rootcling_env ${rootcling_env} LD_LIBRARY_PATH=${rootcling_libdir}:$ENV{LD_LIBRARY_PATH}) ++ endif() ++ + #---what rootcling command to use-------------------------- + if(ARG_STAGE1) + if(MSVC AND CMAKE_ROOTTEST_DICT) + set(command ${CMAKE_COMMAND} -E ${CMAKE_BINARY_DIR}/bin/rootcling_stage1.exe) + else() +- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $) ++ set(command ${CMAKE_COMMAND} -E env ${rootcling_env} ${rootcling_stage1}) + endif() + set(ROOTCINTDEP rconfigure) + set(pcm_name) + else() + if(CMAKE_PROJECT_NAME STREQUAL ROOT) + if(MSVC AND CMAKE_ROOTTEST_DICT) +- set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${CMAKE_BINARY_DIR}/bin/rootcling.exe) ++ set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${CMAKE_BINARY_DIR}/core/rootcling_stage1/src/rootcling.exe) + else() +- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" +- "ROOTIGNOREPREFIX=1" $ -rootbuild) ++ set(command ${CMAKE_COMMAND} -E env ${rootcling_env} "ROOTIGNOREPREFIX=1" ${rootcling} -rootbuild) + # Modules need RConfigure.h copied into include/. + set(ROOTCINTDEP rootcling rconfigure) + endif() + elseif(TARGET ROOT::rootcling) +- if(APPLE) +- set(command ${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:$ENV{DYLD_LIBRARY_PATH}" $) +- else() +- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:$ENV{LD_LIBRARY_PATH}" $) +- endif() ++ set(command ${CMAKE_COMMAND} -E env ${rootcling_env} $rootcling) + else() +- set(command ${CMAKE_COMMAND} -E env rootcling) ++ set(command ${CMAKE_COMMAND} -E env ${system_include_dir_opt} rootcling) + endif() + endif() + +diff -r -u a/root/CMakeLists.txt b/root/CMakeLists.txt +--- a/root/CMakeLists.txt 2024-09-21 20:21:53.000000000 +0200 ++++ b/root/CMakeLists.txt 2024-12-19 08:02:12.146813011 +0100 +@@ -530,6 +530,16 @@ + get_property(__pch_dependencies GLOBAL PROPERTY ROOT_PCH_DEPENDENCIES) + get_property(__pch_dictionaries GLOBAL PROPERTY ROOT_PCH_DICTIONARIES) + ++ if(NATIVE_BINARY_DIR) ++ set(rootcling_env "LLVM_SYMBOLIZER_PATH=${NATIVE_BINARY_DIR}/tools/llvm-symbolizer") ++ else() ++ set(rootcling_dir "") ++ endif() ++ ++ if(CLING_SYSTEM_INCLUDE_PATH) ++ set(rootcling_env ${rootcling_env} "CPLUS_INCLUDE_PATH=${CLING_SYSTEM_INCLUDE_PATH}") ++ endif() ++ + add_custom_command(OUTPUT etc/allDict.cxx.pch + BYPRODUCTS + etc/dictpch/allCppflags.txt +@@ -539,7 +549,7 @@ + ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build/unix/makepchinput.py + ${CMAKE_SOURCE_DIR} . ${pyroot_legacy} ${__cling_pch} + COMMAND +- ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ${Python3_EXECUTABLE} ++ ${CMAKE_COMMAND} -E env ${rootcling_env} ROOTIGNOREPREFIX=1 ${Python3_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch + ${__allIncludes} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_SOURCE_DIR}/core + DEPENDS +diff -r -u a/root/interpreter/cling/lib/Interpreter/Interpreter.cpp b/root/interpreter/cling/lib/Interpreter/Interpreter.cpp +--- a/root/interpreter/cling/lib/Interpreter/Interpreter.cpp 2024-09-21 20:21:53.000000000 +0200 ++++ b/root/interpreter/cling/lib/Interpreter/Interpreter.cpp 2024-12-14 23:53:56.203728225 +0100 +@@ -67,6 +67,30 @@ + + using namespace clang; + ++ ++// For cross-compilation, TARGET_GLIBC should be set when invoking ++// the compiler to 0 or 1, depending if target is using glibc. ++// It is set automatically for normal compilation. ++#if !defined(TARGET_GLIBC) ++# ifdef __GLIBC__ ++# define TARGET_GLIBC 1 ++# else ++# define TARGET_GLIBC 0 ++# endif ++#endif ++ ++// For cross-compilation, TARGET_GLIBCXX should be set when invoking ++// the compiler to 0 or 1, depending if target is using GNU libstdc++. ++// It is set automatically for normal compilation. ++#if !defined(TARGET_GLIBCXX) ++# ifdef __GLIBCXX__ ++# define TARGET_GLIBCXX 1 ++# else ++# define TARGET_GLIBCXX 0 ++# endif ++#endif ++ ++ + namespace { + + static void registerCxaAtExitHelper(void *Self, void (*F)(void *), void *Ctx, +@@ -460,7 +484,7 @@ + + // Intercept all atexit calls, as the Interpreter and functions will be long + // gone when the -native- versions invoke them. +-#if defined(__GLIBC__) ++#if TARGET_GLIBC + const char* LinkageCxx = "extern \"C++\""; + const char* Attr = LangOpts.CPlusPlus ? " throw () " : ""; + #else +@@ -468,7 +492,7 @@ + const char* Attr = ""; + #endif + +-#if defined(__GLIBCXX__) ++#if TARGET_GLIBCXX + const char* cxa_atexit_is_noexcept = LangOpts.CPlusPlus ? " noexcept" : ""; + #else + const char* cxa_atexit_is_noexcept = ""; diff --git a/R/ROOT/bundled/patches/rootcling-cross-compile_6.32.8.patch b/R/ROOT/bundled/patches/rootcling-cross-compile_6.32.8.patch new file mode 100644 index 00000000000..31b9a3176a6 --- /dev/null +++ b/R/ROOT/bundled/patches/rootcling-cross-compile_6.32.8.patch @@ -0,0 +1,190 @@ +diff -ru a/root/cmake/modules/RootMacros.cmake b/root/cmake/modules/RootMacros.cmake +--- a/root/cmake/modules/RootMacros.cmake 2024-11-14 10:27:26.000000000 +0100 ++++ b/root/cmake/modules/RootMacros.cmake 2025-01-31 11:01:18.350881086 +0100 +@@ -8,6 +8,21 @@ + # RootMacros.cmake + #--------------------------------------------------------------------------------------------------- + ++set(NATIVE_BINARY_DIR FALSE CACHE FILEPATH "Path of native built in case of cross compiling.") ++set(CLING_SYSTEM_INCLUDE_PATH FALSE CACHE FILEPATH "List of system paths for rootcling. This option is relevant for a cross compilation that require change of the default path.") ++ ++set(CLING_TARGET_GLIBC FALSE CACHE BOOL "Force rootcling to generate code for glibc. The option is relevant if rootcling is run on one platform to build code for another platform that uses a different libc library") ++ ++if(CLING_TARGET_GLIBC) ++ add_compile_definitions(TARGET_GLIBC=1) ++endif() ++ ++set(CLING_TARGET_GLIBCXX FALSE CACHE BOOL "Force rootcling to generate code for GNU libstdc++. The option is relevant if rootcling is run on one platform to build code for another platform that uses a different standard c++ library") ++ ++if(CLING_TARGET_GLIBCXX) ++ add_compile_definitions(TARGET_GLIBCXX=1) ++endif() ++ + if(WIN32) + set(libprefix lib) + set(ld_library_path PATH) +@@ -302,6 +317,12 @@ + # list of include directories for dictionary generation + set(incdirs) + ++ # for cross compilation ++ set(system_include_dir_opt "") ++ if(CLING_SYSTEM_INCLUDE_PATH) ++ set(system_include_dir_opt "CPLUS_INCLUDE_PATH=${CLING_SYSTEM_INCLUDE_PATH}") ++ endif() ++ + if((CMAKE_PROJECT_NAME STREQUAL ROOT) AND (TARGET ${ARG_MODULE})) + set(headerdirs) + +@@ -602,33 +623,47 @@ + set(newargs -cxxmodule ${newargs}) + endif() + ++ set(rootcling_env "${system_include_dir_opt}") ++ ++ if(NATIVE_BINARY_DIR) ++ set(rootcling_libdir "${NATIVE_BINARY_DIR}/lib") ++ set(rootcling "${NATIVE_BINARY_DIR}/bin/rootcling") ++ set(rootcling_stage1 "${NATIVE_BINARY_DIR}/core/rootcling_stage1/src/rootcling_stage1") ++ set(rootcling_env ${rootcling_env} LLVM_SYMBOLIZER_PATH=${NATIVE_BINARY_DIR}/tools/llvm-symbolizer) ++ else() ++ set(rootcling_libdir "${CMAKE_BINARY_DIR}/lib") ++ set(rootcling "$") ++ set(rootcling_stage1 "$") ++ endif() ++ ++ if(APPLE) ++ set(rootcling_env ${rootcling_env} DYLD_LIBRARY_PATH=${rootcling_libdir}:$ENV{DYLD_LIBRARY_PATH}) ++ else() ++ set(rootcling_env ${rootcling_env} LD_LIBRARY_PATH=${rootcling_libdir}:$ENV{LD_LIBRARY_PATH}) ++ endif() ++ + #---what rootcling command to use-------------------------- + if(ARG_STAGE1) + if(MSVC AND CMAKE_ROOTTEST_DICT) + set(command ${CMAKE_COMMAND} -E ${CMAKE_BINARY_DIR}/bin/rootcling_stage1.exe) + else() +- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $) ++ set(command ${CMAKE_COMMAND} -E env ${rootcling_env} ${rootcling_stage1}) + endif() + set(ROOTCINTDEP rconfigure) + set(pcm_name) + else() + if(CMAKE_PROJECT_NAME STREQUAL ROOT) + if(MSVC AND CMAKE_ROOTTEST_DICT) +- set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${CMAKE_BINARY_DIR}/bin/rootcling.exe) ++ set(command ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${CMAKE_BINARY_DIR}/core/rootcling_stage1/src/rootcling.exe) + else() +- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" +- "ROOTIGNOREPREFIX=1" $ -rootbuild) ++ set(command ${CMAKE_COMMAND} -E env ${rootcling_env} "ROOTIGNOREPREFIX=1" ${rootcling} -rootbuild) + # Modules need RConfigure.h copied into include/. + set(ROOTCINTDEP rootcling rconfigure) + endif() + elseif(TARGET ROOT::rootcling) +- if(APPLE) +- set(command ${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:$ENV{DYLD_LIBRARY_PATH}" $) +- else() +- set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:$ENV{LD_LIBRARY_PATH}" $) +- endif() ++ set(command ${CMAKE_COMMAND} -E env ${rootcling_env} $rootcling) + else() +- set(command ${CMAKE_COMMAND} -E env rootcling) ++ set(command ${CMAKE_COMMAND} -E env ${system_include_dir_opt} rootcling) + endif() + endif() + +diff -ru a/root/CMakeLists.txt b/root/CMakeLists.txt +--- a/root/CMakeLists.txt 2024-11-14 10:27:26.000000000 +0100 ++++ b/root/CMakeLists.txt 2025-01-31 11:01:18.352881145 +0100 +@@ -531,6 +531,16 @@ + get_property(__pch_dependencies GLOBAL PROPERTY ROOT_PCH_DEPENDENCIES) + get_property(__pch_dictionaries GLOBAL PROPERTY ROOT_PCH_DICTIONARIES) + ++ if(NATIVE_BINARY_DIR) ++ set(rootcling_env "LLVM_SYMBOLIZER_PATH=${NATIVE_BINARY_DIR}/tools/llvm-symbolizer") ++ else() ++ set(rootcling_dir "") ++ endif() ++ ++ if(CLING_SYSTEM_INCLUDE_PATH) ++ set(rootcling_env ${rootcling_env} "CPLUS_INCLUDE_PATH=${CLING_SYSTEM_INCLUDE_PATH}") ++ endif() ++ + add_custom_command(OUTPUT etc/allDict.cxx.pch + BYPRODUCTS + etc/dictpch/allCppflags.txt +@@ -540,7 +550,7 @@ + ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build/unix/makepchinput.py + ${CMAKE_SOURCE_DIR} . ${pyroot_legacy} ${__cling_pch} + COMMAND +- ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ${Python3_EXECUTABLE} ++ ${CMAKE_COMMAND} -E env ${rootcling_env} ROOTIGNOREPREFIX=1 ${Python3_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch + ${__allIncludes} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_SOURCE_DIR}/core + DEPENDS +Only in b/root: CMakeLists.txt.orig +diff -ru a/root/etc/dictpch/makepch.py b/root/etc/dictpch/makepch.py +--- a/root/etc/dictpch/makepch.py 2024-11-14 10:27:26.000000000 +0100 ++++ b/root/etc/dictpch/makepch.py 2025-01-31 11:01:18.347880996 +0100 +@@ -82,8 +82,6 @@ + cppFlags = getCppFlags(cppflagsFilename) + + cppflagsList=["-D__CLING__", +- "-D__STDC_LIMIT_MACROS", +- "-D__STDC_CONSTANT_MACROS", + "-DROOT_PCH", + "-I%s" %os.path.join(rootdir,"include"), + "-I%s" %os.path.join(rootdir,"etc"), +diff -ru a/root/interpreter/cling/lib/Interpreter/Interpreter.cpp b/root/interpreter/cling/lib/Interpreter/Interpreter.cpp +--- a/root/interpreter/cling/lib/Interpreter/Interpreter.cpp 2024-11-14 10:27:26.000000000 +0100 ++++ b/root/interpreter/cling/lib/Interpreter/Interpreter.cpp 2025-01-31 11:01:18.355881235 +0100 +@@ -67,6 +67,30 @@ + + using namespace clang; + ++ ++// For cross-compilation, TARGET_GLIBC should be set when invoking ++// the compiler to 0 or 1, depending if target is using glibc. ++// It is set automatically for normal compilation. ++#if !defined(TARGET_GLIBC) ++# ifdef __GLIBC__ ++# define TARGET_GLIBC 1 ++# else ++# define TARGET_GLIBC 0 ++# endif ++#endif ++ ++// For cross-compilation, TARGET_GLIBCXX should be set when invoking ++// the compiler to 0 or 1, depending if target is using GNU libstdc++. ++// It is set automatically for normal compilation. ++#if !defined(TARGET_GLIBCXX) ++# ifdef __GLIBCXX__ ++# define TARGET_GLIBCXX 1 ++# else ++# define TARGET_GLIBCXX 0 ++# endif ++#endif ++ ++ + namespace { + + static void registerCxaAtExitHelper(void *Self, void (*F)(void *), void *Ctx, +@@ -460,7 +484,7 @@ + + // Intercept all atexit calls, as the Interpreter and functions will be long + // gone when the -native- versions invoke them. +-#if defined(__GLIBC__) ++#if TARGET_GLIBC + const char* LinkageCxx = "extern \"C++\""; + const char* Attr = LangOpts.CPlusPlus ? " throw () " : ""; + #else +@@ -468,7 +492,7 @@ + const char* Attr = ""; + #endif + +-#if defined(__GLIBCXX__) ++#if TARGET_GLIBCXX + const char* cxa_atexit_is_noexcept = LangOpts.CPlusPlus ? " noexcept" : ""; + #else + const char* cxa_atexit_is_noexcept = ""; diff --git a/R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch b/R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch new file mode 100644 index 00000000000..a71e807c5e0 --- /dev/null +++ b/R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch @@ -0,0 +1,12 @@ +--- a/opt/bin/x86_64-linux-gnu-libgfortran5-cxx11/x86_64-linux-gnu-g++ ++++ b/opt/bin/x86_64-linux-gnu-libgfortran5-cxx11/x86_64-linux-gnu-g++ +@@ -27,8 +27,7 @@ + + export LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/lib64:/lib:/opt/x86_64-linux-musl/x86_64-linux-musl/lib64:/opt/x86_64-linux-musl/x86_64-linux-musl/lib:/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64:/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib" + if [[ " ${ARGS[@]} " == *"-march="* ]]; then +- echo "BinaryBuilder: Cannot force an architecture via -march" >&2 +- exit 1 ++ echo "BinaryBuilder: warning architecture forced via -march" >&2 + fi + + if [[ "${ARGS[@]}" =~ "-Ofast"|"-ffast-math"|"-funsafe-math-optimizations" ]]; then diff --git a/R/ROOT/bundled/patches/x86_64-linux-gnu-variant.patch b/R/ROOT/bundled/patches/x86_64-linux-gnu-variant.patch new file mode 100644 index 00000000000..4dce931344f --- /dev/null +++ b/R/ROOT/bundled/patches/x86_64-linux-gnu-variant.patch @@ -0,0 +1,11 @@ +--- a/opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/9.1.0/variant ++++ b/opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/9.1.0/variant +@@ -1556,7 +1556,7 @@ + #endif + + template +- friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v); ++ friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v) noexcept; + + template + friend void* __detail::__variant::__get_storage(_Vp&& __v); diff --git a/R/ROOT/bundled/patches/x86_64-linux-musl-variant.patch b/R/ROOT/bundled/patches/x86_64-linux-musl-variant.patch new file mode 100644 index 00000000000..b3b34018419 --- /dev/null +++ b/R/ROOT/bundled/patches/x86_64-linux-musl-variant.patch @@ -0,0 +1,11 @@ +--- /opt/x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/9.1.0/../../../../x86_64-linux-musl/include/c++/9.1.0/variant.orig ++++ /opt/x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/9.1.0/../../../../x86_64-linux-musl/include/c++/9.1.0/variant +@@ -1556,7 +1556,7 @@ + #endif + + template +- friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v); ++ friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v) noexcept; + + template + friend void* __detail::__variant::__get_storage(_Vp&& __v); From 3ba7dfa36ec20fb28bda5eb3b7b4cdac4c9b805d Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 4 Feb 2025 14:20:22 +0100 Subject: [PATCH 07/30] Fix an issue when compilation is done the on buildkite CI --- R/ROOT/build_tarballs.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 9206f1e9cb9..e740f94081b 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -80,6 +80,8 @@ if [ $target != $MACHTYPE ]; then #cross compilation ) # Compile for the host binary used in the build process + # Davix is switched off, as otherwise build fails in buildkite CI. It should not be + # needed for the NATIVE tools. mkdir NATIVE cmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_HOST_TOOLCHAIN} \ @@ -93,6 +95,7 @@ if [ $target != $MACHTYPE ]; then #cross compilation -DCLING_TARGET_GLIBC=1 \ -DCLING_TARGET_GLIBCXX=1 \ -DCLING_SYSTEM_INCLUDE_PATH="$SYSTEM_INCLUDE_PATH" \ + -Ddavix=OFF \ -B NATIVE -S srcdir/root cmake --build NATIVE -- -j$njobs rootcling_stage1 rootcling llvm-tblgen clang-tblgen llvm-config llvm-symbolizer From 0994081dddbaeea00c77033ed833f1b85e85c63c Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Fri, 14 Feb 2025 18:59:23 +0100 Subject: [PATCH 08/30] Update R/ROOT/build_tarballs.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com> --- R/ROOT/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index e740f94081b..e4380dc5555 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -132,7 +132,7 @@ cmake --build build -j${njobs} # Install the binaries cmake --install build --prefix $prefix -cp -a build/core/rootcling_stage1/src/rootcling_stage1 $prefix/bin/ +install -Dvm 755 build/core/rootcling_stage1/src/rootcling_stage1 -t "${bindir}" """ open("recipe.sh", "w") do io From d753723b1470f3febae81560fca3bef81317c3d5 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Fri, 14 Feb 2025 20:44:46 +0100 Subject: [PATCH 09/30] use lock_microarchitecture=false option instead of patching compiler script skip-checks: true --- R/ROOT/build_tarballs.jl | 4 ++-- R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index e4380dc5555..a76a3932f91 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -35,7 +35,6 @@ export SYSTEM_INCLUDE_PATH="`g++ --sysroot="/opt/$target/$target/sys-root" -E -x mkdir -p /tmp/user/0 cd / -[ -f /opt/bin/x86_64-linux-gnu-libgfortran5-cxx11/x86_64-linux-gnu-g++ ] && atomic_patch -p1 ${WORKSPACE}/srcdir/patches/x86_64-linux-gnu-g++.patch cd "$WORKSPACE" @@ -212,5 +211,6 @@ dependencies = [ ] # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, name, version, sources, scriptwrapper, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version=v"9") +build_tarballs(ARGS, name, version, sources, scriptwrapper, platforms, products, + dependencies; julia_compat="1.6", preferred_gcc_version=v"9", lock_microarchitecture=false) diff --git a/R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch b/R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch deleted file mode 100644 index a71e807c5e0..00000000000 --- a/R/ROOT/bundled/patches/x86_64-linux-gnu-g++.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/opt/bin/x86_64-linux-gnu-libgfortran5-cxx11/x86_64-linux-gnu-g++ -+++ b/opt/bin/x86_64-linux-gnu-libgfortran5-cxx11/x86_64-linux-gnu-g++ -@@ -27,8 +27,7 @@ - - export LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/lib64:/lib:/opt/x86_64-linux-musl/x86_64-linux-musl/lib64:/opt/x86_64-linux-musl/x86_64-linux-musl/lib:/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64:/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib" - if [[ " ${ARGS[@]} " == *"-march="* ]]; then -- echo "BinaryBuilder: Cannot force an architecture via -march" >&2 -- exit 1 -+ echo "BinaryBuilder: warning architecture forced via -march" >&2 - fi - - if [[ "${ARGS[@]}" =~ "-Ofast"|"-ffast-math"|"-funsafe-math-optimizations" ]]; then From 44412354330250daab23370d8c103cf3a5d065de Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Fri, 14 Feb 2025 22:09:56 +0100 Subject: [PATCH 10/30] fixed compilation issue with lastly committed oneTBB_jll by setting compat flag to previous version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compilation error was: ``` from /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/9.1.0/stdexcept:39, from /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/9.1.0/array:39, from /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/9.1.0/tuple:39, from /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/9.1.0/functional:54, from /workspace/srcdir/root/core/foundation/inc/TError.h:37, from /workspace/srcdir/root/core/cont/inc/ROOT/TSeq.hxx:15, from /workspace/srcdir/root/core/base/inc/ROOT/TExecutorCRTP.hxx:15, from /workspace/srcdir/root/core/imt/inc/ROOT/TThreadExecutor.hxx:25, from /workspace/srcdir/root/core/imt/src/TThreadExecutor.cxx:4: /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/bits/waitstatus.h:66:7: note: candidate: ‘wait::wait()’ 66 | union wait | ^~~~ /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/bits/waitstatus.h:66:7: note: candidate expects 0 arguments, 2 provided /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/bits/waitstatus.h:66:7: note: candidate: ‘constexpr wait::wait(const wait&)’ /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/bits/waitstatus.h:66:7: note: candidate expects 1 argument, 2 provided /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/bits/waitstatus.h:66:7: note: candidate: ‘constexpr wait::wait(wait&&)’ /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/bits/waitstatus.h:66:7: note: candidate expects 1 argument, 2 provided ``` --- R/ROOT/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index a76a3932f91..188ff6ac557 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -207,7 +207,7 @@ dependencies = [ Dependency("Xorg_libxkbfile_jll") Dependency("Libglvnd_jll") Dependency("OpenBLAS_jll") - Dependency("oneTBB_jll") + Dependency("oneTBB_jll", compat="2021.9.0") ] # Build the tarballs, and possibly a `build.jl` as well. From 8411b7b0902dda170d048f93deebec988be16177 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Sat, 15 Feb 2025 09:11:52 +0100 Subject: [PATCH 11/30] change `nproc` by $nproc and reduced number of parallel jobs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Beware $nproc ignores the cpu affinity mask (used by slurm batch system to share cpus of a node). Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com> --- R/ROOT/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 188ff6ac557..d45a33cb59a 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -49,7 +49,7 @@ sed -i 's/\(option(LLVM_INCLUDE_TESTS[[:space:]].*[[:space:]]\)on)\(.*\)/\1OFF)\ echo "set(CXX_STANDARD 17)" >> srcdir/root/interpreter/llvm-project/llvm/CMakeLists.txt # N llvm links. LLVM link command needs 15GB -njobs=$((2*`nproc`)) +njobs=${nproc} LLVM_PARALLEL_LINK_JOBS=`grep MemTot /proc/meminfo | awk '{a=int($2/15100000); if(a>'"$njobs"') a='"$njobs"'; if(a<1) a=1; print a;}'` # For the rootcling execution performed during the build: From 521d5fa17e2a9d50c53fc3cd81ecd2f091ca0e47 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Sun, 16 Feb 2025 12:44:08 +0100 Subject: [PATCH 12/30] Dependencies reviewed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add uuid to dependencies that were missing it; - remove LAPACK_jll, OpenBLAS_jll; - use libblastrampoline for the BLAS dependency; - add missing dependencies, GLU_jll, GLEW_jll, nlohmann_json_jll, and CFITSIO_jll. Co-authored-by: Mosè Giordano --- R/ROOT/build_tarballs.jl | 62 +++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index d45a33cb59a..4440728e357 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -26,12 +26,18 @@ else CMAKE_EXTRA_OPTS=(-Druntime_cxxmodules=OFF) fi -#Uncomment for a minimal build for debugging purposes +# Help old releases of cmake to find libblastrampoline.so. +[ -f "$libdir/libblastrampoline.so" ] && CMAKE_EXTRA_OPTS+=(-DBLAS_LIBRARIES="$libdir/libblastrampoline.so") + +# Required to compile graf3d/ftgl/src/FTVectoriser.cxx (for gcc to accept a conversion from char* to unsigned char*) +CMAKE_EXTRA_OPTS+=(-DCMAKE_CXX_FLAGS=-fpermissive) + +# Uncomment for a minimal build for debugging purposes #CMAKE_EXTRA_OPTS+=(-Dclad=OFF -Dhtml=OFF -Dwebgui=OFF -Dcxxmodules=OFF -Dproof=OFF -Dtmva=OFF -Drootfit=OFF -Dxproofd=OFF -Dxrootd=OFF -Dssl=OFF -Dpyroot=OFF -Dtesting=OFF -Droot7=OFF -Dspectrum=OFF -Dunfold=OFF -Dasimage=OFF -Dgviz=OFF -Dfitiso=OFF -Dcocoa=OFF -Dopengl=OFF -Dproof=OFF -Dxml=OFF -Dgfal=OFF -Dmpi=OFF) export SYSTEM_INCLUDE_PATH="`g++ --sysroot="/opt/$target/$target/sys-root" -E -x c++ -v /dev/null 2>&1 | awk '{gsub(\"^ \", \"\")} /End of search list/{a=0} {if(a==1){s=s d $0;d=":"}} /#include <...> search starts here/{a=1} END{print s}'`" -# build-in compilation of the libAfterImage library needs this directory +# built-in compilation of the libAfterImage library needs this directory mkdir -p /tmp/user/0 cd / @@ -134,10 +140,6 @@ cmake --install build --prefix $prefix install -Dvm 755 build/core/rootcling_stage1/src/rootcling_stage1 -t "${bindir}" """ -open("recipe.sh", "w") do io - println(io, script) -end - # Add to the recipe script commands to write the recipe in a file into the sandbox # to ease debugging with the --debug build_tarballs.jl option. scriptwrapper = """ @@ -176,38 +178,40 @@ products = Product[ # Dependencies that must be installed before this package can be built dependencies = [ #Mandatory dependencies - BuildDependency("Xorg_xorgproto_jll") - Dependency("Xorg_libX11_jll") - Dependency("Xorg_libXpm_jll") - Dependency("Xorg_libXft_jll") + BuildDependency(PackageSpec(name="Xorg_xorgproto_jll", uuid="c4d99508-4286-5418-9131-c86396af500b")) + Dependency(PackageSpec(name="Xorg_libX11_jll", uuid="4f6342f7-b3d2-589e-9d20-edeb45f2b2bc")) + Dependency(PackageSpec(name="Xorg_libXpm_jll", uuid="1a3ddb2d-74e3-57f3-a27b-e9b16291b4f2")) + Dependency(PackageSpec(name="Xorg_libXft_jll", uuid="2c808117-e144-5220-80d1-69d4eaa9352c")) #Optionnal dependencies (if absent, either a feature will be disabled or a built-in version will be compiled) - Dependency("VDT_jll") - Dependency("XRootD_jll") - Dependency(PackageSpec(name="LAPACK_jll", uuid="51474c39-65e3-53ba-86ba-03b1b862ec14")) - Dependency("Lz4_jll") + Dependency(PackageSpec(name="VDT_jll", uuid="474730fa-5ea9-5b8c-8629-63de62f23418")) + Dependency(PackageSpec(name="XRootD_jll", uuid="b6113df7-b24e-50c0-846f-35a2e36cb9d5")) + Dependency(PackageSpec(name="Lz4_jll", uuid="5ced341a-0733-55b8-9ab6-a4889d929147")) Dependency(PackageSpec(name="FFTW_jll", uuid="f5851436-0d7a-5f13-b9de-f02708fd171a")) Dependency(PackageSpec(name="Giflib_jll", uuid="59f7168a-df46-5410-90c8-f2779963d0ec")) Dependency(PackageSpec(name="Zstd_jll", uuid="3161d3a3-bdf6-5164-811a-617609db77b4")) Dependency(PackageSpec(name="PCRE2_jll", uuid="efcefdf7-47ab-520b-bdef-62a2eaa19f15")) Dependency(PackageSpec(name="Graphviz_jll", uuid="3c863552-8265-54e4-a6dc-903eb78fde85")) Dependency(PackageSpec(name="xxHash_jll", uuid="5fdcd639-92d1-5a06-bf6b-28f2061df1a9")) - Dependency("XZ_jll") + Dependency(PackageSpec(name="XZ_jll", uuid="ffd25f8a-64ca-5728-b0f7-c24cf3aae800")) Dependency(PackageSpec(name="Librsvg_jll", uuid="925c91fb-5dd6-59dd-8e8c-345e74382d89")) - Dependency("FreeType2_jll") - Dependency("Xorg_libICE_jll") - Dependency("Xorg_libSM_jll") - Dependency("Xorg_libXfixes_jll") - Dependency("Xorg_libXi_jll") - Dependency("Xorg_libXinerama_jll") - Dependency("Xorg_libXmu_jll") - Dependency("Xorg_libXt_jll") - Dependency("Xorg_libXtst_jll") - Dependency("Xorg_xcb_util_jll") - Dependency("Xorg_libxkbfile_jll") - Dependency("Libglvnd_jll") - Dependency("OpenBLAS_jll") - Dependency("oneTBB_jll", compat="2021.9.0") + Dependency(PackageSpec(name="FreeType2_jll", uuid="d7e528f0-a631-5988-bf34-fe36492bcfd7")) + Dependency(PackageSpec(name="Xorg_libICE_jll", uuid="f67eecfb-183a-506d-b269-f58e52b52d7c")) + Dependency(PackageSpec(name="Xorg_libSM_jll", uuid="c834827a-8449-5923-a945-d239c165b7dd")) + Dependency(PackageSpec(name="Xorg_libXfixes_jll", uuid="d091e8ba-531a-589c-9de9-94069b037ed8")) + Dependency(PackageSpec(name="Xorg_libXi_jll", uuid="a51aa0fd-4e3c-5386-b890-e753decda492")) + Dependency(PackageSpec(name="Xorg_libXinerama_jll", uuid="d1454406-59df-5ea1-beac-c340f2130bc3")) + Dependency(PackageSpec(name="Xorg_libXmu_jll", uuid="6bc1fdef-f8f4-516b-84c1-6f5f86a35b20")) + Dependency(PackageSpec(name="Xorg_libXt_jll", uuid="28c4a263-0105-5ca0-9a8c-f4f6b89a1dd4")) + Dependency(PackageSpec(name="Xorg_libXtst_jll", uuid="b6f176f1-7aea-5357-ad67-1d3e565ea1c6")) + Dependency(PackageSpec(name="Xorg_xcb_util_jll", uuid="2def613f-5ad1-5310-b15b-b15d46f528f5")) + Dependency(PackageSpec(name="Xorg_libxkbfile_jll", uuid="cc61e674-0454-545c-8b26-ed2c68acab7a")) + Dependency(PackageSpec(name="Libglvnd_jll", uuid="7e76a0d4-f3c7-5321-8279-8d96eeed0f29")) + Dependency(PackageSpec(name="GLU_jll", uuid="bd17208b-e95e-5925-bf81-e2f59b3e5c61")) + Dependency(PackageSpec(name="GLEW_jll", uuid="bde7f898-03f7-559e-8810-194d950ce600")) + Dependency(PackageSpec(name="nlohmann_json_jll", uuid="7c7c7bd4-5f1c-5db3-8b3f-fcf8282f06da")) + Dependency(PackageSpec(name="CFITSIO_jll", uuid="b3e40c51-02ae-5482-8a39-3ace5868dcf4")) + Dependency(PackageSpec(name="oneTBB_jll", uuid="1317d2d5-d96f-522e-a858-c73665f53c3e"), compat="2021.9.0") ] # Build the tarballs, and possibly a `build.jl` as well. From 4ca3d9d11cb83b17cb76c67efd2028ea85dd1bfd Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Mon, 17 Feb 2025 16:57:31 +0100 Subject: [PATCH 13/30] Add diagnostic on kill and remove LLVM link jobs limits Previous buildkite CI timed out with message "Received cancellation signal, interrupting." With this commit we attempt to trap kill signal and display stats on running processes before exiting. Measurements done to debug the issue show a lower LLVM link command memory footprint than anticipated. Removed the limit on number of LLVM link jobs, --- R/ROOT/build_tarballs.jl | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 4440728e357..b6a54f8489e 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -18,6 +18,26 @@ sources = [ # Bash recipe for building across all platforms script = raw""" +onkill(){ + echo "Signal $1 received. List running processes for diagnostic." 1>&2 + top -b -n 1 + exit $((128+$2)) +} + +trap "onkill SIGTERM 15" SIGTERM +trap "onkill SIGQUIT 3" SIGQUIT +trap "onkill SIGXCPU 24" SIGXCPU + +echo "Mem. stat:" +free -h + +echo -e "nproc command tells: " +nproc + +echo BINARYBUILDER_NPROC = """ * get(ENV, "BINARYBUILDER_NPROC", "") * raw"""; + +echo "nproc (variable) = $nproc" + cd $WORKSPACE if echo "$target" | grep -q musl; then #build wih musl library # Disabling what is not working with musl: @@ -54,9 +74,11 @@ sed -i 's/\(option(LLVM_INCLUDE_TESTS[[:space:]].*[[:space:]]\)on)\(.*\)/\1OFF)\ srcdir/root/interpreter/llvm-project/llvm/CMakeLists.txt echo "set(CXX_STANDARD 17)" >> srcdir/root/interpreter/llvm-project/llvm/CMakeLists.txt -# N llvm links. LLVM link command needs 15GB njobs=${nproc} -LLVM_PARALLEL_LINK_JOBS=`grep MemTot /proc/meminfo | awk '{a=int($2/15100000); if(a>'"$njobs"') a='"$njobs"'; if(a<1) a=1; print a;}'` + +# Uncomment next line to limit number of LLVM link commands run in parallel and reduce memory usage. +# LLVM doc refers 15GB per link job. Measurements with this build shows a 0.7 GByte max. RSS usage, suggesting that the limitation is not needed. +# LLVM_PARALLEL_LINK_JOBS=`grep MemTot /proc/meminfo | awk '{a=int($2/15100000); if(a>'"$njobs"') a='"$njobs"'; if(a<1) a=1; print a;}'` # For the rootcling execution performed during the build: echo "include_directories(SYSTEM /opt/$target/$target/sys-root/usr/include)" >> ${CMAKE_TARGET_TOOLCHAIN} From c8b7c6a97f4fd2bf2cfbf8e28a1b558d4bc5097b Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Mon, 17 Feb 2025 21:24:25 +0100 Subject: [PATCH 14/30] Remove signal trap and change linker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signal trap did not work. Mosè suggested to try with ldd linker. --- R/ROOT/build_tarballs.jl | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index b6a54f8489e..188c07ad09d 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -18,16 +18,6 @@ sources = [ # Bash recipe for building across all platforms script = raw""" -onkill(){ - echo "Signal $1 received. List running processes for diagnostic." 1>&2 - top -b -n 1 - exit $((128+$2)) -} - -trap "onkill SIGTERM 15" SIGTERM -trap "onkill SIGQUIT 3" SIGQUIT -trap "onkill SIGXCPU 24" SIGXCPU - echo "Mem. stat:" free -h @@ -52,6 +42,9 @@ fi # Required to compile graf3d/ftgl/src/FTVectoriser.cxx (for gcc to accept a conversion from char* to unsigned char*) CMAKE_EXTRA_OPTS+=(-DCMAKE_CXX_FLAGS=-fpermissive) +# See https://github.com/JuliaPackaging/Yggdrasil/pull/9300#issuecomment-2662634111 +CMAKE_EXTRA_OPTS+=(-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld) + # Uncomment for a minimal build for debugging purposes #CMAKE_EXTRA_OPTS+=(-Dclad=OFF -Dhtml=OFF -Dwebgui=OFF -Dcxxmodules=OFF -Dproof=OFF -Dtmva=OFF -Drootfit=OFF -Dxproofd=OFF -Dxrootd=OFF -Dssl=OFF -Dpyroot=OFF -Dtesting=OFF -Droot7=OFF -Dspectrum=OFF -Dunfold=OFF -Dasimage=OFF -Dgviz=OFF -Dfitiso=OFF -Dcocoa=OFF -Dopengl=OFF -Dproof=OFF -Dxml=OFF -Dgfal=OFF -Dmpi=OFF) From 160be3eb92aecadd3308c7eb174b3de820003b22 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Mon, 17 Feb 2025 21:54:40 +0100 Subject: [PATCH 15/30] add util_linux_jll dependencies ldd error has indicated that libuuid is missing. --- R/ROOT/build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 188c07ad09d..3a46a6bb584 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -197,6 +197,7 @@ dependencies = [ Dependency(PackageSpec(name="Xorg_libX11_jll", uuid="4f6342f7-b3d2-589e-9d20-edeb45f2b2bc")) Dependency(PackageSpec(name="Xorg_libXpm_jll", uuid="1a3ddb2d-74e3-57f3-a27b-e9b16291b4f2")) Dependency(PackageSpec(name="Xorg_libXft_jll", uuid="2c808117-e144-5220-80d1-69d4eaa9352c")) + Dependency(PackageSpec(name="util_linux_jll", uuid="a762b42e-dc87-5958-a639-9c9eec9c0153")) #Optionnal dependencies (if absent, either a feature will be disabled or a built-in version will be compiled) Dependency(PackageSpec(name="VDT_jll", uuid="474730fa-5ea9-5b8c-8629-63de62f23418")) From f224810a524eb7d1fdf9883c008d99ee0d18f7c5 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Mon, 17 Feb 2025 22:19:13 +0100 Subject: [PATCH 16/30] rollback previous commit and switched off Davix Adding util_linux_jll did not solve missing uuid_gen symbol error. Remove it and switch off Davix build. --- R/ROOT/build_tarballs.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 3a46a6bb584..41c7f32ecce 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -48,6 +48,9 @@ CMAKE_EXTRA_OPTS+=(-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld) # Uncomment for a minimal build for debugging purposes #CMAKE_EXTRA_OPTS+=(-Dclad=OFF -Dhtml=OFF -Dwebgui=OFF -Dcxxmodules=OFF -Dproof=OFF -Dtmva=OFF -Drootfit=OFF -Dxproofd=OFF -Dxrootd=OFF -Dssl=OFF -Dpyroot=OFF -Dtesting=OFF -Droot7=OFF -Dspectrum=OFF -Dunfold=OFF -Dasimage=OFF -Dgviz=OFF -Dfitiso=OFF -Dcocoa=OFF -Dopengl=OFF -Dproof=OFF -Dxml=OFF -Dgfal=OFF -Dmpi=OFF) +# We experience issue with building Davix on buildkite CI (not clear why not reproducible with local build). Switch it off. +CMAKE_EXTRA_OPTS+=(-Ddavix=OFF) + export SYSTEM_INCLUDE_PATH="`g++ --sysroot="/opt/$target/$target/sys-root" -E -x c++ -v /dev/null 2>&1 | awk '{gsub(\"^ \", \"\")} /End of search list/{a=0} {if(a==1){s=s d $0;d=":"}} /#include <...> search starts here/{a=1} END{print s}'`" # built-in compilation of the libAfterImage library needs this directory @@ -115,7 +118,6 @@ if [ $target != $MACHTYPE ]; then #cross compilation -DCLING_TARGET_GLIBC=1 \ -DCLING_TARGET_GLIBCXX=1 \ -DCLING_SYSTEM_INCLUDE_PATH="$SYSTEM_INCLUDE_PATH" \ - -Ddavix=OFF \ -B NATIVE -S srcdir/root cmake --build NATIVE -- -j$njobs rootcling_stage1 rootcling llvm-tblgen clang-tblgen llvm-config llvm-symbolizer @@ -197,7 +199,6 @@ dependencies = [ Dependency(PackageSpec(name="Xorg_libX11_jll", uuid="4f6342f7-b3d2-589e-9d20-edeb45f2b2bc")) Dependency(PackageSpec(name="Xorg_libXpm_jll", uuid="1a3ddb2d-74e3-57f3-a27b-e9b16291b4f2")) Dependency(PackageSpec(name="Xorg_libXft_jll", uuid="2c808117-e144-5220-80d1-69d4eaa9352c")) - Dependency(PackageSpec(name="util_linux_jll", uuid="a762b42e-dc87-5958-a639-9c9eec9c0153")) #Optionnal dependencies (if absent, either a feature will be disabled or a built-in version will be compiled) Dependency(PackageSpec(name="VDT_jll", uuid="474730fa-5ea9-5b8c-8629-63de62f23418")) From 5128e8c815d9798eaeccc9689636653f1121baea Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Mon, 17 Feb 2025 22:48:48 +0100 Subject: [PATCH 17/30] Trying Unix Makefile to solve CI build issue --- R/ROOT/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 41c7f32ecce..5dc40bd18e2 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -135,7 +135,7 @@ fi # the same sysroot option as for compilation. export CPLUS_INCLUDE_PATH="$SYSTEM_INCLUDE_PATH" mkdir build -cmake -GNinja \ +cmake -G"Unix Makefiles" \ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ -DCMAKE_INSTALL_PREFIX=$prefix \ -DLLVM_HOST_TRIPLE=$target \ From 0680bb0fc75d7993b282e874737e608e0e4f8f46 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Mon, 17 Feb 2025 23:31:49 +0100 Subject: [PATCH 18/30] Revert to ninja and try CCACHE_RECACHE --- R/ROOT/build_tarballs.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 5dc40bd18e2..c8f9f472895 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -18,6 +18,9 @@ sources = [ # Bash recipe for building across all platforms script = raw""" + +CCACHE_RECACHE=y + echo "Mem. stat:" free -h @@ -135,7 +138,7 @@ fi # the same sysroot option as for compilation. export CPLUS_INCLUDE_PATH="$SYSTEM_INCLUDE_PATH" mkdir build -cmake -G"Unix Makefiles" \ +cmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ -DCMAKE_INSTALL_PREFIX=$prefix \ -DLLVM_HOST_TRIPLE=$target \ From fdd7971feffeba18cbc7d4d2315bff8eed75f9c9 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Mon, 17 Feb 2025 23:57:18 +0100 Subject: [PATCH 19/30] export CCACHE_RECACHE --- R/ROOT/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index c8f9f472895..50ad9951a80 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -19,7 +19,7 @@ sources = [ # Bash recipe for building across all platforms script = raw""" -CCACHE_RECACHE=y +export CCACHE_RECACHE=y echo "Mem. stat:" free -h From a4e316111ff0d88ca0d19408ee9c03b6ad9ae801 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 09:23:00 +0100 Subject: [PATCH 20/30] Attempt CI with less output lines --- R/ROOT/build_tarballs.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 50ad9951a80..c3f0d6f1f7b 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -19,7 +19,7 @@ sources = [ # Bash recipe for building across all platforms script = raw""" -export CCACHE_RECACHE=y +#export CCACHE_RECACHE=y echo "Mem. stat:" free -h @@ -123,7 +123,8 @@ if [ $target != $MACHTYPE ]; then #cross compilation -DCLING_SYSTEM_INCLUDE_PATH="$SYSTEM_INCLUDE_PATH" \ -B NATIVE -S srcdir/root - cmake --build NATIVE -- -j$njobs rootcling_stage1 rootcling llvm-tblgen clang-tblgen llvm-config llvm-symbolizer + echo "Bootstrap: building tools needed to run on host for the target build..." + cmake --build NATIVE -- -j$njobs rootcling_stage1 rootcling llvm-tblgen clang-tblgen llvm-config llvm-symbolizer 1> /dev/null CMAKE_EXTRA_OPTS+=($CMAKE_EXTRA_OPTS "-DNATIVE_BINARY_DIR=$PWD/NATIVE" \ "-DLLVM_TABLEGEN=$PWD/NATIVE/interpreter/llvm-project/llvm/bin/llvm-tblgen" \ From 1ecdae0bfee28051df8c1711f7c22a8a73118511 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 09:36:33 +0100 Subject: [PATCH 21/30] Second build with a single job for debugging --- R/ROOT/build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index c3f0d6f1f7b..22eb4afaf07 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -154,6 +154,7 @@ cmake -GNinja \ -B build -S srcdir/root # Build the code +njobs=1 cmake --build build -j${njobs} # Install the binaries From 7cd0c04fa98785fb1fa41e8bf331d69a23e2fc34 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 17:57:49 +0100 Subject: [PATCH 22/30] Roll back to version before the CI issue in view of introducing changes piece by piece --- R/ROOT/build_tarballs.jl | 92 ++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 59 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 22eb4afaf07..d45a33cb59a 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -18,19 +18,6 @@ sources = [ # Bash recipe for building across all platforms script = raw""" - -#export CCACHE_RECACHE=y - -echo "Mem. stat:" -free -h - -echo -e "nproc command tells: " -nproc - -echo BINARYBUILDER_NPROC = """ * get(ENV, "BINARYBUILDER_NPROC", "") * raw"""; - -echo "nproc (variable) = $nproc" - cd $WORKSPACE if echo "$target" | grep -q musl; then #build wih musl library # Disabling what is not working with musl: @@ -39,24 +26,12 @@ else CMAKE_EXTRA_OPTS=(-Druntime_cxxmodules=OFF) fi -# Help old releases of cmake to find libblastrampoline.so. -[ -f "$libdir/libblastrampoline.so" ] && CMAKE_EXTRA_OPTS+=(-DBLAS_LIBRARIES="$libdir/libblastrampoline.so") - -# Required to compile graf3d/ftgl/src/FTVectoriser.cxx (for gcc to accept a conversion from char* to unsigned char*) -CMAKE_EXTRA_OPTS+=(-DCMAKE_CXX_FLAGS=-fpermissive) - -# See https://github.com/JuliaPackaging/Yggdrasil/pull/9300#issuecomment-2662634111 -CMAKE_EXTRA_OPTS+=(-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld) - -# Uncomment for a minimal build for debugging purposes +#Uncomment for a minimal build for debugging purposes #CMAKE_EXTRA_OPTS+=(-Dclad=OFF -Dhtml=OFF -Dwebgui=OFF -Dcxxmodules=OFF -Dproof=OFF -Dtmva=OFF -Drootfit=OFF -Dxproofd=OFF -Dxrootd=OFF -Dssl=OFF -Dpyroot=OFF -Dtesting=OFF -Droot7=OFF -Dspectrum=OFF -Dunfold=OFF -Dasimage=OFF -Dgviz=OFF -Dfitiso=OFF -Dcocoa=OFF -Dopengl=OFF -Dproof=OFF -Dxml=OFF -Dgfal=OFF -Dmpi=OFF) -# We experience issue with building Davix on buildkite CI (not clear why not reproducible with local build). Switch it off. -CMAKE_EXTRA_OPTS+=(-Ddavix=OFF) - export SYSTEM_INCLUDE_PATH="`g++ --sysroot="/opt/$target/$target/sys-root" -E -x c++ -v /dev/null 2>&1 | awk '{gsub(\"^ \", \"\")} /End of search list/{a=0} {if(a==1){s=s d $0;d=":"}} /#include <...> search starts here/{a=1} END{print s}'`" -# built-in compilation of the libAfterImage library needs this directory +# build-in compilation of the libAfterImage library needs this directory mkdir -p /tmp/user/0 cd / @@ -73,11 +48,9 @@ sed -i 's/\(option(LLVM_INCLUDE_TESTS[[:space:]].*[[:space:]]\)on)\(.*\)/\1OFF)\ srcdir/root/interpreter/llvm-project/llvm/CMakeLists.txt echo "set(CXX_STANDARD 17)" >> srcdir/root/interpreter/llvm-project/llvm/CMakeLists.txt +# N llvm links. LLVM link command needs 15GB njobs=${nproc} - -# Uncomment next line to limit number of LLVM link commands run in parallel and reduce memory usage. -# LLVM doc refers 15GB per link job. Measurements with this build shows a 0.7 GByte max. RSS usage, suggesting that the limitation is not needed. -# LLVM_PARALLEL_LINK_JOBS=`grep MemTot /proc/meminfo | awk '{a=int($2/15100000); if(a>'"$njobs"') a='"$njobs"'; if(a<1) a=1; print a;}'` +LLVM_PARALLEL_LINK_JOBS=`grep MemTot /proc/meminfo | awk '{a=int($2/15100000); if(a>'"$njobs"') a='"$njobs"'; if(a<1) a=1; print a;}'` # For the rootcling execution performed during the build: echo "include_directories(SYSTEM /opt/$target/$target/sys-root/usr/include)" >> ${CMAKE_TARGET_TOOLCHAIN} @@ -121,10 +94,10 @@ if [ $target != $MACHTYPE ]; then #cross compilation -DCLING_TARGET_GLIBC=1 \ -DCLING_TARGET_GLIBCXX=1 \ -DCLING_SYSTEM_INCLUDE_PATH="$SYSTEM_INCLUDE_PATH" \ + -Ddavix=OFF \ -B NATIVE -S srcdir/root - echo "Bootstrap: building tools needed to run on host for the target build..." - cmake --build NATIVE -- -j$njobs rootcling_stage1 rootcling llvm-tblgen clang-tblgen llvm-config llvm-symbolizer 1> /dev/null + cmake --build NATIVE -- -j$njobs rootcling_stage1 rootcling llvm-tblgen clang-tblgen llvm-config llvm-symbolizer CMAKE_EXTRA_OPTS+=($CMAKE_EXTRA_OPTS "-DNATIVE_BINARY_DIR=$PWD/NATIVE" \ "-DLLVM_TABLEGEN=$PWD/NATIVE/interpreter/llvm-project/llvm/bin/llvm-tblgen" \ @@ -154,7 +127,6 @@ cmake -GNinja \ -B build -S srcdir/root # Build the code -njobs=1 cmake --build build -j${njobs} # Install the binaries @@ -162,6 +134,10 @@ cmake --install build --prefix $prefix install -Dvm 755 build/core/rootcling_stage1/src/rootcling_stage1 -t "${bindir}" """ +open("recipe.sh", "w") do io + println(io, script) +end + # Add to the recipe script commands to write the recipe in a file into the sandbox # to ease debugging with the --debug build_tarballs.jl option. scriptwrapper = """ @@ -200,40 +176,38 @@ products = Product[ # Dependencies that must be installed before this package can be built dependencies = [ #Mandatory dependencies - BuildDependency(PackageSpec(name="Xorg_xorgproto_jll", uuid="c4d99508-4286-5418-9131-c86396af500b")) - Dependency(PackageSpec(name="Xorg_libX11_jll", uuid="4f6342f7-b3d2-589e-9d20-edeb45f2b2bc")) - Dependency(PackageSpec(name="Xorg_libXpm_jll", uuid="1a3ddb2d-74e3-57f3-a27b-e9b16291b4f2")) - Dependency(PackageSpec(name="Xorg_libXft_jll", uuid="2c808117-e144-5220-80d1-69d4eaa9352c")) + BuildDependency("Xorg_xorgproto_jll") + Dependency("Xorg_libX11_jll") + Dependency("Xorg_libXpm_jll") + Dependency("Xorg_libXft_jll") #Optionnal dependencies (if absent, either a feature will be disabled or a built-in version will be compiled) - Dependency(PackageSpec(name="VDT_jll", uuid="474730fa-5ea9-5b8c-8629-63de62f23418")) - Dependency(PackageSpec(name="XRootD_jll", uuid="b6113df7-b24e-50c0-846f-35a2e36cb9d5")) - Dependency(PackageSpec(name="Lz4_jll", uuid="5ced341a-0733-55b8-9ab6-a4889d929147")) + Dependency("VDT_jll") + Dependency("XRootD_jll") + Dependency(PackageSpec(name="LAPACK_jll", uuid="51474c39-65e3-53ba-86ba-03b1b862ec14")) + Dependency("Lz4_jll") Dependency(PackageSpec(name="FFTW_jll", uuid="f5851436-0d7a-5f13-b9de-f02708fd171a")) Dependency(PackageSpec(name="Giflib_jll", uuid="59f7168a-df46-5410-90c8-f2779963d0ec")) Dependency(PackageSpec(name="Zstd_jll", uuid="3161d3a3-bdf6-5164-811a-617609db77b4")) Dependency(PackageSpec(name="PCRE2_jll", uuid="efcefdf7-47ab-520b-bdef-62a2eaa19f15")) Dependency(PackageSpec(name="Graphviz_jll", uuid="3c863552-8265-54e4-a6dc-903eb78fde85")) Dependency(PackageSpec(name="xxHash_jll", uuid="5fdcd639-92d1-5a06-bf6b-28f2061df1a9")) - Dependency(PackageSpec(name="XZ_jll", uuid="ffd25f8a-64ca-5728-b0f7-c24cf3aae800")) + Dependency("XZ_jll") Dependency(PackageSpec(name="Librsvg_jll", uuid="925c91fb-5dd6-59dd-8e8c-345e74382d89")) - Dependency(PackageSpec(name="FreeType2_jll", uuid="d7e528f0-a631-5988-bf34-fe36492bcfd7")) - Dependency(PackageSpec(name="Xorg_libICE_jll", uuid="f67eecfb-183a-506d-b269-f58e52b52d7c")) - Dependency(PackageSpec(name="Xorg_libSM_jll", uuid="c834827a-8449-5923-a945-d239c165b7dd")) - Dependency(PackageSpec(name="Xorg_libXfixes_jll", uuid="d091e8ba-531a-589c-9de9-94069b037ed8")) - Dependency(PackageSpec(name="Xorg_libXi_jll", uuid="a51aa0fd-4e3c-5386-b890-e753decda492")) - Dependency(PackageSpec(name="Xorg_libXinerama_jll", uuid="d1454406-59df-5ea1-beac-c340f2130bc3")) - Dependency(PackageSpec(name="Xorg_libXmu_jll", uuid="6bc1fdef-f8f4-516b-84c1-6f5f86a35b20")) - Dependency(PackageSpec(name="Xorg_libXt_jll", uuid="28c4a263-0105-5ca0-9a8c-f4f6b89a1dd4")) - Dependency(PackageSpec(name="Xorg_libXtst_jll", uuid="b6f176f1-7aea-5357-ad67-1d3e565ea1c6")) - Dependency(PackageSpec(name="Xorg_xcb_util_jll", uuid="2def613f-5ad1-5310-b15b-b15d46f528f5")) - Dependency(PackageSpec(name="Xorg_libxkbfile_jll", uuid="cc61e674-0454-545c-8b26-ed2c68acab7a")) - Dependency(PackageSpec(name="Libglvnd_jll", uuid="7e76a0d4-f3c7-5321-8279-8d96eeed0f29")) - Dependency(PackageSpec(name="GLU_jll", uuid="bd17208b-e95e-5925-bf81-e2f59b3e5c61")) - Dependency(PackageSpec(name="GLEW_jll", uuid="bde7f898-03f7-559e-8810-194d950ce600")) - Dependency(PackageSpec(name="nlohmann_json_jll", uuid="7c7c7bd4-5f1c-5db3-8b3f-fcf8282f06da")) - Dependency(PackageSpec(name="CFITSIO_jll", uuid="b3e40c51-02ae-5482-8a39-3ace5868dcf4")) - Dependency(PackageSpec(name="oneTBB_jll", uuid="1317d2d5-d96f-522e-a858-c73665f53c3e"), compat="2021.9.0") + Dependency("FreeType2_jll") + Dependency("Xorg_libICE_jll") + Dependency("Xorg_libSM_jll") + Dependency("Xorg_libXfixes_jll") + Dependency("Xorg_libXi_jll") + Dependency("Xorg_libXinerama_jll") + Dependency("Xorg_libXmu_jll") + Dependency("Xorg_libXt_jll") + Dependency("Xorg_libXtst_jll") + Dependency("Xorg_xcb_util_jll") + Dependency("Xorg_libxkbfile_jll") + Dependency("Libglvnd_jll") + Dependency("OpenBLAS_jll") + Dependency("oneTBB_jll", compat="2021.9.0") ] # Build the tarballs, and possibly a `build.jl` as well. From 7583a3910f3a25260956a10e4788264dd715986c Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 18:06:15 +0100 Subject: [PATCH 23/30] remove LAPACK and OpenBLAS _jll dependencies --- R/ROOT/build_tarballs.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index d45a33cb59a..9dc0d3cf270 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -26,7 +26,13 @@ else CMAKE_EXTRA_OPTS=(-Druntime_cxxmodules=OFF) fi -#Uncomment for a minimal build for debugging purposes +# Help old releases of cmake to find libblastrampoline.so. +[ -f "$libdir/libblastrampoline.so" ] && CMAKE_EXTRA_OPTS+=(-DBLAS_LIBRARIES="$libdir/libblastrampoline.so") + +# Required to compile graf3d/ftgl/src/FTVectoriser.cxx (for gcc to accept a conversion from char* to unsigned char*) +CMAKE_EXTRA_OPTS+=(-DCMAKE_CXX_FLAGS=-fpermissive) + +# Uncomment for a minimal build for debugging purposes #CMAKE_EXTRA_OPTS+=(-Dclad=OFF -Dhtml=OFF -Dwebgui=OFF -Dcxxmodules=OFF -Dproof=OFF -Dtmva=OFF -Drootfit=OFF -Dxproofd=OFF -Dxrootd=OFF -Dssl=OFF -Dpyroot=OFF -Dtesting=OFF -Droot7=OFF -Dspectrum=OFF -Dunfold=OFF -Dasimage=OFF -Dgviz=OFF -Dfitiso=OFF -Dcocoa=OFF -Dopengl=OFF -Dproof=OFF -Dxml=OFF -Dgfal=OFF -Dmpi=OFF) export SYSTEM_INCLUDE_PATH="`g++ --sysroot="/opt/$target/$target/sys-root" -E -x c++ -v /dev/null 2>&1 | awk '{gsub(\"^ \", \"\")} /End of search list/{a=0} {if(a==1){s=s d $0;d=":"}} /#include <...> search starts here/{a=1} END{print s}'`" @@ -134,10 +140,6 @@ cmake --install build --prefix $prefix install -Dvm 755 build/core/rootcling_stage1/src/rootcling_stage1 -t "${bindir}" """ -open("recipe.sh", "w") do io - println(io, script) -end - # Add to the recipe script commands to write the recipe in a file into the sandbox # to ease debugging with the --debug build_tarballs.jl option. scriptwrapper = """ @@ -184,7 +186,6 @@ dependencies = [ #Optionnal dependencies (if absent, either a feature will be disabled or a built-in version will be compiled) Dependency("VDT_jll") Dependency("XRootD_jll") - Dependency(PackageSpec(name="LAPACK_jll", uuid="51474c39-65e3-53ba-86ba-03b1b862ec14")) Dependency("Lz4_jll") Dependency(PackageSpec(name="FFTW_jll", uuid="f5851436-0d7a-5f13-b9de-f02708fd171a")) Dependency(PackageSpec(name="Giflib_jll", uuid="59f7168a-df46-5410-90c8-f2779963d0ec")) @@ -206,7 +207,6 @@ dependencies = [ Dependency("Xorg_xcb_util_jll") Dependency("Xorg_libxkbfile_jll") Dependency("Libglvnd_jll") - Dependency("OpenBLAS_jll") Dependency("oneTBB_jll", compat="2021.9.0") ] From 8ae7955c0c88f70fc37c705f9cb6b848b5ba197c Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 19:37:26 +0100 Subject: [PATCH 24/30] add GLU_jll dependency --- R/ROOT/build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 9dc0d3cf270..353df99ca08 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -207,6 +207,7 @@ dependencies = [ Dependency("Xorg_xcb_util_jll") Dependency("Xorg_libxkbfile_jll") Dependency("Libglvnd_jll") + Dependency(PackageSpec(name="GLU_jll", uuid="bd17208b-e95e-5925-bf81-e2f59b3e5c61")) Dependency("oneTBB_jll", compat="2021.9.0") ] From 71580c882693dd105e6d859565c3bdb7dadbc05b Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 20:02:27 +0100 Subject: [PATCH 25/30] add GLEW_jll dependency --- R/ROOT/build_tarballs.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 353df99ca08..5e04c5bf15e 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -18,6 +18,9 @@ sources = [ # Bash recipe for building across all platforms script = raw""" + +echo USE_CCACHE: $USE_CCACHE + cd $WORKSPACE if echo "$target" | grep -q musl; then #build wih musl library # Disabling what is not working with musl: @@ -208,6 +211,7 @@ dependencies = [ Dependency("Xorg_libxkbfile_jll") Dependency("Libglvnd_jll") Dependency(PackageSpec(name="GLU_jll", uuid="bd17208b-e95e-5925-bf81-e2f59b3e5c61")) + Dependency(PackageSpec(name="GLEW_jll", uuid="bde7f898-03f7-559e-8810-194d950ce600")) Dependency("oneTBB_jll", compat="2021.9.0") ] From 3c906f2c6236bf19633463e97fd5cc0bc4ac085e Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 20:13:21 +0100 Subject: [PATCH 26/30] add nlohmann_json_jll dependency --- R/ROOT/build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 5e04c5bf15e..48fd321de13 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -212,6 +212,7 @@ dependencies = [ Dependency("Libglvnd_jll") Dependency(PackageSpec(name="GLU_jll", uuid="bd17208b-e95e-5925-bf81-e2f59b3e5c61")) Dependency(PackageSpec(name="GLEW_jll", uuid="bde7f898-03f7-559e-8810-194d950ce600")) + Dependency(PackageSpec(name="nlohmann_json_jll", uuid="7c7c7bd4-5f1c-5db3-8b3f-fcf8282f06da")) Dependency("oneTBB_jll", compat="2021.9.0") ] From 13aedcb1e32c232d2ac4ba22404398853eb5b475 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 22:51:03 +0100 Subject: [PATCH 27/30] Revert "add nlohmann_json_jll dependency" This reverts commit 3c906f2c6236bf19633463e97fd5cc0bc4ac085e. --- R/ROOT/build_tarballs.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 48fd321de13..5e04c5bf15e 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -212,7 +212,6 @@ dependencies = [ Dependency("Libglvnd_jll") Dependency(PackageSpec(name="GLU_jll", uuid="bd17208b-e95e-5925-bf81-e2f59b3e5c61")) Dependency(PackageSpec(name="GLEW_jll", uuid="bde7f898-03f7-559e-8810-194d950ce600")) - Dependency(PackageSpec(name="nlohmann_json_jll", uuid="7c7c7bd4-5f1c-5db3-8b3f-fcf8282f06da")) Dependency("oneTBB_jll", compat="2021.9.0") ] From 151ef4b1f06d902c379c0c24a423ca2a26ab14be Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Tue, 18 Feb 2025 20:37:57 +0100 Subject: [PATCH 28/30] add CFITSIO_jll dependency --- R/ROOT/build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 5e04c5bf15e..4e106adad0e 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -212,6 +212,7 @@ dependencies = [ Dependency("Libglvnd_jll") Dependency(PackageSpec(name="GLU_jll", uuid="bd17208b-e95e-5925-bf81-e2f59b3e5c61")) Dependency(PackageSpec(name="GLEW_jll", uuid="bde7f898-03f7-559e-8810-194d950ce600")) + Dependency(PackageSpec(name="CFITSIO_jll", uuid="b3e40c51-02ae-5482-8a39-3ace5868dcf4")) Dependency("oneTBB_jll", compat="2021.9.0") ] From 4bf78abb80bd979084f6b823935bc3eb29f86e60 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Wed, 19 Feb 2025 08:11:18 +0100 Subject: [PATCH 29/30] add uuid of dependencies that missed it --- R/ROOT/build_tarballs.jl | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 4e106adad0e..7eeda6e2a9d 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -181,39 +181,39 @@ products = Product[ # Dependencies that must be installed before this package can be built dependencies = [ #Mandatory dependencies - BuildDependency("Xorg_xorgproto_jll") - Dependency("Xorg_libX11_jll") - Dependency("Xorg_libXpm_jll") - Dependency("Xorg_libXft_jll") + BuildDependency(PackageSpec(name="Xorg_xorgproto_jll", uuid="c4d99508-4286-5418-9131-c86396af500b")) + Dependency(PackageSpec(name="Xorg_libX11_jll", uuid="4f6342f7-b3d2-589e-9d20-edeb45f2b2bc")) + Dependency(PackageSpec(name="Xorg_libXpm_jll", uuid="1a3ddb2d-74e3-57f3-a27b-e9b16291b4f2")) + Dependency(PackageSpec(name="Xorg_libXft_jll", uuid="2c808117-e144-5220-80d1-69d4eaa9352c")) #Optionnal dependencies (if absent, either a feature will be disabled or a built-in version will be compiled) - Dependency("VDT_jll") - Dependency("XRootD_jll") - Dependency("Lz4_jll") + Dependency(PackageSpec(name="VDT_jll", uuid="474730fa-5ea9-5b8c-8629-63de62f23418")) + Dependency(PackageSpec(name="XRootD_jll", uuid="b6113df7-b24e-50c0-846f-35a2e36cb9d5")) + Dependency(PackageSpec(name="Lz4_jll", uuid="5ced341a-0733-55b8-9ab6-a4889d929147")) Dependency(PackageSpec(name="FFTW_jll", uuid="f5851436-0d7a-5f13-b9de-f02708fd171a")) Dependency(PackageSpec(name="Giflib_jll", uuid="59f7168a-df46-5410-90c8-f2779963d0ec")) Dependency(PackageSpec(name="Zstd_jll", uuid="3161d3a3-bdf6-5164-811a-617609db77b4")) Dependency(PackageSpec(name="PCRE2_jll", uuid="efcefdf7-47ab-520b-bdef-62a2eaa19f15")) Dependency(PackageSpec(name="Graphviz_jll", uuid="3c863552-8265-54e4-a6dc-903eb78fde85")) Dependency(PackageSpec(name="xxHash_jll", uuid="5fdcd639-92d1-5a06-bf6b-28f2061df1a9")) - Dependency("XZ_jll") + Dependency(PackageSpec(name="XZ_jll", uuid="ffd25f8a-64ca-5728-b0f7-c24cf3aae800")) Dependency(PackageSpec(name="Librsvg_jll", uuid="925c91fb-5dd6-59dd-8e8c-345e74382d89")) - Dependency("FreeType2_jll") - Dependency("Xorg_libICE_jll") - Dependency("Xorg_libSM_jll") - Dependency("Xorg_libXfixes_jll") - Dependency("Xorg_libXi_jll") - Dependency("Xorg_libXinerama_jll") - Dependency("Xorg_libXmu_jll") - Dependency("Xorg_libXt_jll") - Dependency("Xorg_libXtst_jll") - Dependency("Xorg_xcb_util_jll") - Dependency("Xorg_libxkbfile_jll") - Dependency("Libglvnd_jll") + Dependency(PackageSpec(name="FreeType2_jll", uuid="d7e528f0-a631-5988-bf34-fe36492bcfd7")) + Dependency(PackageSpec(name="Xorg_libICE_jll", uuid="f67eecfb-183a-506d-b269-f58e52b52d7c")) + Dependency(PackageSpec(name="Xorg_libSM_jll", uuid="c834827a-8449-5923-a945-d239c165b7dd")) + Dependency(PackageSpec(name="Xorg_libXfixes_jll", uuid="d091e8ba-531a-589c-9de9-94069b037ed8")) + Dependency(PackageSpec(name="Xorg_libXi_jll", uuid="a51aa0fd-4e3c-5386-b890-e753decda492")) + Dependency(PackageSpec(name="Xorg_libXinerama_jll", uuid="d1454406-59df-5ea1-beac-c340f2130bc3")) + Dependency(PackageSpec(name="Xorg_libXmu_jll", uuid="6bc1fdef-f8f4-516b-84c1-6f5f86a35b20")) + Dependency(PackageSpec(name="Xorg_libXt_jll", uuid="28c4a263-0105-5ca0-9a8c-f4f6b89a1dd4")) + Dependency(PackageSpec(name="Xorg_libXtst_jll", uuid="b6f176f1-7aea-5357-ad67-1d3e565ea1c6")) + Dependency(PackageSpec(name="Xorg_xcb_util_jll", uuid="2def613f-5ad1-5310-b15b-b15d46f528f5")) + Dependency(PackageSpec(name="Xorg_libxkbfile_jll", uuid="cc61e674-0454-545c-8b26-ed2c68acab7a")) + Dependency(PackageSpec(name="Libglvnd_jll", uuid="7e76a0d4-f3c7-5321-8279-8d96eeed0f29")) Dependency(PackageSpec(name="GLU_jll", uuid="bd17208b-e95e-5925-bf81-e2f59b3e5c61")) Dependency(PackageSpec(name="GLEW_jll", uuid="bde7f898-03f7-559e-8810-194d950ce600")) Dependency(PackageSpec(name="CFITSIO_jll", uuid="b3e40c51-02ae-5482-8a39-3ace5868dcf4")) - Dependency("oneTBB_jll", compat="2021.9.0") + Dependency(PackageSpec(name="oneTBB_jll", uuid="1317d2d5-d96f-522e-a858-c73665f53c3e"), compat="2021.9.0") ] # Build the tarballs, and possibly a `build.jl` as well. From 7efc7f9dcc7ad54523949f63384f1bfb2fe162fc Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Wed, 19 Feb 2025 08:57:10 +0100 Subject: [PATCH 30/30] fix blas depedency using OpenBLAS32 since ROOT uses the PL64 interface --- R/ROOT/build_tarballs.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/R/ROOT/build_tarballs.jl b/R/ROOT/build_tarballs.jl index 7eeda6e2a9d..db82efd8ef6 100644 --- a/R/ROOT/build_tarballs.jl +++ b/R/ROOT/build_tarballs.jl @@ -29,9 +29,6 @@ else CMAKE_EXTRA_OPTS=(-Druntime_cxxmodules=OFF) fi -# Help old releases of cmake to find libblastrampoline.so. -[ -f "$libdir/libblastrampoline.so" ] && CMAKE_EXTRA_OPTS+=(-DBLAS_LIBRARIES="$libdir/libblastrampoline.so") - # Required to compile graf3d/ftgl/src/FTVectoriser.cxx (for gcc to accept a conversion from char* to unsigned char*) CMAKE_EXTRA_OPTS+=(-DCMAKE_CXX_FLAGS=-fpermissive) @@ -214,6 +211,7 @@ dependencies = [ Dependency(PackageSpec(name="GLEW_jll", uuid="bde7f898-03f7-559e-8810-194d950ce600")) Dependency(PackageSpec(name="CFITSIO_jll", uuid="b3e40c51-02ae-5482-8a39-3ace5868dcf4")) Dependency(PackageSpec(name="oneTBB_jll", uuid="1317d2d5-d96f-522e-a858-c73665f53c3e"), compat="2021.9.0") + Dependency(PackageSpec(name="OpenBLAS32", uuid="51095b67-9e93-468d-a683-508b52f74e81")) ] # Build the tarballs, and possibly a `build.jl` as well.