Skip to content

build: use cmake build system in fastjet and fastjet-contrib #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 130 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
5054ba7
update fastjet-core to point at fastjet/cmake-build
lgray Apr 7, 2025
27e80dd
point to fixed up fastjet branch
lgray Apr 7, 2025
2cb4f6e
with the right externs this will compile and link!
lgray Apr 7, 2025
7ea4f76
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 7, 2025
02ba232
point fastjet-contrib at CMake-ified fjcontrib repo
lgray Apr 8, 2025
b93b77c
checkpoint work
lgray Apr 8, 2025
c39b308
update fastjet contrib
lgray Apr 8, 2025
fdb820f
work on getting CI to pass
lgray Apr 8, 2025
c8eafba
almost works with scikit build (this breaks current CI)
lgray Apr 8, 2025
c08fe58
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2025
50bc2b2
install cgal as system lib in linux and macos
lgray Apr 8, 2025
7007b9e
install gfortran on macos
lgray Apr 8, 2025
b92f5d9
be a bit pushier with gfortran on macos
lgray Apr 8, 2025
b574f1f
set release build for cgal
lgray Apr 8, 2025
8658091
try for cgal-devel in manylinux?
lgray Apr 8, 2025
cda26a3
working on getting the rpath correct, presently fails and module load
lgray Apr 8, 2025
ec6e5be
skip installing cgal in manylinux since we use FetchContent
lgray Apr 8, 2025
12d9b52
wrong place
lgray Apr 8, 2025
9bfc204
remove CGAL-devel in manylinux
lgray Apr 8, 2025
fb97eee
further work on cmake install
lgray Apr 8, 2025
7f3cfb6
address review from Henry
lgray Apr 8, 2025
75ed717
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2025
97966ff
missed a comment
lgray Apr 8, 2025
5f712d3
pyproject cleanup
lgray Apr 8, 2025
505a91f
more pyproject poking
lgray Apr 8, 2025
cd4b7ec
use a linter that is compatible with pyproject
lgray Apr 8, 2025
3f20b01
try updating wheel setup
lgray Apr 8, 2025
9d2522a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2025
aa401fd
reinstall autotools for gmp rebuild
lgray Apr 8, 2025
62d03f0
reinstall gfortran for macos wheels as well
lgray Apr 8, 2025
764018b
try getting CGAL in before-all and set CGAL_DIR
lgray Apr 8, 2025
3d0b091
install CGAL in the linux image
lgray Apr 8, 2025
5da131a
derp forgot recursive
lgray Apr 8, 2025
0a0be41
update fastjet-contrib
lgray Apr 8, 2025
d0763f7
update fastjet-core
lgray Apr 8, 2025
931f2c4
update fastjet-core
lgray Apr 8, 2025
c42c23e
turn off contribs that are not used in the scikit-hep bindings
lgray Apr 8, 2025
08337ef
update fastjet-core
lgray Apr 8, 2025
2549869
update fastjet-contrib
lgray Apr 9, 2025
e5ca234
see if we can get some info about what's being linked
lgray Apr 9, 2025
3f5a2f9
remove listdeps
lgray Apr 9, 2025
620ef1e
try to uninstall gmp with brew
lgray Apr 9, 2025
7a68eb7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2025
4b722df
force remove gmp since we reinstall
lgray Apr 9, 2025
a6c5697
try just using reinstalls gmp
lgray Apr 9, 2025
2faadad
more precise install list for macos
lgray Apr 9, 2025
0e83314
rebuild brew packages with MACOSX_DEPLOYMENT_TARGET=11.0
lgray Apr 9, 2025
ef009cf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2025
cee92d0
try uninstalling homebrew and use conda instead
lgray Apr 9, 2025
a3955e9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2025
d7236e7
hacky but should work?
lgray Apr 9, 2025
d90ac17
try to only reinstall gmp from source?
lgray Apr 9, 2025
73c787f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2025
fd726a6
just set MACOSX_DEPLOYMENT_TARGET=14.0 for now to work all the way th…
lgray Apr 9, 2025
3762e03
look at libgmp build info
lgray Apr 9, 2025
d46d373
how about just not setting it?
lgray Apr 9, 2025
6bbb372
how about this?
lgray Apr 9, 2025
e537e4b
single quotes
lgray Apr 9, 2025
83b550c
restore custom gmp build, uninstall brew gcc, mpfr, gmp
lgray Apr 9, 2025
cf92e4c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2025
6f0db40
disable pxcone in scikit-hep/fastjet
lgray Apr 9, 2025
e092c56
remove more deps
lgray Apr 9, 2025
49af29e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2025
31b7b5d
--ignore-dependencies
lgray Apr 9, 2025
3b60346
forgot autoconf
lgray Apr 9, 2025
5a25605
m4
lgray Apr 9, 2025
fdd1e9b
manually build mpfr
lgray Apr 9, 2025
0adcdc5
typo
lgray Apr 9, 2025
f0edabe
set gmp directory
lgray Apr 9, 2025
4d47313
typo
lgray Apr 9, 2025
6b20bae
update fastjet-core
lgray Apr 9, 2025
5bfe92a
update complete wheel build
lgray Apr 9, 2025
0821843
wheels cleanup
lgray Apr 9, 2025
af6c136
add requirements for non-isolated build/editable install
lgray Apr 9, 2025
2b6289f
update fastjet-core
lgray Apr 9, 2025
0a6823a
update fastjet-core
lgray Apr 9, 2025
92c3113
update fastjet-core
lgray Apr 10, 2025
2a6a07f
update fastjet-core
lgray Apr 10, 2025
447fe77
update fastjet-core
lgray Apr 10, 2025
631a883
update fastjet-core
lgray Apr 10, 2025
4f70d61
update fastjet-core
lgray Apr 10, 2025
95a5fcf
update fastjet-core
lgray Apr 10, 2025
af50217
update fastjet-core
lgray Apr 10, 2025
da8f9f2
try playing around with windows
lgray Apr 27, 2025
e2a30be
no need for choco install it seems
lgray Apr 27, 2025
c559aa2
try to specify CGAL_DIR on windows
lgray Apr 27, 2025
f8b2b2c
use set in windows
lgray Apr 28, 2025
a011fb1
try different CGAL_DIR
lgray Apr 28, 2025
f464517
try the include dir
lgray Apr 28, 2025
0f6632f
further down
lgray Apr 28, 2025
9bc2b05
so it's over in share/cgal
lgray Apr 28, 2025
b775e11
try the powershell syntax?
lgray Apr 28, 2025
fc01591
add GMP, MPFR dirs
lgray Apr 28, 2025
1b0f44f
try setting GMP and MPFR lib/include dirs
lgray Apr 28, 2025
0e00291
correct naming...
lgray Apr 28, 2025
9c6a6b5
errant L
lgray Apr 28, 2025
d3f329f
hopefully this specifies boost
lgray Apr 28, 2025
172248d
boost_headers for cmake
lgray Apr 29, 2025
9b22100
fastjet-core on cmake-build-windows
lgray May 7, 2025
4c70206
install getopt, specify install location
lgray May 7, 2025
d220aa0
update with windows mods with fjcontrib
lgray May 7, 2025
45b42c5
update fastjet-contrib
lgray May 7, 2025
8f6bb58
add escaping for getopt env variable
lgray May 7, 2025
9402091
pass getopt location by commandline
lgray May 7, 2025
8f23c1b
try adding to CMAKE_PREFIX_PATH
lgray May 7, 2025
f839db0
specify boost_config_DIR as well (yikes)
lgray May 7, 2025
ddd14c3
try installing boost through choco?
lgray May 7, 2025
a1b2db5
update fastjet-contrib
lgray May 7, 2025
64cf958
update fastjet-contrib
lgray May 7, 2025
f96ddae
more fastjet-contrib fixes
lgray May 8, 2025
5aa042d
update fastjet-contrib
lgray May 8, 2025
0f49cf4
switch to Ninja for generator
lgray May 8, 2025
6747d99
guess we're using MSBuild; sanity--;
lgray May 8, 2025
b9764c3
turn off CGAL while we understand what is wrong with fastjet-contrib
lgray May 8, 2025
624251b
update fastjet-contrib
lgray May 8, 2025
0a6beb3
more #define _USE_MATH_DEFINES
lgray May 8, 2025
2079b42
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 8, 2025
05fc94e
Revert "turn off CGAL while we understand what is wrong with fastjet-…
lgray May 8, 2025
a5d4513
might be missing msvc-runtime?
lgray May 8, 2025
08e760e
add in cmake variable to hack copying of gmp dlls
lgray May 9, 2025
495fa55
use GMP_DLL_TO_COPY
lgray May 9, 2025
491b753
try test build of windows wheel
lgray May 9, 2025
de9527f
better way to specify config settings
lgray May 9, 2025
3d03d34
don't need the -C
lgray May 9, 2025
e54611f
try appending to CMAKE_PREFIX_PATH instead?
lgray May 9, 2025
97e4e88
try as additional command line define...
lgray May 9, 2025
29e1f87
add windows to full wheel matrix; reduce cibw verbosity
lgray May 9, 2025
aaadb5b
reduce cibw verbosity
lgray May 9, 2025
dacee83
turn off debug info in windows wheels, double escape windows path to …
lgray May 10, 2025
85a46d1
turn off windows debug in wheel matrix, better escaping
lgray May 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 70 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,39 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.13"]
runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
arch: [auto64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install compiler tools on windows
if: runner.os == 'windows'
run: |
choco install boost-msvc-14.1
vcpkg.exe install cgal getopt

- name: Install compiler tools on macOS
if: runner.os == 'macOS'
run: |
brew install make automake swig gmp mpfr boost libtool
brew reinstall gfortran
brew install swig boost cgal gmp mpfr

- 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 autoconf libtool
run: sudo apt-get update && sudo apt-get install -y libboost-dev libmpfr-dev swig libcgal-dev

- name: Install package (MacOS)
- name: Install package (macOS)
if: runner.os == 'macOS'
run: |
eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH="/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
export CPPFLAGS+="-I/opt/homebrew/include -L/opt/homebrew/lib"
export CXXFLAGS+="-I/opt/homebrew/include -L/opt/homebrew/lib"
export CFLAGS+="-I/opt/homebrew/include -L/opt/homebrew/lib"
export LDFLAGS+="-L/opt/homebrew/lib"
python -m pip install '.[test]' -v

- name: Install package (Linux)
Expand All @@ -71,6 +75,18 @@ jobs:
echo $PATH
python -m pip install '.[test]' -v

- name: Install package (windows)
if: runner.os == 'windows'
run: |
$Env:Path
$Env:CGAL_DIR = 'C:\vcpkg\packages\cgal_x64-windows\share\cgal'
$Env:GMP_INC_DIR = 'C:\vcpkg\packages\gmp_x64-windows\include'
$Env:GMP_LIB_DIR = 'C:\vcpkg\packages\gmp_x64-windows\lib'
$Env:MPFR_INC_DIR = 'C:\vcpkg\packages\mpfr_x64-windows\include'
$Env:MPFR_LIB_DIR = 'C:\vcpkg\packages\mpfr_x64-windows\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:\\vcpkg\\packages\\gmp_x64-windows\\bin\\gmp-10.dll" -C"cmake.define.FASTJET_ENABLE_DEBUG"="OFF" -C"cmake.define.SISCONE_ENABLE_DEBUG"="OFF"

- name: List installed Python packages
run: python -m pip list

Expand All @@ -83,25 +99,33 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest]
python: [313]
arch: [auto64]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Install compiler tools on macOS
if: runner.os == 'macOS'
run: |
brew install make automake swig mpfr boost libtool
echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV"
echo "CPPFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CPPFLAGS" >> "$GITHUB_ENV"
echo "CXXFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CXXFLAGS" >> "$GITHUB_ENV"
echo "CFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CFLAGS" >> "$GITHUB_ENV"
echo "LDFLAGS=-L/opt/homebrew/lib $LDFLAGS" >> "$GITHUB_ENV"
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV"
brew uninstall gcc@12 gcc@13 gnupg gnutls isl libmpc nettle gcc mpfr gmp --ignore-dependencies
brew install m4 make automake autoconf libtool swig boost cgal --ignore-dependencies
echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV"

