Skip to content

Commit 149515d

Browse files
authored
Merge pull request #42 from esa/python-313-fix
Python 3.13 Wheels/ Release 3.2.1
2 parents 0065a7e + 32d1211 commit 149515d

File tree

5 files changed

+36
-38
lines changed

5 files changed

+36
-38
lines changed

.github/workflows/wheels.yml

+15-23
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,36 @@ jobs:
2323
- uses: actions/checkout@v3
2424
############################# LINUX WHEELS #############################
2525
# In case of Linux we need to install compiler and build tools before building the wheels
26-
# We only build the manylinux wheels, but not the musllinux wheels (due to some compile problems)
2726
# We set-up QEMU to enable aarch64 builds in the GitHub Runner (which is x86_64 based)
27+
# We build wheels for manylinux and musllinux for aarch64 and x86_64
2828
- name: Set up QEMU
2929
uses: docker/setup-qemu-action@v3
3030
with:
3131
platforms: all
3232
if: matrix.os == 'ubuntu-latest'
3333
- name: Build wheels (Linux)
34-
uses: pypa/cibuildwheel@v2.17.0
34+
uses: pypa/cibuildwheel@v2.20.0
3535
env:
36-
CIBW_BEFORE_BUILD: yum makecache && yum install -y gcc-c++ cmake && pip install ninja
37-
CIBW_BUILD: "*manylinux*"
36+
CIBW_BEFORE_BUILD: pipx install ninja cmake
37+
CIBW_FREE_THREADED_SUPPORT: 1
3838
CIBW_ARCHS_LINUX: "x86_64 aarch64"
3939
CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"'
4040
with:
4141
package-dir: .
4242
output-dir: dist
4343
if: matrix.os == 'ubuntu-latest'
4444
############################# MACOS WHEELS #############################
45-
# We use Apple Clang, the macOS GitHub Runner is nowadays arm64 based
46-
# The GCC compiler installable via brew does not support cross-compiling for x86_64. Hence, also Apple Claang
45+
# We use Apple Clang as it is the only compiler offering cross-compiling for x86_64
46+
# The macOS GitHub Runner is nowadays arm64 based
4747
# For the x86_64, we set the MACOSX_DEPLOYMENT_TARGET='10.13' (released 2017) in order to have support for C++17
48-
# We don't need this for the arm64 stuff since it works (and macOS on arm64 cam after C++17)
49-
- name: Build wheels (macOS ARM)
50-
uses: pypa/cibuildwheel@v2.17.0
48+
# We don't need this for arm64 since macOS arm64 initially supported C++17/ came years later than macOS 10.13
49+
- name: Build wheels (macOS)
50+
uses: pypa/cibuildwheel@v2.20.0
5151
env:
52-
CIBW_BEFORE_BUILD: brew install ninja
53-
CIBW_ARCHS_MACOS: "arm64"
54-
CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"'
55-
with:
56-
package-dir: .
57-
output-dir: dist
58-
if: matrix.os == 'macos-latest'
59-
- name: Build wheels (macOS x86_64)
60-
uses: pypa/[email protected]
61-
env:
62-
CIBW_BEFORE_BUILD: brew install ninja
52+
CIBW_BEFORE_BUILD: pipx install ninja cmake
53+
CIBW_FREE_THREADED_SUPPORT: 1
6354
CIBW_ENVIRONMENT: 'MACOSX_DEPLOYMENT_TARGET="10.13"'
64-
CIBW_ARCHS_MACOS: "x86_64"
55+
CIBW_ARCHS_MACOS: "x86_64 arm64"
6556
CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"'
6657
with:
6758
package-dir: .
@@ -70,12 +61,13 @@ jobs:
7061
############################# WINDOWS WHEELS #############################
7162
# Set up the Visual Studio environment on Windows (required, so that CMake finds the compiler)
7263
# We use the Microsoft Visual Studio Compiler to compile the wheel
64+
# As of 09.09.2024, it is not yet possible to build free-threaded wheel on Windows
7365
- uses: ilammy/msvc-dev-cmd@v1
7466
if: matrix.os == 'windows-latest'
7567
- name: Build wheels (Windows)
76-
uses: pypa/cibuildwheel@v2.17.0
68+
uses: pypa/cibuildwheel@v2.20.0
7769
env:
78-
CIBW_BEFORE_BUILD: choco install -y ninja cmake
70+
CIBW_BEFORE_BUILD: pipx install ninja cmake
7971
CIBW_ARCHS_WINDOWS: "auto64"
8072
CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"'
8173
with:

CMakeLists.txt

