diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0570b4c5..4b37a715 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,12 @@ jobs: fail-fast: false matrix: python-version: ["3.9", "3.13"] - runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] # , windows-latest] + runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest, windows-11-arm] arch: [auto64] + exclude: + - runs-on: windows-11-arm + python-version: "3.9" + steps: - uses: actions/checkout@v4 with: @@ -46,27 +50,33 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install compiler tools on windows + - if: matrix.runs-on == 'windows-11-arm' + name: Install rustup on Windows ARM + shell: sh + run: | + curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe + ./rustup-init.exe -y --default-toolchain none --no-modify-path + echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH" + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Install extra deps on windows if: runner.os == 'windows' run: | - Install-Module -Name 7Zip4Powershell -Force Invoke-Webrequest -Uri https://archives.boost.io/release/1.88.0/source/boost_1_88_0.zip -OutFile boost_1_88_0.zip Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1.zip -OutFile CGAL-6.0.1.zip - Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-win64-auxiliary-libraries-gmp-mpfr.zip -OutFile cgal_auxlibs.zip - Expand-7Zip boost_1_88_0.zip .\boost_1_88_0 - Expand-7Zip CGAL-6.0.1.zip .\CGAL-6.0.1 - Expand-7Zip cgal_auxlibs.zip .\cgal_auxlibs - vcpkg.exe install getopt + Expand-Archive boost_1_88_0.zip .\boost_1_88_0 + Expand-Archive CGAL-6.0.1.zip .\CGAL-6.0.1 - - name: Install compiler tools on macOS + - name: Install extra deps on macOS if: runner.os == 'macOS' run: | - brew reinstall gfortran - brew install swig boost cgal gmp mpfr + brew install --ignore-dependencies swig boost cgal - name: Install extra deps on Linux if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libboost-dev libmpfr-dev swig libcgal-dev + run: | + sudo apt-get update + sudo apt-get install -y libboost-dev swig libcgal-dev - name: Install package (macOS) if: runner.os == 'macOS' @@ -81,21 +91,23 @@ jobs: echo $PATH python -m pip install '.[test]' -v -C"cmake.define.FASTJET_ENABLE_CGAL"="ON" - - name: Install package (windows) - if: runner.os == 'windows' + - name: Install package (windows x64) + if: matrix.runs-on == 'windows-latest' run: | $Env:Path - $Env:GMP_INC_DIR = "${PWD}\cgal_auxlibs\auxiliary\gmp\include" - $Env:GMP_LIB_DIR = "${PWD}\cgal_auxlibs\auxiliary\gmp\lib" - $Env:MPFR_INC_DIR = "${PWD}\cgal_auxlibs\auxiliary\gmp\include" - $Env:MPFR_LIB_DIR = "${PWD}\cgal_auxlibs\auxiliary\gmp\lib" - $Env:CMAKE_PREFIX_PATH = "C:\vcpkg\packages\getopt-win32_x64-windows\share\unofficial-getopt-win32;$Env:CMAKE_PREFIX_PATH" - python -m pip install '.[test]' -v -C"cmake.define.GMP_DLL_TO_COPY"="C:\\a\\fastjet\\fastjet\\cgal_auxlibs\\auxiliary\\gmp\\bin\\gmp-10.dll" -C"cmake.define.Boost_INCLUDE_DIR"="${PWD}\boost_1_88_0\boost_1_88_0" -C"cmake.define.CGAL_DIR"="${PWD}\CGAL-6.0.1\CGAL-6.0.1" -C"cmake.define.FASTJET_ENABLE_DEBUG"="OFF" -C"cmake.define.SISCONE_ENABLE_DEBUG"="OFF" -C"cmake.define.FASTJET_ENABLE_CGAL"="ON" + python -m pip install '.[test]' -v -C"cmake.define.Boost_INCLUDE_DIR"="${{ github.workspace }}\boost_1_88_0\boost_1_88_0" -C"cmake.define.CGAL_DIR"="${{ github.workspace }}\CGAL-6.0.1\CGAL-6.0.1" -C"cmake.define.FASTJET_ENABLE_CGAL"="ON" + + - name: Install package (windows arm64) + if: matrix.runs-on == 'windows-11-arm' + run: | + $Env:Path + python -m pip install . -v -C"cmake.define.Boost_INCLUDE_DIR"="${{ github.workspace }}\boost_1_88_0\boost_1_88_0" -C"cmake.define.CGAL_DIR"="${{ github.workspace }}\CGAL-6.0.1\CGAL-6.0.1" -C"cmake.define.FASTJET_ENABLE_CGAL"="ON" - name: List installed Python packages run: python -m pip list - name: Test package + if: matrix.runs-on != 'windows-11-arm' run: python -m pytest -vv -rs -Wd test_wheels: @@ -104,7 +116,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13] # , windows-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest, windows-11-arm] python: [313] arch: [auto64] @@ -114,68 +126,33 @@ jobs: submodules: recursive fetch-depth: 0 - - name: Install compiler tools on macOS + - name: Install extra deps on macOS if: runner.os == 'macOS' run: | echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV" - brew uninstall --force --ignore-dependencies gcc@12 gcc@13 gnupg gnutls isl libmpc nettle gcc mpfr gmp - brew install --ignore-dependencies m4 make automake autoconf libtool swig boost cgal + brew install --ignore-dependencies swig boost cgal echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV" - - name: Install compiler tools on windows + - if: matrix.os == 'windows-11-arm' + name: Install rustup on Windows ARM + shell: sh + run: | + curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe + ./rustup-init.exe -y --default-toolchain none --no-modify-path + echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH" + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Install extra deps on windows if: runner.os == 'windows' run: | - Install-Module -Name 7Zip4Powershell -Force Invoke-Webrequest -Uri https://archives.boost.io/release/1.88.0/source/boost_1_88_0.zip -OutFile boost_1_88_0.zip Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1.zip -OutFile CGAL-6.0.1.zip - Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-win64-auxiliary-libraries-gmp-mpfr.zip -OutFile cgal_auxlibs.zip - Expand-7Zip boost_1_88_0.zip .\boost_1_88_0 - Expand-7Zip CGAL-6.0.1.zip .\CGAL-6.0.1 - Expand-7Zip cgal_auxlibs.zip .\cgal_auxlibs - vcpkg.exe install getopt + Expand-Archive -Path boost_1_88_0.zip -DestinationPath .\boost_1_88_0 + Expand-Archive -Path CGAL-6.0.1.zip -DestinationPath .\CGAL-6.0.1 - name: Install extra deps on Linux if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libboost-dev libmpfr-dev swig libcgal-dev - - - name: Clone gmp - if: runner.os == 'macOS' - uses: actions/checkout@v4 - with: - repository: gmp-mirror/gmp-6.3 - path: gmp-6.3 - - - name: Build gmp from source for MACOSX_DEPLOYMENT_TARGET=11.0 - if: runner.os == 'macOS' - working-directory: gmp-6.3 - run: | - brew install texinfo - autoreconf -i -f - ./configure --help - ./configure \ - --prefix=$(brew --prefix) \ - --enable-cxx - touch ./doc/version.texi - make --jobs - make install - - - name: Get mpfr release - if: runner.os == 'macOS' - run: | - curl -Lk https://www.mpfr.org/mpfr-current/mpfr-4.2.2.tar.gz -o mpfr-4.2.2.tar.gz - tar -xzf mpfr-4.2.2.tar.gz - - - name: Build mpfr from source for MACOSX_DEPLOYMENT_TARGET=11.0 - if: runner.os == 'macOS' - working-directory: mpfr-4.2.2 - run: | - autoreconf -i -f - ./configure --help - ./configure \ - --prefix=$(brew --prefix) \ - --with-gmp=$(brew --prefix) - make --jobs - make install + run: sudo apt-get update && sudo apt-get install -y libboost-dev swig libcgal-dev - uses: pypa/cibuildwheel@v3.0 env: @@ -185,15 +162,9 @@ jobs: CIBW_CONFIG_SETTINGS: > "cmake.define.FASTJET_ENABLE_CGAL"="ON" CIBW_CONFIG_SETTINGS_WINDOWS: > - "cmake.define.GMP_DLL_TO_COPY"="C:\\\\a\\\\fastjet\\\\fastjet\\\\cgal_auxlibs\\\\auxiliary\\\\gmp\\\\bin\\\\gmp-10.dll" - "cmake.define.Boost_INCLUDE_DIR"="C:\a\fastjet\fastjet\boost_1_88_0\boost_1_88_0" - "cmake.define.CGAL_DIR"="C:\a\fastjet\fastjet\CGAL-6.0.1\CGAL-6.0.1" - "cmake.define.unofficial-getopt-win32_DIR"="C:\vcpkg\packages\getopt-win32_x64-windows\share\unofficial-getopt-win32" - CIBW_ENVIRONMENT_WINDOWS: > - GMP_INC_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\include' - GMP_LIB_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\lib' - MPFR_INC_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\include' - MPFR_LIB_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\lib' + "cmake.define.Boost_INCLUDE_DIR"="${{ github.workspace }}\boost_1_88_0\boost_1_88_0" + "cmake.define.CGAL_DIR"="${{ github.workspace }}\CGAL-6.0.1\CGAL-6.0.1" + "cmake.define.FASTJET_ENABLE_CGAL"="ON" - name: Upload wheels uses: actions/upload-artifact@v4 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 48c9d825..3c6e1658 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -34,8 +34,13 @@ jobs: fail-fast: false matrix: python: [39, 310, 311, 312, 313] - os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13] # , windows-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest, windows-11-arm] arch: [auto64] + exclude: + - os: windows-11-arm + python: 39 + - os: windows-11-arm + python: 310 steps: - uses: actions/checkout@v4 @@ -43,65 +48,29 @@ jobs: submodules: recursive fetch-depth: 0 - - name: Install compiler tools on macOS + - name: Install extra deps on macOS if: runner.os == 'macOS' run: | echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV" - brew uninstall --force --ignore-dependencies gcc@12 gcc@13 gnupg gnutls isl libmpc nettle gcc mpfr gmp - brew install --ignore-dependencies m4 make automake autoconf libtool swig boost cgal + brew install --ignore-dependencies swig boost cgal echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV" - - name: Install compiler tools on windows + - if: matrix.os == 'windows-11-arm' + name: Install rustup on Windows ARM + shell: sh + run: | + curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe + ./rustup-init.exe -y --default-toolchain none --no-modify-path + echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH" + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Install extra deps on windows if: runner.os == 'windows' run: | - Install-Module -Name 7Zip4Powershell -Force Invoke-Webrequest -Uri https://archives.boost.io/release/1.88.0/source/boost_1_88_0.zip -OutFile boost_1_88_0.zip Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1.zip -OutFile CGAL-6.0.1.zip - Invoke-Webrequest -Uri https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-win64-auxiliary-libraries-gmp-mpfr.zip -OutFile cgal_auxlibs.zip - Expand-7Zip boost_1_88_0.zip .\boost_1_88_0 - Expand-7Zip CGAL-6.0.1.zip .\CGAL-6.0.1 - Expand-7Zip cgal_auxlibs.zip .\cgal_auxlibs - vcpkg.exe install getopt - - - name: Clone gmp - if: runner.os == 'macOS' - uses: actions/checkout@v4 - with: - repository: gmp-mirror/gmp-6.3 - path: gmp-6.3 - - - name: Build gmp from source for MACOSX_DEPLOYMENT_TARGET - if: runner.os == 'macOS' - working-directory: gmp-6.3 - run: | - export PATH="/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" - brew install texinfo - autoreconf -i -f - ./configure --help - ./configure \ - --prefix=$(brew --prefix) \ - --enable-cxx - touch ./doc/version.texi - make --jobs - make install - - - name: Get mpfr release - if: runner.os == 'macOS' - run: | - curl -Lk https://www.mpfr.org/mpfr-current/mpfr-4.2.2.tar.gz -o mpfr-4.2.2.tar.gz - tar -xzf mpfr-4.2.2.tar.gz - - - name: Build mpfr from source for MACOSX_DEPLOYMENT_TARGET=11.0 - if: runner.os == 'macOS' - working-directory: mpfr-4.2.2 - run: | - autoreconf -i -f - ./configure --help - ./configure \ - --prefix=$(brew --prefix) \ - --with-gmp=$(brew --prefix) - make --jobs - make install + Expand-Archive boost_1_88_0.zip .\boost_1_88_0 + Expand-Archive CGAL-6.0.1.zip .\CGAL-6.0.1 - uses: pypa/cibuildwheel@v3.0 env: @@ -110,15 +79,9 @@ jobs: CIBW_CONFIG_SETTINGS: > "cmake.define.FASTJET_ENABLE_CGAL"="ON" CIBW_CONFIG_SETTINGS_WINDOWS: > - "cmake.define.GMP_DLL_TO_COPY"="C:\\\\a\\\\fastjet\\\\fastjet\\\\cgal_auxlibs\\\\auxiliary\\\\gmp\\\\bin\\\\gmp-10.dll" - "cmake.define.Boost_INCLUDE_DIR"="C:\a\fastjet\fastjet\boost_1_88_0\boost_1_88_0" - "cmake.define.CGAL_DIR"="C:\a\fastjet\fastjet\CGAL-6.0.1\CGAL-6.0.1" - "cmake.define.unofficial-getopt-win32_DIR"="C:\vcpkg\packages\getopt-win32_x64-windows\share\unofficial-getopt-win32" - CIBW_ENVIRONMENT_WINDOWS: > - GMP_INC_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\include' - GMP_LIB_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\lib' - MPFR_INC_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\include' - MPFR_LIB_DIR='C:\a\fastjet\fastjet\cgal_auxlibs\auxiliary\gmp\lib' + "cmake.define.Boost_INCLUDE_DIR"="${{ github.workspace }}\boost_1_88_0\boost_1_88_0" + "cmake.define.CGAL_DIR"="${{ github.workspace }}\CGAL-6.0.1\CGAL-6.0.1" + "cmake.define.FASTJET_ENABLE_CGAL"="ON" - name: Upload wheels uses: actions/upload-artifact@v4 @@ -138,7 +101,7 @@ jobs: - name: Install extra deps on Linux if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libboost-dev swig autoconf libtool libcgal-dev + run: sudo apt-get update && sudo apt-get install -y libboost-dev swig libcgal-dev - name: test sdist run: python -m pip install dist/*.tar.gz diff --git a/0001-fjcontrib-top-level-only-cmake-scripts.patch b/0001-fjcontrib-top-level-only-cmake-scripts.patch deleted file mode 100644 index 67c0bd5a..00000000 --- a/0001-fjcontrib-top-level-only-cmake-scripts.patch +++ /dev/null @@ -1,389 +0,0 @@ -From fb98d019ce5bc96699ef25cbf08a7b5dcfb9a2b6 Mon Sep 17 00:00:00 2001 -From: Lindsey Gray -Date: Mon, 9 Jun 2025 18:21:34 -0500 -Subject: [PATCH 1/2] top-level-only cmake scripts - ---- - CMakeLists.txt | 229 +++++++++++++++++++++++++++++++++++ - Config.cmake.in | 5 + - contrib_CMakeLists.txt.in | 60 +++++++++ - defines.h.in | 20 +++ - inccontrib_CMakeLists.txt.in | 2 + - incdir_CMakeLists.txt.in | 5 + - incfastjet_CMakeLists.txt.in | 2 + - 7 files changed, 323 insertions(+) - create mode 100644 CMakeLists.txt - create mode 100644 Config.cmake.in - create mode 100644 contrib_CMakeLists.txt.in - create mode 100644 defines.h.in - create mode 100644 inccontrib_CMakeLists.txt.in - create mode 100644 incdir_CMakeLists.txt.in - create mode 100644 incfastjet_CMakeLists.txt.in - -diff --git a/CMakeLists.txt b/CMakeLists.txt -new file mode 100644 -index 0000000..c51bd38 ---- /dev/null -+++ b/CMakeLists.txt -@@ -0,0 +1,229 @@ -+cmake_minimum_required(VERSION 3.7.0) -+include(CMakePrintHelpers) -+ -+# set the project name -+project(FastJetContrib VERSION 1.101) -+# set a pre-release version if relevant, e.g. "-beta1" -+#set(PROJECT_VERSION_PRERELEASE "") -+set(PROJECT_VERSION_PRERELEASE "-devel") -+ -+if(MSVC) -+ execute_process(COMMAND -+ git apply --whitespace=fix -p0 0001-required-source-changes-for-windows-build.patch -+ WORKING_DIRECTORY -+ ${CMAKE_CURRENT_SOURCE_DIR} -+ ) -+endif() -+ -+#---------------------------------------------------------------------- -+# version information -+set(FASTJETCONTRIB_VERSION "${PROJECT_VERSION}${PROJECT_VERSION_PRERELEASE}") -+ -+set(FASTJETCONTRIB_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") -+set(FASTJETCONTRIB_VERSION_MINOR "${PROJECT_VERSION_MINOR}") -+set(FASTJETCONTRIB_VERSION_PATCHLEVEL "${PROJECT_VERSION_PATCH}") -+set(FASTJETCONTRIB_VERSION_PRERELEASE "${PROJECT_VERSION_PRERELEASE}") -+# build a unique version number -+if (FASTJETCONTRIB_VERSION_MINOR LESS 10) -+ set(FASTJETCONTRIB_VERSION_MINOR_FOR_NUMBER "0${FASTJETCONTRIB_VERSION_MINOR}") -+else() -+ set(FASTJETCONTRIB_VERSION_MINOR_FOR_NUMBER "${FASTJETCONTRIB_VERSION_MINOR}") -+endif() -+if (FASTJETCONTRIB_VERSION_PATCHLEVEL LESS 10) -+ set(FASTJETCONTRIB_VERSION_PATCHLEVEL_FOR_NUMBER "0${FASTJETCONTRIB_VERSION_PATCHLEVEL}") -+else() -+ set(FASTJETCONTRIB_VERSION_PATCHLEVEL_FOR_NUMBER "${FASTJETCONTRIB_VERSION_PATCHLEVEL}") -+endif() -+set(FASTJETCONTRIB_VERSION_NUMBER "${FASTJETCONTRIB_VERSION_MAJOR}${FASTJETCONTRIB_VERSION_MINOR_FOR_NUMBER}${FASTJETCONTRIB_VERSION_PATCHLEVEL_FOR_NUMBER}") -+ -+# print out the project name and version -+cmake_print_variables(PROJECT_NAME FASTJETCONTRIB_VERSION) -+ -+# need this to be able to set the installation prefix in fastjet-config -+include(GNUInstallDirs) -+ -+#---------------------------------------------------------------------- -+# basic C++ checks -+#---------------------------------------------------------------------- -+ -+# specify the C++ standard -+set(CMAKE_CXX_STANDARD 14) -+set(CMAKE_CXX_STANDARD_REQUIRED ON) -+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) -+set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG") -+if (MSVC) -+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -+endif() -+ -+ -+if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") # Intel compilers are used with -O3 -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wshadow") -+elseif (MSVC) -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /utf-8 /W4 /Ox") -+else() -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wshadow") -+endif() -+ -+# all contribs require fastjet so get it now! -+if(NOT TARGET fastjet::fastjet) -+ find_package(fastjet REQUIRED) -+endif() -+ -+list(APPEND fjcontrib_DIRNAMES -+ GenericSubtractor -+ JetFFMoments -+ VariableR -+ Nsubjettiness -+ EnergyCorrelator -+ ScJet -+ SubjetCounting -+ JetCleanser -+ JetsWithoutJets -+ ConstituentSubtractor -+ RecursiveTools -+ SoftKiller -+ ValenciaPlugin -+ ClusteringVetoPlugin -+ QCDAwarePlugin -+ FlavorCone -+ LundPlane -+ Centauro -+ KTClusCXX -+ SignalFreeBackgroundEstimator -+ IFNPlugin -+ CMPPlugin -+ SDFPlugin -+ GHSAlgo -+) -+ -+foreach (FJCONTRIB_NAME ${fjcontrib_DIRNAMES}) -+ string(TOUPPER ${FJCONTRIB_NAME} FJCONTRIB_NAME_UPPER) -+ option(FASTJETCONTRIB_ENABLE_${FJCONTRIB_NAME_UPPER} "Enable the ${FJCONTRIB_NAME} Contrib [default=ON]" ON) -+endforeach() -+option(FASTJETCONTRIB_ENABLE_FRAGILELIB "Enable fragile combined mono-library [default=OFF]" OFF) -+ -+set(fjcontrib_combined_TARGETS) -+ -+foreach (FJCONTRIB_NAME ${fjcontrib_DIRNAMES}) -+ -+ string(TOUPPER ${FJCONTRIB_NAME} FJCONTRIB_NAME_UPPER) -+ string(TOLOWER ${FJCONTRIB_NAME} FJCONTRIB_NAME_LOWER) -+ if (FASTJETCONTRIB_ENABLE_${FJCONTRIB_NAME_UPPER}) -+ configure_file(defines.h.in ${FJCONTRIB_NAME}/include/${FJCONTRIB_NAME_LOWER}_defines.h) -+ -+ set(SRCLINE) -+ set(INCLLINE) -+ set(DEPLINE) -+ file(STRINGS ${FJCONTRIB_NAME}/Makefile FJCONTRIB_MAKEFILE) -+ while(FJCONTRIB_MAKEFILE) -+ list(POP_FRONT FJCONTRIB_MAKEFILE MAKEFILE_LINE) -+ #message("${MAKEFILE_LINE}") -+ if(MAKEFILE_LINE MATCHES "^SRCS=") -+ string(REPLACE "SRCS=" "" SRCLINE "${MAKEFILE_LINE}") -+ set(${FJCONTRIB_NAME_LOWER}_SOURCES "${SRCLINE}") -+ endif() -+ if(MAKEFILE_LINE MATCHES "^INSTALLED_HEADERS=") -+ string(REPLACE "INSTALLED_HEADERS=" "" INCLLINE "${MAKEFILE_LINE}") -+ set(${FJCONTRIB_NAME_LOWER}_INCLUDES "${INCLLINE}") -+ endif() -+ if(MAKEFILE_LINE MATCHES "^DEPENDS_ON\ =") -+ string(REPLACE "DEPENDS_ON\ =" "" DEPLINE "${MAKEFILE_LINE}") -+ string(STRIP "${DEPLINE}" DEPLINE) -+ set(${FJCONTRIB_NAME_LOWER}_DEPENDENCIES "${DEPLINE}") -+ endif() -+ endwhile() -+ -+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${FJCONTRIB_NAME}/include) -+ configure_file(incfastjet_CMakeLists.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/${FJCONTRIB_NAME}/include/CMakeLists.txt COPYONLY) -+ configure_file(inccontrib_CMakeLists.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/${FJCONTRIB_NAME}/include/fastjet/CMakeLists.txt COPYONLY) -+ configure_file(incdir_CMakeLists.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/${FJCONTRIB_NAME}/include/fastjet/contrib/CMakeLists.txt) -+ endif() -+ configure_file(contrib_CMakeLists.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/${FJCONTRIB_NAME}/CMakeLists.txt) -+ -+ add_subdirectory(${FJCONTRIB_NAME}) -+ if (TARGET ${FJCONTRIB_NAME}) -+ if (FASTJETCONTRIB_ENABLE_FRAGILELIB) -+ set_target_properties(${FJCONTRIB_NAME} PROPERTIES POSITION_INDEPENDENT_CODE True) -+ endif() -+ if (MSVC) -+ target_compile_definitions(${FJCONTRIB_NAME} PUBLIC _USE_MATH_DEFINES) -+ if (FASTJETCONTRIB_ENABLE_FRAGILELIB) -+ target_compile_definitions(${FJCONTRIB_NAME} PRIVATE fastjetcontrib_EXPORTS) -+ else() -+ target_compile_definitions(${FJCONTRIB_NAME} PRIVATE ${FJCONTRIB_NAME_LOWER}_EXPORTS) -+ endif() -+ endif() -+ list(APPEND fjcontrib_combined_TARGETS $) -+ endif() -+ endif() -+ -+endforeach() -+ -+if (fjcontrib_combined_TARGETS AND FASTJETCONTRIB_ENABLE_FRAGILELIB) -+ add_library(fastjetcontribfragile SHARED ${fjcontrib_combined_TARGETS}) -+ target_link_libraries(fastjetcontribfragile PUBLIC fastjet::fastjettools) -+ foreach (FJCONTRIB_NAME ${fjcontrib_DIRNAMES}) -+ target_include_directories(fastjetcontribfragile -+ PUBLIC -+ $ -+ $ -+ $ -+ ) -+ endforeach() -+ -+ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -+ set_target_properties(fastjetcontribfragile PROPERTIES INSTALL_RPATH "@loader_path") -+ elseif (NOT MSVC) -+ set_target_properties(fastjetcontribfragile PROPERTIES INSTALL_RPATH "$ORIGIN") -+ endif() -+ -+ add_library(fastjet::contrib::fastjetcontribfragile ALIAS fastjetcontribfragile) -+ install(TARGETS -+ fastjetcontribfragile -+ EXPORT -+ FastjetContribTargets -+ RUNTIME -+ COMPONENT Runtime -+ DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY -+ COMPONENT Runtime -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE -+ COMPONENT Development -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ) -+endif() -+ -+# allow Fastjet Contrib to work with find_package -+export(EXPORT FastjetContribTargets -+ NAMESPACE fastjet::contrib:: -+ FILE "${CMAKE_CURRENT_BINARY_DIR}/fastjetcontribTargets.cmake" -+) -+ -+install(EXPORT FastjetContribTargets -+ NAMESPACE fastjet::contrib:: -+ FILE fastjetcontribTargets.cmake -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fastjetcontrib -+) -+ -+include(CMakePackageConfigHelpers) -+ -+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in -+ "${CMAKE_CURRENT_BINARY_DIR}/fastjetcontribConfig.cmake" -+ INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/fastjetcontrib" -+ NO_SET_AND_CHECK_MACRO -+ NO_CHECK_REQUIRED_COMPONENTS_MACRO -+ ) -+ -+write_basic_package_version_file( -+ "${CMAKE_CURRENT_BINARY_DIR}/fastjetcontribConfigVersion.cmake" -+ VERSION "${PROJECT_VERSION}" -+ COMPATIBILITY AnyNewerVersion -+ ) -+ -+install(FILES -+ ${CMAKE_CURRENT_BINARY_DIR}/fastjetcontribConfig.cmake -+ ${CMAKE_CURRENT_BINARY_DIR}/fastjetcontribConfigVersion.cmake -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fastjetcontrib -+ ) -+ -diff --git a/Config.cmake.in b/Config.cmake.in -new file mode 100644 -index 0000000..e4534aa ---- /dev/null -+++ b/Config.cmake.in -@@ -0,0 +1,5 @@ -+@PACKAGE_INIT@ -+ -+find_package(fastjet REQUIRED) -+ -+include ( "${CMAKE_CURRENT_LIST_DIR}/fastjetcontribTargets.cmake" ) -diff --git a/contrib_CMakeLists.txt.in b/contrib_CMakeLists.txt.in -new file mode 100644 -index 0000000..6b5df86 ---- /dev/null -+++ b/contrib_CMakeLists.txt.in -@@ -0,0 +1,60 @@ -+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${FJCONTRIB_NAME}/include) -+ add_subdirectory(include) -+ install(FILES -+ ${CMAKE_CURRENT_BINARY_DIR}/${FJCONTRIB_NAME}/include/${FJCONTRIB_NAME_LOWER}_defines.h -+ DESTINATION -+ include/fastjet/contrib -+ ) -+else() -+ file(COPY ${${FJCONTRIB_NAME_LOWER}_INCLUDES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${FJCONTRIB_NAME}/include/fastjet/contrib) -+ install(FILES -+ ${${FJCONTRIB_NAME_LOWER}_INCLUDES} -+ ${CMAKE_CURRENT_BINARY_DIR}/${FJCONTRIB_NAME}/include/${FJCONTRIB_NAME_LOWER}_defines.h -+ DESTINATION -+ include/fastjet/contrib -+ ) -+endif() -+ -+if(${FJCONTRIB_NAME_LOWER}_SOURCES) -+ -+ -+ if (FASTJETCONTRIB_ENABLE_FRAGILELIB) -+ add_library(${FJCONTRIB_NAME} OBJECT ${${FJCONTRIB_NAME_LOWER}_SOURCES}) -+ else() -+ add_library(${FJCONTRIB_NAME} SHARED ${${FJCONTRIB_NAME_LOWER}_SOURCES}) -+ endif() -+ target_link_libraries(${FJCONTRIB_NAME} PUBLIC fastjet::fastjettools ${${FJCONTRIB_NAME_LOWER}_DEPENDENCIES}) -+ if("${FJCONTRIB_NAME}" STREQUAL "SDFPlugin") -+ target_link_libraries(${FJCONTRIB_NAME} PUBLIC fastjet::fastjetplugins) -+ endif() -+ target_include_directories(${FJCONTRIB_NAME} -+ PUBLIC -+ $ -+ $ -+ $ -+ ) -+ -+ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -+ set_target_properties(${FJCONTRIB_NAME} PROPERTIES INSTALL_RPATH "@loader_path") -+ elseif (NOT MSVC) -+ set_target_properties(${FJCONTRIB_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN") -+ endif() -+ -+ if (NOT FASTJETCONTRIB_ENABLE_FRAGILELIB) -+ add_library(fastjet::contrib::${FJCONTRIB_NAME} ALIAS ${FJCONTRIB_NAME}) -+ install(TARGETS -+ ${FJCONTRIB_NAME} -+ EXPORT -+ FastjetContribTargets -+ RUNTIME -+ COMPONENT Runtime -+ DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY -+ COMPONENT Runtime -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE -+ COMPONENT Development -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ) -+ endif() -+endif() -diff --git a/defines.h.in b/defines.h.in -new file mode 100644 -index 0000000..a922989 ---- /dev/null -+++ b/defines.h.in -@@ -0,0 +1,20 @@ -+// Required definitions for exporting static variables in windows builds. -+// This is only needed for static data variables since we use -+// the CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON automation when building with cmake. -+// That automation handles all member functions. -+// So, when making a static variable please add in the beginning of a variable -+// definition, like a keyword. It is very important to use the visibility relevant -+// to the library you are working in, see below for possibilities! -+// e.g.: Nsubjettiness_VISIBILITY static bool verbosity; // inside a SomeClass.h, for instance -+// Similarly for declarations you must prefix the appropriate VISIBILITY -+// e.g. Nsubjettiness_VISIBILITY static bool SomeClass::verbosity = true; // in SomeClass.cc -+#ifdef _WIN32 -+ #if defined(${FJCONTRIB_NAME_LOWER}_EXPORTS) || defined(fastjetcontrib_EXPORTS) -+ #define ${FJCONTRIB_NAME_LOWER}_VISIBILITY __declspec(dllexport) // Export when building the DLL -+ #else -+ #define ${FJCONTRIB_NAME_LOWER}_VISIBILITY __declspec(dllimport) // Import when using the DLL -+ #endif -+#else -+ // For Linux/macOS -+ #define ${FJCONTRIB_NAME_LOWER}_VISIBILITY -+#endif -diff --git a/inccontrib_CMakeLists.txt.in b/inccontrib_CMakeLists.txt.in -new file mode 100644 -index 0000000..19c35f6 ---- /dev/null -+++ b/inccontrib_CMakeLists.txt.in -@@ -0,0 +1,2 @@ -+add_subdirectory(contrib) -+ -diff --git a/incdir_CMakeLists.txt.in b/incdir_CMakeLists.txt.in -new file mode 100644 -index 0000000..86f9c72 ---- /dev/null -+++ b/incdir_CMakeLists.txt.in -@@ -0,0 +1,5 @@ -+install(FILES -+ ${${FJCONTRIB_NAME_LOWER}_INCLUDES} -+ DESTINATION -+ include/fastjet/contrib -+ ) -diff --git a/incfastjet_CMakeLists.txt.in b/incfastjet_CMakeLists.txt.in -new file mode 100644 -index 0000000..e05498f ---- /dev/null -+++ b/incfastjet_CMakeLists.txt.in -@@ -0,0 +1,2 @@ -+add_subdirectory(fastjet) -+ --- -2.39.5 (Apple Git-154) diff --git a/0001-use-CMAKE_INSTALL_LIBDIR-consistently-in-pyinterface.patch b/0001-use-CMAKE_INSTALL_LIBDIR-consistently-in-pyinterface.patch deleted file mode 100644 index 4257ffab..00000000 --- a/0001-use-CMAKE_INSTALL_LIBDIR-consistently-in-pyinterface.patch +++ /dev/null @@ -1,27 +0,0 @@ -From fce87ff35162b911fc2241637b1f3516e4bb2d2f Mon Sep 17 00:00:00 2001 -From: Lindsey Gray -Date: Tue, 10 Jun 2025 14:04:22 -0500 -Subject: [PATCH] use CMAKE_INSTALL_LIBDIR consistently in pyinterface - ---- - pyinterface/CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pyinterface/CMakeLists.txt b/pyinterface/CMakeLists.txt -index 7016f179..88aa2ad4 100644 ---- a/pyinterface/CMakeLists.txt -+++ b/pyinterface/CMakeLists.txt -@@ -21,9 +21,9 @@ set_property(TARGET fastjet_swig PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES TR - - # NB this is specifically for building scikit-hep/fastjet wheels - if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -- set_target_properties(fastjet_swig PROPERTIES INSTALL_RPATH "@loader_path/../lib;@loader_path/../../../../lib") -+ set_target_properties(fastjet_swig PROPERTIES INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR};@loader_path/../../../../${CMAKE_INSTALL_LIBDIR}") - else() -- set_target_properties(fastjet_swig PROPERTIES INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../../../../lib") -+ set_target_properties(fastjet_swig PROPERTIES INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:$ORIGIN/../../../../${CMAKE_INSTALL_LIBDIR}") - endif() - - # Unix only, Windows is different --- -2.39.5 (Apple Git-154) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d282bc2..e6a9703f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,31 +20,19 @@ set(SKHEPFJ_FASTJET_LIB_PYMODULE_NAME "fastjet_cxx" CACHE STRING "The name of th set(PKG_INSTALL "fastjet") ## python package name +include(FetchContent) + find_package(pybind11 REQUIRED) if (SKHEPFJ_USE_INSTALLED_FASTJET) find_package(fastjet REQUIRED) else() - if (SKHEPFJ_PATCH_FJCORE) - execute_process(COMMAND - git apply --whitespace=fix ../../0001-use-CMAKE_INSTALL_LIBDIR-consistently-in-pyinterface.patch - WORKING_DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/extern/fastjet-core - ) - endif() add_subdirectory(${CMAKE_SOURCE_DIR}/extern/fastjet-core) endif() if (SKHEPFJ_USE_INSTALLED_FASTJET_CONTRIB) find_package(fastjetcontrib REQUIRED) else() - if (SKHEPFJ_PATCH_FJCONTRIB) - execute_process(COMMAND - git apply --whitespace=fix ../../0001-fjcontrib-top-level-only-cmake-scripts.patch - WORKING_DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/extern/fastjet-contrib - ) - endif() add_subdirectory(${CMAKE_SOURCE_DIR}/extern/fastjet-contrib) endif() diff --git a/extern/fastjet-contrib b/extern/fastjet-contrib index 9bd5b79e..567211bd 160000 --- a/extern/fastjet-contrib +++ b/extern/fastjet-contrib @@ -1 +1 @@ -Subproject commit 9bd5b79e0667b6f9769d1c7755320c55fc0e4595 +Subproject commit 567211bd2c0e37277881d9253d7379d84a6927b9 diff --git a/extern/fastjet-core b/extern/fastjet-core index 12a34ba4..d3c48ea3 160000 --- a/extern/fastjet-core +++ b/extern/fastjet-core @@ -1 +1 @@ -Subproject commit 12a34ba4032718036a7755fbff65ee6aa5db962f +Subproject commit d3c48ea367541f9a4abd4e2acf84c71e39b84ad7 diff --git a/pyproject.toml b/pyproject.toml index 184f0f25..2e41c1e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,22 +95,20 @@ ignore_missing_imports = true [tool.cibuildwheel] test-extras = "test" test-command = "pytest {project}/tests" +test-skip = "*-win_arm64" # skip win_arm64 tests for now since much of the wheel infrastructure is missing [tool.cibuildwheel.linux] before-all = [ - "if command -v yum > /dev/null; then yum update -y; yum install -y mpfr-devel; fi", - "if command -v apt-get > /dev/null; then apt-get update -y; apt-get install -y libmpfr-dev; fi", - "if command -v apk > /dev/null; then apk update; apk add mpfr-dev gmp-dev; fi", - "curl -L https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2 -o boost_1_87_0.tar.bz2", - "tar --bzip2 -xf boost_1_87_0.tar.bz2", - "mv boost_1_87_0/boost /usr/include/boost", - "curl -L https://github.com/CGAL/cgal/releases/download/v5.6/CGAL-5.6-library.zip -o CGAL-5.6-library.zip", - "unzip -q CGAL-5.6-library.zip", - "mkdir CGAL-5.6/build", - "cmake -S CGAL-5.6 -B CGAL-5.6/build -DCMAKE_BUILD_TYPE=\"Release\"", - "cmake --build CGAL-5.6/build --clean-first", - "cmake --install CGAL-5.6/build", - "rm -r CGAL-5.6 CGAL-5.6-library.zip", + "curl -L https://archives.boost.io/release/1.88.0/source/boost_1_88_0.tar.bz2 -o boost_1_88_0.tar.bz2", + "tar --bzip2 -xf boost_1_88_0.tar.bz2", + "mv boost_1_88_0/boost /usr/include/boost", + "curl -L https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-library.zip -o CGAL-6.0.1-library.zip", + "unzip -q CGAL-6.0.1-library.zip", + "mkdir CGAL-6.0.1/build", + "cmake -S CGAL-6.0.1 -B CGAL-6.0.1/build -DCMAKE_BUILD_TYPE=\"Release\"", + "cmake --build CGAL-6.0.1/build --clean-first", + "cmake --install CGAL-6.0.1/build", + "rm -r CGAL-6.0.1 CGAL-6.0.1-library.zip", ] [tool.scikit-build] @@ -128,6 +126,10 @@ FASTJET_ENABLE_ALLCXXPLUGINS = "ON" FASTJETCONTRIB_ENABLE_FRAGILELIB = "ON" FASTJET_ENABLE_DEBUG = "OFF" SISCONE_ENABLE_DEBUG = "OFF" +FASTJET_BUILD_EXAMPLES = "OFF" +SISCONE_BUILD_EXAMPLES = "OFF" +CGAL_CMAKE_EXACT_NT_BACKEND = "BOOST_BACKEND" +CGAL_DISABLE_GMP = "ON" [tool.setuptools_scm] write_to = "src/fastjet/version.py"