diff --git a/FairSoftConfig.cmake b/FairSoftConfig.cmake index 115c11fca..4485bfa02 100644 --- a/FairSoftConfig.cmake +++ b/FairSoftConfig.cmake @@ -74,7 +74,7 @@ endif() # `brew` contains some logic to detect installed SDKs on your machine and can choose the latest. # Since we anyways depend on brew, let's use it. # -if(APPLE) +if(APPLE AND NOT CMAKE_OSX_SYSROOT) execute_process(COMMAND brew ruby -e "puts MacOS.sdk_path" OUTPUT_VARIABLE macos_sdk_path) string(STRIP "${macos_sdk_path}" macos_sdk_path) set(CMAKE_OSX_SYSROOT "${macos_sdk_path}" CACHE FILEPATH "macOS SDK" FORCE) diff --git a/FairSoft_test.cmake b/FairSoft_test.cmake index 29e40a1eb..c4fd9de61 100644 --- a/FairSoft_test.cmake +++ b/FairSoft_test.cmake @@ -154,15 +154,19 @@ if (BUILD_METHOD STREQUAL legacy) list(APPEND options "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}") endif() if(APPLE) - execute_process(COMMAND brew --prefix python OUTPUT_VARIABLE python_prefix) - string(STRIP "${python_prefix}" python_prefix) - list(APPEND options "-DPython_EXECUTABLE=${python_prefix}/bin/python3") - execute_process(COMMAND brew --prefix icu4c OUTPUT_VARIABLE icu_prefix) - string(STRIP "${icu_prefix}" icu_prefix) - list(APPEND options "-DICU_ROOT=${icu_prefix}") - execute_process(COMMAND brew ruby -e "puts MacOS.sdk_path" OUTPUT_VARIABLE macos_sdk_path) - string(STRIP "${macos_sdk_path}" macos_sdk_path) - list(APPEND options "-DCMAKE_OSX_SYSROOT=${macos_sdk_path}") + if(NOT CMAKE_OSX_SYSROOT) + execute_process(COMMAND brew --prefix python OUTPUT_VARIABLE python_prefix) + string(STRIP "${python_prefix}" python_prefix) + list(APPEND options "-DPython_EXECUTABLE=${python_prefix}/bin/python3") + execute_process(COMMAND brew --prefix icu4c OUTPUT_VARIABLE icu_prefix) + string(STRIP "${icu_prefix}" icu_prefix) + list(APPEND options "-DICU_ROOT=${icu_prefix}") + execute_process(COMMAND brew ruby -e "puts MacOS.sdk_path" OUTPUT_VARIABLE macos_sdk_path) + string(STRIP "${macos_sdk_path}" macos_sdk_path) + list(APPEND options "-DCMAKE_OSX_SYSROOT=${macos_sdk_path}") + else() + list(APPEND options "-DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}") + endif() endif() list(JOIN options ";" optionsstr) show_big_header("Configuring") @@ -176,7 +180,7 @@ if (BUILD_METHOD STREQUAL legacy) if (_ctest_build_errors) set(_ctest_build_retval 255) endif() - if(NOT _ctest_build_errors) + if(NOT _ctest_build_errors AND ${CMAKE_VERSION} VERSION_LESS 4) ctest_build(RETURN_VALUE _ctest_build_retval NUMBER_ERRORS _ctest_build_errors TARGET "onnxruntime" diff --git a/cmake/legacy.cmake b/cmake/legacy.cmake index 5c89f7cc6..fa45098f3 100644 --- a/cmake/legacy.cmake +++ b/cmake/legacy.cmake @@ -5,8 +5,8 @@ # GNU Lesser General Public Licence (LGPL) version 3, # # copied verbatim in the file "LICENSE" # ################################################################################ -cmake_minimum_required(VERSION 3.19...3.28 FATAL_ERROR) -cmake_policy(VERSION 3.19...3.28) +cmake_minimum_required(VERSION 3.19...4.0.1) +cmake_policy(VERSION 3.19...4.0.1) find_package(LibLZMA) if(LibLZMA_FOUND) @@ -45,9 +45,31 @@ endif() find_package(Git REQUIRED) -find_package(Patch REQUIRED) + +if (APPLE) + find_program(_patch NAMES gpatch patch) + if(NOT _patch) + message(FATAL_ERROR "Could not find gpatch or patch command") + else() + message(STATUS "Found Patch: ${_patch}") + endif() + set(patch ${_patch} --merge) +else() + find_package(Patch REQUIRED) + set(patch $ --merge) +endif() + +if(APPLE AND ${CMAKE_MAKE_PROGRAM} MATCHES ".*/make$") + find_program(_make NAMES gmake make) + if(NOT _make) + message(FATAL_ERROR "Could not find gmake or make command") + else() + message(STATUS "Found Make: ${_make}") + endif() + set(CMAKE_MAKE_PROGRAM ${_make} CACHE FILEPATH "Make program" FORCE) +endif() + find_package(UnixCommands) -set(patch $ --merge) set(PROJECT_MIN_CXX_STANDARD 17) @@ -145,6 +167,7 @@ ExternalProject_Add(faircmakemodules list(APPEND packages boost) set(boost_version "83") set(boost_features + "-d+2" "cxxstd=${CMAKE_CXX_STANDARD}" "link=shared" "threading=multi" @@ -153,6 +176,11 @@ set(boost_features "pch=off" ) +if (APPLE AND CMAKE_OSX_SYSROOT) + list(APPEND boost_features "cxxflags='-isysroot${CMAKE_OSX_SYSROOT}'") + list(APPEND boost_features "linkflags='-isysroot${CMAKE_OSX_SYSROOT}'") +endif() + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) if("${isSystemDir}" STREQUAL "-1") @@ -230,6 +258,7 @@ list(APPEND packages zeromq) set(zeromq_version "4.3.5") ExternalProject_Add(zeromq GIT_REPOSITORY https://github.com/zeromq/libzmq GIT_TAG v${zeromq_version} + PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/zeromq/fix_cmake.patch" ${CMAKE_DEFAULT_ARGS} CMAKE_ARGS "-DWITH_PERF_TOOL=ON" "-DZMQ_BUILD_TESTS=ON" @@ -267,6 +296,7 @@ ExternalProject_Add(pythia6 URL_HASH SHA256=b14e82870d3aa33d6fa07f4b1f4d17f1ab80a37d753f91ca6322352b397cb244 UPDATE_DISCONNECTED ON PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/pythia6/add_missing_extern_keyword.patch" + COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/pythia6/fix_cmake.patch" ${CMAKE_DEFAULT_ARGS} ${LOG_TO_FILE} ${DEPENDS_ON_SOURCE_CACHE} ) @@ -276,6 +306,7 @@ set(hepmc_version "2.06.11") ExternalProject_Add(hepmc URL https://hepmc.web.cern.ch/releases/hepmc${hepmc_version}.tgz URL_HASH SHA256=86b66ea0278f803cde5774de8bd187dd42c870367f1cbf6cdaec8dc7cf6afc10 + PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/hepmc/fix_cmake.patch" ${CMAKE_DEFAULT_ARGS} CMAKE_ARGS "-Dlength:STRING=CM" "-Dmomentum:STRING=GEV" @@ -288,6 +319,7 @@ set(vc_version "1.4.4") ExternalProject_Add(vc URL https://github.com/VcDevel/Vc/archive/refs/tags/${vc_version}.tar.gz URL_HASH SHA256=5933108196be44c41613884cd56305df320263981fe6a49e648aebb3354d57f3 + PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/vc/fix_cmake.patch" ${CMAKE_DEFAULT_ARGS} ${LOG_TO_FILE} ${DEPENDS_ON_SOURCE_CACHE} ) @@ -310,6 +342,12 @@ ExternalProject_Add_Step(clhep move_dir DEPENDEES download DEPENDERS patch LOG ON ) +if (APPLE AND CMAKE_OSX_SYSROOT) + set(_pythia8_macosx_sdk -isysroot${CMAKE_OSX_SYSROOT}) +else() + set(_pythia8_macosx_sdk) +endif() + list(APPEND packages pythia8) set(pythia8_version "8310") string(SUBSTRING "${pythia8_version}" 0 2 pythia8_major_version) @@ -322,7 +360,7 @@ ExternalProject_Add(pythia8 "--with-hepmc2=${CMAKE_INSTALL_PREFIX}" "--prefix=${CMAKE_INSTALL_PREFIX}" "--cxx=${CMAKE_CXX_COMPILER}" - "--cxx-common='${CMAKE_CXX_FLAGS_${selected}} -fPIC -std=c++${CMAKE_CXX_STANDARD}'" + "--cxx-common='${CMAKE_CXX_FLAGS_${selected}} -fPIC -std=c++${CMAKE_CXX_STANDARD} ${_pythia8_macosx_sdk}'" DEPENDS hepmc ${extract_source_cache_target} ${LOG_TO_FILE} ) @@ -357,6 +395,8 @@ ExternalProject_Add(geant4 "-DGEANT4_BUILD_VERBOSE_CODE=ON" "-DGEANT4_BUILD_BUILTIN_BACKTRACE=OFF" ${cmake_python_config_old} + PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/geant4/fix_cmake.patch" + COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/geant4/fix_typo.patch" DEPENDS boost clhep ${extract_source_cache_target} ${LOG_TO_FILE} ) @@ -374,17 +414,47 @@ else() unset(root_cocoa) set(root_x11 ON) endif() -find_package(nlohmann_json 3.9) +find_package(nlohmann_json 3.9 QUIET) if(nlohmann_json_FOUND) set(root_builtin_nlohmannjson "-Dbuiltin_nlohmannjson=OFF") else() set(root_builtin_nlohmannjson "-Dbuiltin_nlohmannjson=ON") endif() +# Extract the OS and VERSION on Linux +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + execute_process(COMMAND cat /etc/os-release + COMMAND grep ID= + COMMAND grep -v VERSION + COMMAND cut -d= -f2 + OUTPUT_VARIABLE OS_NAME + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REPLACE "\"" "" OS_NAME ${OS_NAME}) + + execute_process(COMMAND cat /etc/os-release + COMMAND grep ID= + COMMAND grep VERSION + COMMAND cut -d= -f2 + COMMAND cut -d\" -f2 + OUTPUT_VARIABLE OS_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(${OS_NAME}${OS_VERSION} MATCHES "debian13" OR ${OS_NAME}${OS_VERSION} MATCHES "opensuse-leap16.0") + set(debian13_patch COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_ftgl.patch") + else() + set(debian13_patch) + endif() +else() + set(debian13_patch) +endif() + ExternalProject_Add(root GIT_REPOSITORY https://github.com/root-project/root/ GIT_TAG v${root_version_gittag} GIT_SHALLOW 1 ${CMAKE_DEFAULT_ARGS} CMAKE_ARGS + "-DCMAKE_C_STANDARD=11" "-Daqua=ON" "-Dasimage=ON" "-Dcintex=OFF" @@ -422,6 +492,10 @@ ExternalProject_Add(root UPDATE_DISCONNECTED ON PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_macos_sdk_mismatch.patch" COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_macosx_findOpenGL.patch" + COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_macosx_clang17.patch" + COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_macos_sdk_for_rootcling.patch" + COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_gcc15.patch" + ${debian13_patch} DEPENDS pythia6 pythia8 vc ${extract_source_cache_target} ${LOG_TO_FILE} ) @@ -431,6 +505,7 @@ set(vmc_version "2-0") ExternalProject_Add(vmc GIT_REPOSITORY https://github.com/vmc-project/vmc GIT_TAG v${vmc_version} ${CMAKE_DEFAULT_ARGS} ${LOG_TO_FILE} + PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/vmc/fix_cmake.patch" DEPENDS root ${extract_source_cache_target} ) @@ -440,6 +515,8 @@ ExternalProject_Add(geant3 GIT_REPOSITORY https://github.com/FairRootGroup/geant3 GIT_TAG v${geant3_version} ${CMAKE_DEFAULT_ARGS} CMAKE_ARGS "-DBUILD_GCALOR=ON" + "-DCMAKE_C_STANDARD=11" + PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/geant3/fix_cmake.patch" DEPENDS root vmc ${extract_source_cache_target} ${LOG_TO_FILE} ) @@ -450,6 +527,7 @@ ExternalProject_Add(vgm GIT_REPOSITORY https://github.com/vmc-project/vgm GIT_TAG v${vgm_version} ${CMAKE_DEFAULT_ARGS} CMAKE_ARGS "-DWITH_TEST=OFF" + PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/vgm/fix_cmake.patch" DEPENDS clhep geant4 root ${extract_source_cache_target} ${LOG_TO_FILE} ) @@ -464,6 +542,7 @@ ExternalProject_Add(geant4_vmc "-DGeant4VMC_USE_GEANT4_VIS=OFF" "-DGeant4VMC_USE_GEANT4_G3TOG4=ON" "-DWITH_TEST=OFF" + PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/geant4_vmc/fix_cmake.patch" DEPENDS clhep geant4 root vgm vmc ${extract_source_cache_target} ${LOG_TO_FILE} ) @@ -553,8 +632,12 @@ add_custom_target(source-cache include(CTest) -foreach(ver IN ITEMS 18.6 18.8 19.0) - set(TEST_VERSION v${ver}_patches) +foreach(ver IN ITEMS 18.6 18.8 19.0 dev) + if(ver STREQUAL dev) + set(TEST_VERSION ${ver}) + else() + set(TEST_VERSION v${ver}_patches) + endif() configure_file(test/legacy/fairroot.sh.in ${CMAKE_BINARY_DIR}/test_fairroot_${ver}.sh @ONLY) add_test(NAME FairRoot_${ver} COMMAND test_fairroot_${ver}.sh diff --git a/legacy/README.md b/legacy/README.md index b900930ed..42654e6d1 100644 --- a/legacy/README.md +++ b/legacy/README.md @@ -51,6 +51,41 @@ cmake -S -B -C /FairSoftConfig. Set the installation prefix and more customization options in the [`FairSoftConfig.cmake`](../FairSoftConfig.cmake) file itself. +#### 3.1 CMake configure step for macOS users + +There are some known problems about the compilation of FairSoft on macosx. + +The first two problems are related to the version of the **patch** and **make** +commands on macosx. + +The **patch** command does not support the needed parameters, +so one needs ot install a version of the **patch** command with brew. +The **make** command doesn't properly support the jobsserver which allows +parallel builds of all the packages contained in FairSoft which slows down +the installation enormously. The version provided by brew fixes the problem. +Both packages are already added in the updated setup script for macosx. +If found the packages from the homebrew installation directory will be used. + +The last problem is related to the macosx, compiler and SDK versions, such +that it depends on the personal setup. As described in more detail at +[macOS SDK](advanced.md#macos-sdk)! ROOT is very picky about the compiler +and the connected SDK. Compiling older ROOT versions with newer compilers +may need using an older SDK version. If not specified explicitely the +latest SDK version is used. To use an older SDK version on needs to add the +following parameter when running CMake + +``` +-DCMAKE_OSX_SYSROOT= +``` + +e.g. for Apple Clang 17 on macosx 15 or Apple Clang 16 on macosx 14 + +``` +-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk +``` + +More information can be found at + **macOS users**: Notice [macOS SDK](advanced.md#macos-sdk)! ### 4. CMake build/install step diff --git a/legacy/advanced.md b/legacy/advanced.md index a6644adfa..44dbcb0e7 100644 --- a/legacy/advanced.md +++ b/legacy/advanced.md @@ -59,6 +59,17 @@ installed SDK version is the most sensible course of action here. `brew` contains already some logic to detect and choose the latest SDK. See the "macOS SDK" section in [FairSoftConfig.cmake](../FairSoftConfig.cmake). +The downside with picking the latest SDK version is that some older ROOT +versions can't be compiled any longer after updating the compiler and the +connected SDK. As described above the problems with compilation errors due +to **wrong** SDKs are because of ROOT and there mainly becuase of rootcling. +To overcome the problem and allow a more flexible compilation also with +non default SDKs we add the possibilty to define an older SDK when running +CMake. There are some additional changes in the build system of ROOT such +that rootcling take the setting properly into account. With this changes it +becomes possible to install FairSoft jan24 (ROOT 6.30.08) with Apple Clang +17 on macosx 15. + **If you have a deeper understanding of this issue and know a better solution, please let us know!** diff --git a/legacy/geant3/fix_cmake.patch b/legacy/geant3/fix_cmake.patch new file mode 100644 index 000000000..ac2f9947b --- /dev/null +++ b/legacy/geant3/fix_cmake.patch @@ -0,0 +1,59 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 918bef0..3efc04e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,7 +24,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + endif() + + #--- Define CMake requirements ------------------------------------------------- +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + #--- Prepend our own CMake Modules to the search path -------------------------- + set(CMAKE_MODULE_PATH +diff --git a/cmake/Geant3BuildLibrary.cmake b/cmake/Geant3BuildLibrary.cmake +index 33ef258..dc1dc2b 100644 +--- a/cmake/Geant3BuildLibrary.cmake ++++ b/cmake/Geant3BuildLibrary.cmake +@@ -11,7 +11,7 @@ + # I. Hrivnacova, 13/06/2014 + + #---CMake required version ----------------------------------------------------- +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + #------------------------------------------------------------------------------- + # Define installed names +diff --git a/cmake/Geant3RequiredPackages.cmake b/cmake/Geant3RequiredPackages.cmake +index 04182d5..2f2f306 100644 +--- a/cmake/Geant3RequiredPackages.cmake ++++ b/cmake/Geant3RequiredPackages.cmake +@@ -25,3 +25,6 @@ include(${ROOT_USE_FILE}) + + #-- VMC (required) ------------------------------------------------------------ + find_package(VMC CONFIG REQUIRED) ++find_package(Pythia6 REQUIRED) ++set(VMC_DEPS VMCLibrary ${Pythia6_LIBRARY}) ++ +diff --git a/cmake/FindPythia6.cmake b/cmake/FindPythia6.cmake +index 0102be8..71a291d 100644 +--- a/cmake/FindPythia6.cmake ++++ b/cmake/FindPythia6.cmake +@@ -28,7 +28,7 @@ + #message(STATUS "Looking for Pythia6 ...") + + find_path(Pythia6_LIBRARY_DIR +- NAMES libPythia6.so libPythia6.dylib ++ NAMES libPythia6.so libPythia6.dylib libpythia6.so libpythia6.dylib + pythia6-$ENV{PYTHIA6_VERSION}.so pythia6-$ENV{PYTHIA6_VERSION}.dylib + PATHS + ${Pythia6_LIB_DIR} +@@ -39,7 +39,7 @@ find_path(Pythia6_LIBRARY_DIR + ) + + find_library(Pythia6_LIBRARY +- NAMES Pythia6 pythia6-$ENV{PYTHIA6_VERSION} ++ NAMES Pythia6 pythia6 pythia6-$ENV{PYTHIA6_VERSION} + HINTS ${Pythia6_LIBRARY_DIR}) + + set(Pythia6_LIBRARIES ${Pythia6_LIBRARY}) diff --git a/legacy/geant4/fix_cmake.patch b/legacy/geant4/fix_cmake.patch new file mode 100644 index 000000000..94e25c070 --- /dev/null +++ b/legacy/geant4/fix_cmake.patch @@ -0,0 +1,11 @@ +--- a/source/externals/ptl/cmake/Templates/PTLConfig.cmake.in 2025-06-24 13:07:30 ++++ b/source/externals/ptl/cmake/Templates/PTLConfig.cmake.in 2025-06-24 13:08:20 +@@ -3,7 +3,7 @@ + # + @PACKAGE_INIT@ + +-cmake_minimum_required(VERSION 3.8) ++cmake_minimum_required(VERSION 3.8...4.0.1) + + # -------------------------------------------------------------------------------------- # + # basic paths diff --git a/legacy/geant4/fix_typo.patch b/legacy/geant4/fix_typo.patch new file mode 100644 index 000000000..e70d729cc --- /dev/null +++ b/legacy/geant4/fix_typo.patch @@ -0,0 +1,11 @@ +--- a/source/externals/g4tools/include/tools/wroot/columns.icc_orig 2025-06-23 17:33:15 ++++ b/source/externals/g4tools/include/tools/wroot/columns.icc 2025-06-23 17:33:49 +@@ -399,7 +399,7 @@ + protected: + std_vector_column_ref(const std_vector_column_ref& a_from) + :icol(a_from) +- ,m_branch(a_from.m_barnch) ++ ,m_branch(a_from.m_branch) + ,m_ref(a_from.m_ref) + ,m_leaf(0) + ,m_leaf_count(0) diff --git a/legacy/geant4_vmc/fix_cmake.patch b/legacy/geant4_vmc/fix_cmake.patch new file mode 100644 index 000000000..024dfe688 --- /dev/null +++ b/legacy/geant4_vmc/fix_cmake.patch @@ -0,0 +1,286 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 20cedfe4..55f1c6d8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,7 +24,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + endif() + + #--- Define CMake requirements ------------------------------------------------- +-cmake_minimum_required(VERSION 3.3 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.3...4.0.1) + + #--- Allow compiling with non Apple Clang on macOS ----------------------------- + cmake_policy(SET CMP0025 NEW) +diff --git a/examples/A01/CMakeLists.txt b/examples/A01/CMakeLists.txt +index 2a29c168..7f414132 100644 +--- a/examples/A01/CMakeLists.txt ++++ b/examples/A01/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/A01/geant4/CMakeLists.txt b/examples/A01/geant4/CMakeLists.txt +index d197af0a..0a2ba9bb 100644 +--- a/examples/A01/geant4/CMakeLists.txt ++++ b/examples/A01/geant4/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 387f743c..6338db07 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -13,7 +13,7 @@ + #---Adding examples subdirectories explicitly + # and a custom target to for building all VMC examples ------------- + +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + set(CMAKE_MODULE_PATH +diff --git a/examples/E01/CMakeLists.txt b/examples/E01/CMakeLists.txt +index d6c98dad..cfcaa280 100644 +--- a/examples/E01/CMakeLists.txt ++++ b/examples/E01/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/E02/CMakeLists.txt b/examples/E02/CMakeLists.txt +index ee2fc088..adb18b9a 100644 +--- a/examples/E02/CMakeLists.txt ++++ b/examples/E02/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/E03/CMakeLists.txt b/examples/E03/CMakeLists.txt +index d16307d6..8dd4b711 100644 +--- a/examples/E03/CMakeLists.txt ++++ b/examples/E03/CMakeLists.txt +@@ -13,7 +13,7 @@ + #---Adding examples subdirectories explicitly + # and a custom target to for building all VMC examples ------------- + +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + if(VMC_WITH_Multi) +diff --git a/examples/E03/E03a/CMakeLists.txt b/examples/E03/E03a/CMakeLists.txt +index 11e599a2..29c7199b 100644 +--- a/examples/E03/E03a/CMakeLists.txt ++++ b/examples/E03/E03a/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/E03/E03a/geant4/CMakeLists.txt b/examples/E03/E03a/geant4/CMakeLists.txt +index 6dc15c1d..df882c3a 100644 +--- a/examples/E03/E03a/geant4/CMakeLists.txt ++++ b/examples/E03/E03a/geant4/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/E03/E03b/CMakeLists.txt b/examples/E03/E03b/CMakeLists.txt +index 79db0001..aaa5b487 100644 +--- a/examples/E03/E03b/CMakeLists.txt ++++ b/examples/E03/E03b/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/E03/E03b/geant4/CMakeLists.txt b/examples/E03/E03b/geant4/CMakeLists.txt +index db38d6ab..744ca699 100644 +--- a/examples/E03/E03b/geant4/CMakeLists.txt ++++ b/examples/E03/E03b/geant4/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/E03/E03c/CMakeLists.txt b/examples/E03/E03c/CMakeLists.txt +index 995bfc0e..aab350cc 100644 +--- a/examples/E03/E03c/CMakeLists.txt ++++ b/examples/E03/E03c/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/E03/E03c/geant4/CMakeLists.txt b/examples/E03/E03c/geant4/CMakeLists.txt +index 64bb6f46..750043c2 100644 +--- a/examples/E03/E03c/geant4/CMakeLists.txt ++++ b/examples/E03/E03c/geant4/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/E06/CMakeLists.txt b/examples/E06/CMakeLists.txt +index e73be791..269802bb 100644 +--- a/examples/E06/CMakeLists.txt ++++ b/examples/E06/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/ExGarfield/CMakeLists.txt b/examples/ExGarfield/CMakeLists.txt +index f351b36f..e4edb6b5 100644 +--- a/examples/ExGarfield/CMakeLists.txt ++++ b/examples/ExGarfield/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/ExGarfield/geant4/CMakeLists.txt b/examples/ExGarfield/geant4/CMakeLists.txt +index 2fa00129..72c5cc03 100644 +--- a/examples/ExGarfield/geant4/CMakeLists.txt ++++ b/examples/ExGarfield/geant4/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/Gflash/CMakeLists.txt b/examples/Gflash/CMakeLists.txt +index 5474b8ab..85bbab16 100644 +--- a/examples/Gflash/CMakeLists.txt ++++ b/examples/Gflash/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/Monopole/CMakeLists.txt b/examples/Monopole/CMakeLists.txt +index 64f5a9be..cfcf1567 100644 +--- a/examples/Monopole/CMakeLists.txt ++++ b/examples/Monopole/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/examples/TR/CMakeLists.txt b/examples/TR/CMakeLists.txt +index 74568186..31c336f8 100644 +--- a/examples/TR/CMakeLists.txt ++++ b/examples/TR/CMakeLists.txt +@@ -12,7 +12,7 @@ + + #---------------------------------------------------------------------------- + # Setup the project +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + #---------------------------------------------------------------------------- +diff --git a/g4root/CMakeLists.txt b/g4root/CMakeLists.txt +index b7507436..d9d5edf8 100644 +--- a/g4root/CMakeLists.txt ++++ b/g4root/CMakeLists.txt +@@ -11,7 +11,7 @@ + # I. Hrivnacova, 24/04/2014 + + #---CMake required version ----------------------------------------------------- +-cmake_minimum_required(VERSION 3.3 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.3...4.0.1) + + #---Project G4Root ------------------------------------------------------------- + # +diff --git a/g4root/test/CMakeLists.txt b/g4root/test/CMakeLists.txt +index 35fe0973..b85da4fe 100644 +--- a/g4root/test/CMakeLists.txt ++++ b/g4root/test/CMakeLists.txt +@@ -2,7 +2,7 @@ + + #---Adding the OpNovice subdirectory explicitly + +-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ++cmake_minimum_required(VERSION 2.8.12...4.0.1) + + + set(CMAKE_MODULE_PATH +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index 3ebb885e..3ff721c7 100644 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -11,7 +11,7 @@ + # I. Hrivnacova, 24/04/2014 + + #---CMake required version ----------------------------------------------------- +-cmake_minimum_required(VERSION 3.3 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.3...4.0.1) + + #---Project Geant4VMC --------------------------------------------------------- + # diff --git a/legacy/hepmc/fix_cmake.patch b/legacy/hepmc/fix_cmake.patch new file mode 100644 index 000000000..2be7f1937 --- /dev/null +++ b/legacy/hepmc/fix_cmake.patch @@ -0,0 +1,37 @@ +--- a/CMakeLists.txt 2025-04-22 10:37:30 ++++ b/CMakeLists.txt 2020-06-08 13:25:39 +@@ -14,7 +14,7 @@ + #------------------------------------------------------------------------------ + + # use cmake 2.6 or later +-cmake_minimum_required (VERSION 2.6) ++cmake_minimum_required (VERSION 2.6...4.0.1) + + # project name and version + project(HepMC) +--- a/cmake/Modules/HepMCUseCpack.cmake_orig 2025-04-22 11:44:59 ++++ b/cmake/Modules/HepMCUseCpack.cmake 2025-04-22 11:46:37 +@@ -8,8 +8,8 @@ + # + FUNCTION(_My_COMPILER_DUMPVERSION _OUTPUT_VERSION) + +- EXEC_PROGRAM(${CMAKE_CXX_COMPILER} +- ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion ++ EXECUTE_PROCESS(COMMAND ++ ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE _my_COMPILER_VERSION + ) + set( COMPILER_VERSION ${_my_COMPILER_VERSION} PARENT_SCOPE) +--- a/cmake/Modules/HepMCVariables.cmake_orig 2025-04-22 11:45:10 ++++ b/cmake/Modules/HepMCVariables.cmake 2025-04-22 11:46:01 +@@ -10,8 +10,8 @@ + # so we need this for the example makefile + macro( _hepmc_fortran_compiler ) + +- EXEC_PROGRAM(${CMAKE_CXX_COMPILER} +- ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion ++ EXECUTE_PROCESS(COMMAND ++ ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE _my_COMPILER_VERSION + ) + STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1" diff --git a/legacy/pythia6/fix_cmake.patch b/legacy/pythia6/fix_cmake.patch new file mode 100644 index 000000000..1c1b00663 --- /dev/null +++ b/legacy/pythia6/fix_cmake.patch @@ -0,0 +1,8 @@ +--- a/CMakeLists.txt 2025-06-18 13:55:28 ++++ b/CMakeLists.txt 2025-06-18 13:55:44 +@@ -1,4 +1,4 @@ +-Cmake_Minimum_Required(VERSION 2.6.0 FATAL_ERROR) ++Cmake_Minimum_Required(VERSION 2.6.0...4.0.1) + + Project(Pythia6) + Enable_Language(Fortran) diff --git a/legacy/root/fix_ftgl.patch b/legacy/root/fix_ftgl.patch new file mode 100644 index 000000000..9fb7b07e2 --- /dev/null +++ b/legacy/root/fix_ftgl.patch @@ -0,0 +1,40 @@ +diff --git a/graf3d/ftgl/inc/FTContour.h b/graf3d/ftgl/inc/FTContour.h +index 8eb5132165..899643e109 100644 +--- a/graf3d/ftgl/inc/FTContour.h ++++ b/graf3d/ftgl/inc/FTContour.h +@@ -25,7 +25,7 @@ class FTGL_EXPORT FTContour + * @param pointTags + * @param numberOfPoints + */ +- FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOfPoints); ++ FTContour( FT_Vector* contour, unsigned char* pointTags, unsigned int numberOfPoints); + + /** + * Destructor +diff --git a/graf3d/ftgl/src/FTContour.cxx b/graf3d/ftgl/src/FTContour.cxx +index 76ada3c9c7..8a79b7f3a8 100644 +--- a/graf3d/ftgl/src/FTContour.cxx ++++ b/graf3d/ftgl/src/FTContour.cxx +@@ -69,8 +69,7 @@ void FTContour::evaluateCubicCurve() + } + } + +- +-FTContour::FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOfPoints) ++FTContour::FTContour( FT_Vector* contour, unsigned char* pointTags, unsigned int numberOfPoints) + { + for( unsigned int pointIndex = 0; pointIndex < numberOfPoints; ++ pointIndex) + { +diff --git a/graf3d/ftgl/src/FTVectoriser.cxx b/graf3d/ftgl/src/FTVectoriser.cxx +index df32ac2f83..a468533b68 100644 +--- a/graf3d/ftgl/src/FTVectoriser.cxx ++++ b/graf3d/ftgl/src/FTVectoriser.cxx +@@ -140,7 +140,7 @@ void FTVectoriser::ProcessContours() + for( short contourIndex = 0; contourIndex < ftContourCount; ++contourIndex) + { + FT_Vector* pointList = &outline.points[startIndex]; +- char* tagList = &outline.tags[startIndex]; ++ unsigned char* tagList = &outline.tags[startIndex]; + + endIndex = outline.contours[contourIndex]; + contourLength = ( endIndex - startIndex) + 1; diff --git a/legacy/root/fix_gcc15.patch b/legacy/root/fix_gcc15.patch new file mode 100644 index 000000000..339ac75de --- /dev/null +++ b/legacy/root/fix_gcc15.patch @@ -0,0 +1,48 @@ +diff --git a/graf2d/gpadv7/inc/ROOT/RVirtualCanvasPainter.hxx b/graf2d/gpadv7/inc/ROOT/RVirtualCanvasPainter.hxx +index 881f1ecf8e..ee926dd050 100644 +--- a/graf2d/gpadv7/inc/ROOT/RVirtualCanvasPainter.hxx ++++ b/graf2d/gpadv7/inc/ROOT/RVirtualCanvasPainter.hxx +@@ -9,6 +9,7 @@ + #ifndef ROOT7_RVirtualCanvasPainter + #define ROOT7_RVirtualCanvasPainter + ++#include + #include + #include + #include +diff --git a/interpreter/llvm-project/llvm/include/llvm/ADT/SmallVector.h b/interpreter/llvm-project/llvm/include/llvm/ADT/SmallVector.h +index b8a11030fc..8bce0ea958 100644 +--- a/interpreter/llvm-project/llvm/include/llvm/ADT/SmallVector.h ++++ b/interpreter/llvm-project/llvm/include/llvm/ADT/SmallVector.h +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/interpreter/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h b/interpreter/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h +index 35604cd3ec..93cb72ad7f 100644 +--- a/interpreter/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h ++++ b/interpreter/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h +@@ -13,6 +13,7 @@ + #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H + #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H + ++#include + #include + #include + +diff --git a/tmva/tmva/inc/TMVA/RTensor.hxx b/tmva/tmva/inc/TMVA/RTensor.hxx +index d645009ee0..4832535ccc 100644 +--- a/tmva/tmva/inc/TMVA/RTensor.hxx ++++ b/tmva/tmva/inc/TMVA/RTensor.hxx +@@ -1,6 +1,7 @@ + #ifndef TMVA_RTENSOR + #define TMVA_RTENSOR + ++#include + #include + #include // std::size_t + #include // std::runtime_error diff --git a/legacy/root/fix_macos_sdk_for_rootcling.patch b/legacy/root/fix_macos_sdk_for_rootcling.patch new file mode 100644 index 000000000..32690baa7 --- /dev/null +++ b/legacy/root/fix_macos_sdk_for_rootcling.patch @@ -0,0 +1,86 @@ +diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake +index 616b133943..0ed52ee3bc 100644 +--- a/cmake/modules/RootMacros.cmake ++++ b/cmake/modules/RootMacros.cmake +@@ -604,6 +604,8 @@ function(ROOT_GENERATE_DICTIONARY dictionary) + if(ARG_STAGE1) + if(MSVC AND CMAKE_ROOTTEST_DICT) + set(command ${CMAKE_COMMAND} -E ${CMAKE_BINARY_DIR}/bin/rootcling_stage1.exe) ++ elseif(APPLE AND CMAKE_OSX_SYSROOT) ++ set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" env "SDKROOT=${CMAKE_OSX_SYSROOT}" $) + else() + set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $) + endif() +@@ -613,6 +615,11 @@ function(ROOT_GENERATE_DICTIONARY dictionary) + 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) ++ elseif(APPLE AND CMAKE_OSX_SYSROOT) ++ set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" env "SDKROOT=${CMAKE_OSX_SYSROOT}" ++ "ROOTIGNOREPREFIX=1" $ -rootbuild) ++ # Modules need RConfigure.h copied into include/. ++ set(ROOTCINTDEP rootcling rconfigure) + else() + set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" + "ROOTIGNOREPREFIX=1" $ -rootbuild) +@@ -620,7 +627,9 @@ function(ROOT_GENERATE_DICTIONARY dictionary) + set(ROOTCINTDEP rootcling rconfigure) + endif() + elseif(TARGET ROOT::rootcling) +- if(APPLE) ++ if(APPLE AND CMAKE_OSX_SYSROOT) ++ set(command ${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:$ENV{DYLD_LIBRARY_PATH}" env "SDKROOT=${CMAKE_OSX_SYSROOT}" $) ++ elseif(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}" $) +diff --git a/etc/dictpch/makepch.py b/etc/dictpch/makepch.py +index 8233f4e2f2..c54c2e959a 100755 +--- a/etc/dictpch/makepch.py ++++ b/etc/dictpch/makepch.py +@@ -112,8 +112,12 @@ def makepch(): + + my_env = os.environ.copy() + existing_ldlib = my_env.get("LD_LIBRARY_PATH") ++ osx_sdk = my_env.get("CMAKE_OSX_SYSROOT") ++ + if not existing_ldlib: existing_ldlib = "" + my_env["LD_LIBRARY_PATH"] = os.path.join(rootdir, "lib") + ":" + existing_ldlib ++ if osx_sdk: ++ my_env["SDKROOT"] = 'osx_sdk' + + ret = subprocess.call(command.split(), env=my_env) + if ret == 0: +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 77c7762225..c5feadd9e1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -524,6 +524,12 @@ else() + get_property(__pch_dependencies GLOBAL PROPERTY ROOT_PCH_DEPENDENCIES) + get_property(__pch_dictionaries GLOBAL PROPERTY ROOT_PCH_DICTIONARIES) + ++ if (APPLE AND CMAKE_OSX_SYSROOT) ++ set(_sysroot_arg "SDKROOT=${CMAKE_OSX_SYSROOT}") ++ else() ++ set(_sysroot_arg) ++ endif() ++ + add_custom_command(OUTPUT etc/allDict.cxx.pch + BYPRODUCTS + etc/dictpch/allCppflags.txt +@@ -533,9 +539,12 @@ else() + ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build/unix/makepchinput.py + ${CMAKE_SOURCE_DIR} . ${pyroot_legacy} ${__cling_pch} + COMMAND +- ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ${PYTHON_EXECUTABLE} +- ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch +- ${__allIncludes} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_SOURCE_DIR}/core ++ ${CMAKE_COMMAND} -E env ++ ${_sysroot_arg} ++ ROOTIGNOREPREFIX=1 ++ ${PYTHON_EXECUTABLE} ++ ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch ++ ${__allIncludes} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_SOURCE_DIR}/core + DEPENDS + rootcling ${__pch_dependencies} ${__pch_dictionaries} + ${CMAKE_SOURCE_DIR}/build/unix/makepchinput.py diff --git a/legacy/root/fix_macosx_clang17.patch b/legacy/root/fix_macosx_clang17.patch new file mode 100644 index 000000000..bb1fa0851 --- /dev/null +++ b/legacy/root/fix_macosx_clang17.patch @@ -0,0 +1,20 @@ +diff --git a/graf2d/asimage/src/libAfterImage/libpng/pngconf.h b/graf2d/asimage/src/libAfterImage/libpng/pngconf.h +index f0a69ccb6c..8ad4eb4ec3 100644 +--- a/graf2d/asimage/src/libAfterImage/libpng/pngconf.h ++++ b/graf2d/asimage/src/libAfterImage/libpng/pngconf.h +@@ -429,9 +429,12 @@ + * as it seems it doesn't agree with , yet we should really use + * if possible. + */ +-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) +-# include +-# endif ++// On recent macosx systems fp.h is deprecated, so use the ++// normal math library ++# include ++//# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) ++//# include ++//# endif + # else + # include + # endif diff --git a/legacy/setup-macos.sh b/legacy/setup-macos.sh index 8b0b0091a..eb0f7ce41 100755 --- a/legacy/setup-macos.sh +++ b/legacy/setup-macos.sh @@ -1,7 +1,7 @@ #! /bin/bash brew update -brew install cmake cfitsio coreutils davix expat icu4c fftw freetype \ +brew install bash cmake cfitsio coreutils davix expat icu4c fftw freetype \ ftgl gcc giflib gl2ps gpatch graphviz grpc gsl libjpeg libpng \ - libtiff lz4 mesa-glu numpy openlibm openssl pcre pkg-config \ + libtiff lz4 make mesa-glu numpy openlibm openssl pcre pkg-config \ protobuf python sqlite tbb xerces-c xrootd xxhash xz yaml-cpp zstd diff --git a/legacy/vc/fix_cmake.patch b/legacy/vc/fix_cmake.patch new file mode 100644 index 000000000..7ba94fd23 --- /dev/null +++ b/legacy/vc/fix_cmake.patch @@ -0,0 +1,79 @@ +--- a/CMakeLists.txt_orig 2025-04-22 13:24:33 ++++ b/CMakeLists.txt 2025-04-22 13:25:34 +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.0) ++cmake_minimum_required(VERSION 3.0...4.0.1) + + cmake_policy(SET CMP0028 NEW) # Double colon in target name means ALIAS or IMPORTED target. + cmake_policy(SET CMP0048 NEW) # The ``project()`` command manages VERSION variables. +--- a/cmake/VcMacros.cmake_orig 2025-04-22 13:33:46 ++++ b/cmake/VcMacros.cmake 2025-04-22 13:32:40 +@@ -41,7 +41,7 @@ + + macro(vc_determine_compiler) + if(NOT DEFINED Vc_COMPILER_IS_INTEL) +- execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "--version" OUTPUT_VARIABLE _cxx_compiler_version ERROR_VARIABLE _cxx_compiler_version) ++ execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE _cxx_compiler_version ERROR_VARIABLE _cxx_compiler_version) + set(Vc_COMPILER_IS_INTEL false) + set(Vc_COMPILER_IS_OPEN64 false) + set(Vc_COMPILER_IS_CLANG false) +@@ -49,7 +49,7 @@ + set(Vc_COMPILER_IS_GCC false) + if(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") + set(Vc_COMPILER_IS_INTEL true) +- exec_program(${CMAKE_CXX_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE Vc_ICC_VERSION) ++ execute_process(COMMAND ${CMAKE_CXX_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE Vc_ICC_VERSION) + message(STATUS "Detected Compiler: Intel ${Vc_ICC_VERSION}") + + # break build with too old clang as early as possible. +@@ -61,7 +61,7 @@ + message(STATUS "Detected Compiler: Open64") + elseif(CMAKE_CXX_COMPILER MATCHES "clang\\+\\+$" OR "${_cxx_compiler_version}" MATCHES "clang") + set(Vc_COMPILER_IS_CLANG true) +- exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE Vc_CLANG_VERSION) ++ execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE Vc_CLANG_VERSION) + string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" Vc_CLANG_VERSION "${Vc_CLANG_VERSION}") + message(STATUS "Detected Compiler: Clang ${Vc_CLANG_VERSION}") + +@@ -74,13 +74,13 @@ + message(STATUS "Detected Compiler: MSVC ${MSVC_VERSION}") + elseif(CMAKE_COMPILER_IS_GNUCXX) + set(Vc_COMPILER_IS_GCC true) +- exec_program(${CMAKE_CXX_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE Vc_GCC_VERSION) ++ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE Vc_GCC_VERSION) + message(STATUS "Detected Compiler: GCC ${Vc_GCC_VERSION}") + + # some distributions patch their GCC to return nothing or only major and minor version on -dumpversion. + # In that case we must extract the version number from --version. + if(NOT Vc_GCC_VERSION OR Vc_GCC_VERSION MATCHES "^[0-9]\\.[0-9]+$") +- exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE Vc_GCC_VERSION) ++ execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE Vc_GCC_VERSION) + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" Vc_GCC_VERSION "${Vc_GCC_VERSION}") + message(STATUS "GCC Version from --version: ${Vc_GCC_VERSION}") + endif() +@@ -144,12 +144,12 @@ + endmacro() + + macro(vc_check_assembler) +- exec_program(${CMAKE_CXX_COMPILER} ARGS -print-prog-name=as OUTPUT_VARIABLE _as) ++ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-prog-name=as OUTPUT_VARIABLE _as) + mark_as_advanced(_as) + if(NOT _as) + message(WARNING "Could not find 'as', the assembler used by GCC. Hoping everything will work out...") + else() +- exec_program(${_as} ARGS --version OUTPUT_VARIABLE _as_version) ++ execute_process(COMMAND ${_as} --version OUTPUT_VARIABLE _as_version) + string(REGEX REPLACE "\\([^\\)]*\\)" "" _as_version "${_as_version}") + string(REGEX MATCH "[1-9]\\.[0-9]+(\\.[0-9]+)?" _as_version "${_as_version}") + if(_as_version VERSION_LESS "2.18.93") +--- a/cmake/OptimizeForArchitecture.cmake_orig 2025-04-22 13:34:22 ++++ b/cmake/OptimizeForArchitecture.cmake 2025-04-22 13:34:55 +@@ -70,7 +70,7 @@ + string(REGEX REPLACE ".*model[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_model "${_cpuinfo}") + string(REGEX REPLACE ".*flags[ \t]*:[ \t]+([^\n]+).*" "\\1" _cpu_flags "${_cpuinfo}") + elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") +- exec_program("/usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features" OUTPUT_VARIABLE _sysctl_output_string) ++ execute_process(COMMAND /usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features OUTPUT_VARIABLE _sysctl_output_string) + string(REPLACE "\n" ";" _sysctl_output ${_sysctl_output_string}) + list(GET _sysctl_output 0 _vendor_id) + list(GET _sysctl_output 1 _cpu_model) diff --git a/legacy/vgm/fix_cmake.patch b/legacy/vgm/fix_cmake.patch new file mode 100644 index 000000000..affdc1007 --- /dev/null +++ b/legacy/vgm/fix_cmake.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/VGMConfig.cmake.in b/cmake/VGMConfig.cmake.in +index 0d4e51c..fc934b5 100644 +--- a/cmake/VGMConfig.cmake.in ++++ b/cmake/VGMConfig.cmake.in +@@ -25,7 +25,7 @@ + # I. Hrivnacova, 04/06/2014 + + # Support CMake >= 3.8 +-cmake_policy(VERSION 3.8) ++cmake_policy(VERSION 3.8...4.0.1) + if(CMAKE_VERSION VERSION_LESS 3.8) + message(FATAL_ERROR "VGMConfig requires CMake 3.8 or newer") + endif() diff --git a/legacy/vmc/fix_cmake.patch b/legacy/vmc/fix_cmake.patch new file mode 100644 index 000000000..fa46e706e --- /dev/null +++ b/legacy/vmc/fix_cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9758860..ebbf90f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23,7 +23,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + endif() + + #--- Define CMake requirements ------------------------------------------------- +-cmake_minimum_required(VERSION 3.3 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.3...4.0.1) + + #--- Prepend our own CMake Modules to the search path -------------------------- + set(CMAKE_MODULE_PATH diff --git a/legacy/zeromq/fix_cmake.patch b/legacy/zeromq/fix_cmake.patch new file mode 100644 index 000000000..fc7a50ff5 --- /dev/null +++ b/legacy/zeromq/fix_cmake.patch @@ -0,0 +1,32 @@ +--- a/CMakeLists.txt_orig 2025-04-22 12:58:25 ++++ b/CMakeLists.txt 2025-04-22 12:58:47 +@@ -2,9 +2,9 @@ + project(ZeroMQ) + + if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) +- cmake_minimum_required(VERSION 3.0.2) ++ cmake_minimum_required(VERSION 3.0.2...4.0.1) + else() +- cmake_minimum_required(VERSION 2.8.12) ++ cmake_minimum_required(VERSION 2.8.12...4.0.1) + endif() + + include(CheckIncludeFiles) +--- a/tests/CMakeLists.txt_orig 2025-04-22 13:02:31 ++++ b/tests/CMakeLists.txt 2025-04-22 13:02:49 +@@ -1,5 +1,5 @@ + # CMake build script for ZeroMQ tests +-cmake_minimum_required(VERSION "2.8.1") ++cmake_minimum_required(VERSION 2.8.1...4.0.1) + + # On Windows: solution file will be called tests.sln + project(tests) +--- a/unittests/CMakeLists.txt_orig 2025-04-22 13:04:17 ++++ b/unittests/CMakeLists.txt 2025-04-22 13:04:29 +@@ -1,5 +1,5 @@ + # CMake build script for ZeroMQ unit tests +-cmake_minimum_required(VERSION "2.8.1") ++cmake_minimum_required(VERSION 2.8.1...4.0.1) + + set(unittests + unittest_ypipe diff --git a/test/legacy/fairroot.sh.in b/test/legacy/fairroot.sh.in index 460b27e52..ba67ce63f 100755 --- a/test/legacy/fairroot.sh.in +++ b/test/legacy/fairroot.sh.in @@ -10,8 +10,13 @@ git clone -b ${version} https://github.com/FairRootGroup/FairRoot $sourcedir pushd $sourcedir mkdir -p build/install export FAIRROOTPATH="$(realpath ./build/install)" -cmake -S. -Bbuild \ - -DCMAKE_INSTALL_PREFIX=$FAIRROOTPATH +_arguments="-DCMAKE_INSTALL_PREFIX=$FAIRROOTPATH -DCMAKE_C_STANDARD=11" +if [[ -n "@APPLE@" ]]; then + if [[ -n "@CMAKE_OSX_SYSROOT@" ]]; then + _arguments="${_arguments} -DCMAKE_OSX_SYSROOT=@CMAKE_OSX_SYSROOT@" + fi +fi +cmake -S. -Bbuild ${_arguments} cmake --build build --target install -j @NCPUS@ pushd build ctest --output-on-failure -E "(ex_MQ_pixel|pixelSplitDDS).*" -j @NCPUS@ $(ctest --version | grep -q "3\.16" || echo "--repeat until-pass:5")