+10-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ option(USE_LOCAL_TBB "Uses the local tbb installation rather than on using the a
1919
GitHub via CMake (Default: OFF)" OFF)
2020

2121
# Set the Logging Level
22-
set(LOGGING_LEVEL "2" CACHE STRING "Set the Logging level, default (INFO=2), available options:
23-
TRACE=0, DEBUG=1, INFO=2, WARN=3, ERROR=4, CRITICAL=5, OFF=6")
24-
set_property(CACHE LOGGING_LEVEL PROPERTY STRINGS 0, 1, 2, 3, 4, 5, 6)
25-
add_compile_definitions(SPDLOG_ACTIVE_LEVEL=${LOGGING_LEVEL})
22+
set(LOGGING_LEVEL_LIST "TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF")
23+
set(LOGGING_LEVEL "INFO" CACHE STRING "Set the Logging level, default (INFO), available options: TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL, OFF")
24+
set_property(CACHE LOGGING_LEVEL PROPERTY STRINGS ${LOGGING_LEVEL_LIST})
25+
# Convert the logging level string to its corresponding number
26+
list(FIND LOGGING_LEVEL_LIST ${LOGGING_LEVEL} LOGGING_LEVEL_INDEX)
27+
if (${LOGGING_LEVEL_INDEX} EQUAL -1)
28+
message(FATAL_ERROR "Invalid logging level: ${LOGGING_LEVEL}")
29+
endif ()
30+
add_compile_definitions(SPDLOG_ACTIVE_LEVEL=${LOGGING_LEVEL_INDEX})
31+
message(STATUS "Logging level set to ${LOGGING_LEVEL} (=${LOGGING_LEVEL_INDEX})")
2632

2733
###################################
2834
# What actually to build? - Options

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,14 @@ cmake --build .
305305

306306
The following options are available:
307307

308-
| Name (Default) | Options |
309-
|-------------------------------------------:|:-------------------------------------------------------------------------------------------|
310-
| POLYHEDRAL_GRAVITY_PARALLELIZATION (`CPP`) | `CPP` = Serial Execution / `OMP` or `TBB` = Parallel Execution with OpenMP or Intel\'s TBB |
311-
| LOGGING_LEVEL (`2`) | `0` = TRACE/ `1` = DEBUG/ `2` = INFO / `3` = WARN/ `4` = ERROR/ `5` = CRITICAL/ `6` = OFF |
312-
| USE_LOCAL_TBB (`OFF`) | Use a local installation of `TBB` instead of setting it up via `CMake` |
313-
| BUILD_POLYHEDRAL_GRAVITY_DOCS (`OFF`) | Build this documentation |
314-
| BUILD_POLYHEDRAL_GRAVITY_TESTS (`ON`) | Build the Tests |
315-
| BUILD_POLYHEDRAL_PYTHON_INTERFACE (`ON`) | Build the Python interface |
308+
| Name (Default) | Options |
309+
|-------------------------------------------:|:--------------------------------------------------------------------------------------------|
310+
| POLYHEDRAL_GRAVITY_PARALLELIZATION (`CPP`) | `CPP` = Serial Execution / `OMP` or `TBB` = Parallel Execution with OpenMP or Intel\'s TBB |
311+
| LOGGING_LEVEL (`INFO`) | `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `CRITICAL`, `OFF` |
312+
| USE_LOCAL_TBB (`OFF`) | Use a local installation of `TBB` instead of setting it up via `CMake` |
313+
| BUILD_POLYHEDRAL_GRAVITY_DOCS (`OFF`) | Build this documentation |
314+
| BUILD_POLYHEDRAL_GRAVITY_TESTS (`ON`) | Build the Tests |
315+
| BUILD_POLYHEDRAL_PYTHON_INTERFACE (`ON`) | Build the Python interface |
316316

317317
During testing POLYHEDRAL_GRAVITY_PARALLELIZATION=`TBB` has been the most performant.
318318
It is further not recommend to change the LOGGING_LEVEL to something else than `INFO=2`.

docs/quickstart/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The available options are the following:
9191
Name (Default) Options
9292
================================================ ===================================================================================================================================
9393
POLYHEDRAL_GRAVITY_PARALLELIZATION (:code:`CPP`) :code:`CPP` = Serial Execution / :code:`OMP` or :code:`TBB` = Parallel Execution with OpenMP or Intel's TBB
94-
LOGGING_LEVEL (:code:`2`) :code:`0` = TRACE/ :code:`1` = DEBUG/ :code:`2` = INFO / :code:`3` = WARN/ :code:`4` = ERROR/ :code:`5` = CRITICAL/ :code:`6` = OFF
94+
LOGGING_LEVEL (:code:`INFO`) :code:`TRACE`, :code:`DEBUG`, :code:`INFO`, :code:`WARN`, :code:`ERROR`, :code:`CRITICAL`, :code:`OFF`
9595
USE_LOCAL_TBB (:code:`OFF`) Use a local installation of :code:`TBB` instead of setting it up via :code:`CMake`
9696
BUILD_POLYHEDRAL_GRAVITY_DOCS (:code:`OFF`) Build this documentation
9797
BUILD_POLYHEDRAL_GRAVITY_TESTS (:code:`ON`) Build the Tests

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Modify to change the parallelization (Default value: TBB)
1919
"POLYHEDRAL_GRAVITY_PARALLELIZATION": "TBB",
2020
# Default value (INFO=2)
21-
"LOGGING_LEVEL": 2,
21+
"LOGGING_LEVEL": "INFO",
2222
# Default value (OFF)
2323
"USE_LOCAL_TBB": "OFF",
2424
# Not required for the python interface (--> OFF)
@@ -175,7 +175,7 @@ def build_extension(self, ext):
175175
# --------------------------------------------------------------------------------
176176
setup(
177177
name="polyhedral_gravity",
178-
version="3.2",
178+
version="3.2.1",
179179
author="Jonas Schuhmacher",
180180
author_email="[email protected]",
181181
description="Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points "

0 commit comments

Comments
 (0)