- name: Install compiler tools on windows
if: runner.os == 'windows'
run: |
choco install boost-msvc-14.1
vcpkg.exe install cgal getopt

- 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'
Expand All @@ -110,7 +134,7 @@ jobs:
repository: gmp-mirror/gmp-6.3
path: gmp-6.3

- name: Build gmp from source for MACOSX_DEPLOYMENT_TARGET
- name: Build gmp from source for MACOSX_DEPLOYMENT_TARGET=11.0
if: runner.os == 'macOS'
working-directory: gmp-6.3
run: |
Expand All @@ -124,11 +148,40 @@ jobs:
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

- uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: cp${{ matrix.python }}-*
CIBW_BUILD_VERBOSITY: 2
CIBW_BUILD_VERBOSITY: 1
CIBW_CONFIG_SETTINGS_WINDOWS: >
"cmake.define.GMP_DLL_TO_COPY"="C:\\\\vcpkg\\\\packages\\\\gmp_x64-windows\\\\bin\\\\gmp-10.dll"
"cmake.define.unofficial-getopt-win32_DIR"="C:\\vcpkg\\packages\\getopt-win32_x64-windows\\share\\unofficial-getopt-win32"
"cmake.define.FASTJET_ENABLE_DEBUG"="OFF"
"cmake.define.SISCONE_ENABLE_DEBUG"="OFF"
CIBW_ENVIRONMENT_WINDOWS: >
CGAL_DIR='C:\vcpkg\packages\cgal_x64-windows\share\cgal'
GMP_INC_DIR='C:\vcpkg\packages\gmp_x64-windows\include'
GMP_LIB_DIR='C:\vcpkg\packages\gmp_x64-windows\lib'
MPFR_INC_DIR='C:\vcpkg\packages\mpfr_x64-windows\include'
MPFR_LIB_DIR='C:\vcpkg\packages\mpfr_x64-windows\lib'

- name: Upload wheels
uses: actions/upload-artifact@v4
Expand Down
52 changes: 43 additions & 9 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Build SDist
run: pipx run build --sdist
Expand All @@ -33,24 +34,28 @@ jobs:
fail-fast: false
matrix:
python: [39, 310, 311, 312, 313]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest]
arch: [auto64]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Install compiler tools on macOS
if: runner.os == 'macOS'
run: |
brew install make automake swig mpfr boost libtool
echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV"
echo "CPPFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CPPFLAGS" >> "$GITHUB_ENV"
echo "CXXFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CXXFLAGS" >> "$GITHUB_ENV"
echo "CFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CFLAGS" >> "$GITHUB_ENV"
echo "LDFLAGS=-L/opt/homebrew/lib $LDFLAGS" >> "$GITHUB_ENV"
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV"
brew uninstall gcc@12 gcc@13 gnupg gnutls isl libmpc nettle gcc mpfr gmp --ignore-dependencies
brew install m4 make automake autoconf libtool swig boost cgal --ignore-dependencies
echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV"

- name: Install compiler tools on windows
if: runner.os == 'windows'
run: |
choco install boost-msvc-14.1
vcpkg.exe install cgal getopt

- name: Clone gmp
if: runner.os == 'macOS'
Expand All @@ -74,11 +79,40 @@ jobs:
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

- uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: cp${{ matrix.python }}-*
CIBW_BUILD_VERBOSITY: 2
CIBW_BUILD_VERBOSITY: 1
CIBW_CONFIG_SETTINGS_WINDOWS: >
"cmake.define.GMP_DLL_TO_COPY"="C:\\\\vcpkg\\\\packages\\\\gmp_x64-windows\\\\bin\\\\gmp-10.dll"
"cmake.define.unofficial-getopt-win32_DIR"="C:\\vcpkg\\packages\\getopt-win32_x64-windows\\share\\unofficial-getopt-win32"
"cmake.define.FASTJET_ENABLE_DEBUG"="OFF"
"cmake.define.SISCONE_ENABLE_DEBUG"="OFF"
CIBW_ENVIRONMENT_WINDOWS: >
CGAL_DIR='C:\vcpkg\packages\cgal_x64-windows\share\cgal'
GMP_INC_DIR='C:\vcpkg\packages\gmp_x64-windows\include'
GMP_LIB_DIR='C:\vcpkg\packages\gmp_x64-windows\lib'
MPFR_INC_DIR='C:\vcpkg\packages\mpfr_x64-windows\include'
MPFR_LIB_DIR='C:\vcpkg\packages\mpfr_x64-windows\lib'

- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -98,7 +132,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
run: sudo apt-get update && sudo apt-get install -y libboost-dev swig autoconf libtool libcgal-dev

- name: test sdist
run: python -m pip install dist/*.tar.gz
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
src/fastjet/version.py
_swig.py
_fastjet_core
*.so.[0-9]
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
url = https://gitlab.com/fastjet/fastjet.git
[submodule "fastjet-contrib"]
path = extern/fastjet-contrib
url = https://github.com/cms-externals/fastjet-contrib.git
url = https://github.com/lgray/fastjet-contrib.git
15 changes: 4 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,11 @@ repos:
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/pycqa/flake8
rev: 7.2.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.4
hooks:
- id: flake8
exclude: docs/conf.py
additional_dependencies: [flake8-bugbear, flake8-print]

- repo: https://github.com/mgedmin/check-manifest
rev: "0.50"
hooks:
- id: check-manifest
stages: [manual]
- id: ruff
args: [--fix, --show-fixes]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v20.1.0"
Expand Down
52 changes: 52 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.15...4.0)

if(NOT SKBUILD_PROJECT_VERSION)
set(SKBUILD_PROJECT_VERSION "0.0.0") # provided by scikit-build-core
endif()
string(REPLACE "." ";" VERSION_SPLIT ${SKBUILD_PROJECT_VERSION})
list(GET VERSION_SPLIT 0 SPLIT_VERSION_MAJOR)
list(GET VERSION_SPLIT 1 SPLIT_VERSION_MINOR)

project(fastjet VERSION ${SPLIT_VERSION_MAJOR}.${SPLIT_VERSION_MINOR} LANGUAGES CXX)

set(PKG_INSTALL "fastjet") ## python package name

include(FetchContent)

find_package(pybind11 REQUIRED)

find_package(CGAL)
if (NOT CGAL_FOUND)
FetchContent_Declare(CGAL
GIT_REPOSITORY https://github.com/CGAL/cgal.git
GIT_TAG v6.0.1
)
FetchContent_MakeAvailable(CGAL)
endif()

#FetchContent_Declare(fastjet
# SOURCE_DIR ${CMAKE_SOURCE_DIR}/extern/fastjet-core
# CMAKE_ARGS "-DCMAKE_BUILD_TYPE=\"Release\" -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/${PKG_INSTALL} -DFASTJET_CUSTOM_PYTHON_INSTALL=lib/${PKG_INSTALL} -DFASTJET_PYTHON_PACKAGE_NAME=_swig -DFASTJET_ENABLE_CGAL=ON"
# )
#FetchContent_MakeAvailable(fastjet)

add_subdirectory(${CMAKE_SOURCE_DIR}/extern/fastjet-core)
add_subdirectory(${CMAKE_SOURCE_DIR}/extern/fastjet-contrib)

pybind11_add_module(_ext MODULE src/_ext.cpp)
target_link_libraries(_ext PRIVATE fastjet::fastjet)
target_link_libraries(_ext PRIVATE EnergyCorrelator LundPlane Nsubjettiness RecursiveTools)
target_include_directories(_ext PRIVATE ${CMAKE_BINARY_DIR}/include)
#set_target_properties(_ext PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
#set_target_properties(_ext PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(_ext PROPERTIES INSTALL_RPATH "@loader_path/lib")
else()
set_target_properties(_ext PROPERTIES INSTALL_RPATH "$ORIGIN/lib")
endif()

if (MSVC AND FASTJET_ENABLE_CGAL)
message("-- Copying ${GMP_DLL_TO_COPY} to project area!")
install(FILES ${GMP_DLL_TO_COPY} DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
install(TARGETS _ext LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX})
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion extern/fastjet-contrib
Submodule fastjet-contrib updated 223 files
2 changes: 1 addition & 1 deletion extern/fastjet-core
Submodule fastjet-core updated from 0648cf to af81ba
Loading
Loading