From 12e38bd1186704fa36e592ad08527b2876f7febe Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Mon, 13 May 2024 20:23:58 +0200 Subject: [PATCH 1/7] fix the broken macOS x86_64 wheel deployment The GitHub Runner is arm64-based: - cross-compiling with GNU/GCC does not work - only Apple Clang + TBB requires C++17 - Hence minimal deployment target macOS 10.13 (release 2017) - Discontinuance support for macOS < 10.13 (pre-2017) --- .github/workflows/wheels.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3521e30..a09274b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -23,7 +23,8 @@ jobs: - uses: actions/checkout@v3 ############################# LINUX WHEELS ############################# # In case of Linux we need to install compiler and build tools before building the wheels - # We further only build the manylinux wheels, but not the musllinux wheels + # We only build the manylinux wheels, but not the musllinux wheels (due to some compile problems) + # We set-up QEMU to enable aarch64 builds in the GitHub Runner (which is x86_64 based) - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: @@ -41,8 +42,10 @@ jobs: output-dir: dist if: matrix.os == 'ubuntu-latest' ############################# MACOS WHEELS ############################# - # Building on macOS requires an installation of gcc since the default clang compiler - # lacks certain features required for building the package + # We use Apple Clang, the macOS GitHub Runner is nowadays arm64 based + # The GCC compiler installable via brew does not support cross-compiling for x86_64. Hence, also Apple Claang + # For the x86_64, we set the MACOSX_DEPLOYMENT_TARGET='10.13' (released 2017) in order to have support for C++17 + # We don't need this for the arm64 stuff since it works (and macOS on arm64 cam after C++17) - name: Build wheels (macOS ARM) uses: pypa/cibuildwheel@v2.17.0 env: @@ -56,8 +59,8 @@ jobs: - name: Build wheels (macOS x86_64) uses: pypa/cibuildwheel@v2.17.0 env: - CIBW_BEFORE_BUILD: brew install ninja gcc@12 - CIBW_ENVIRONMENT: "CC=gcc-12 CXX=g++-12" + CIBW_BEFORE_BUILD: brew install ninja + CIBW_ENVIRONMENT: 'MACOSX_DEPLOYMENT_TARGET="10.13"' CIBW_ARCHS_MACOS: "x86_64" CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"' with: @@ -66,6 +69,7 @@ jobs: if: matrix.os == 'macos-latest' ############################# WINDOWS WHEELS ############################# # Set up the Visual Studio environment on Windows (required, so that CMake finds the compiler) + # We use the Microsoft Visual Studio Compiler to compile the wheel - uses: ilammy/msvc-dev-cmd@v1 if: matrix.os == 'windows-latest' - name: Build wheels (Windows) From 8421550ee54eb1e6d244b01f28f6e790fea2eb13 Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Mon, 13 May 2024 20:24:21 +0200 Subject: [PATCH 2/7] bump up versions of dependencies --- cmake/pybind11.cmake | 7 +++---- cmake/spdlog.cmake | 7 +++---- cmake/tbb.cmake | 6 +++--- cmake/yaml.cmake | 6 +++--- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cmake/pybind11.cmake b/cmake/pybind11.cmake index 774e98c..be320d9 100644 --- a/cmake/pybind11.cmake +++ b/cmake/pybind11.cmake @@ -2,7 +2,7 @@ include(FetchContent) message(STATUS "Setting up pybind11") -find_package(pybind11 2.10.4 QUIET) +find_package(pybind11 2.12.0 QUIET) if (${pybind11_FOUND}) @@ -12,11 +12,10 @@ else() message(STATUS "Using pybind11 from git repository") - #Fetches the version 2.10.4 from the official github of pybind11 FetchContent_Declare(pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11 - GIT_TAG v2.10.4 - ) + GIT_TAG v2.12.0 + ) FetchContent_MakeAvailable(pybind11) diff --git a/cmake/spdlog.cmake b/cmake/spdlog.cmake index dd924a4..0aa0367 100644 --- a/cmake/spdlog.cmake +++ b/cmake/spdlog.cmake @@ -2,7 +2,7 @@ include(FetchContent) message(STATUS "Setting up spdlog") -find_package(spdlog 1.11.0 QUIET) +find_package(spdlog 1.14.1 QUIET) if (${spdlog_FOUND}) @@ -12,11 +12,10 @@ else() message(STATUS "Using spdlog from git repository") - #Fetches the version 1.11.0 for spdlog FetchContent_Declare(spdlog GIT_REPOSITORY https://github.com/gabime/spdlog.git - GIT_TAG v1.11.0 - ) + GIT_TAG v1.14.1 + ) # Disable stuff we don't need option(SPDLOG_BUILD_EXAMPLE "" OFF) diff --git a/cmake/tbb.cmake b/cmake/tbb.cmake index 44a1707..3f6136d 100644 --- a/cmake/tbb.cmake +++ b/cmake/tbb.cmake @@ -2,11 +2,11 @@ include(FetchContent) message(STATUS "Setting up tbb via CMake") -#Fetches the version v2021.5.0 from the official github of tbb +#Fetches the version v2021.12.0 from the official github of tbb FetchContent_Declare(tbb GIT_REPOSITORY https://github.com/oneapi-src/oneTBB.git - GIT_TAG v2021.5.0 - ) + GIT_TAG v2021.12.0 +) # Disable tests & and do not treat tbb-compile errors as warnings option(TBB_TEST "Enable testing" OFF) diff --git a/cmake/yaml.cmake b/cmake/yaml.cmake index 7ac6ca3..8896a98 100644 --- a/cmake/yaml.cmake +++ b/cmake/yaml.cmake @@ -2,7 +2,7 @@ include(FetchContent) message(STATUS "Setting up yaml-cpp") -find_package(yaml-cpp 0.7.0 QUIET) +find_package(yaml-cpp 0.8.0 QUIET) if (${yaml-cpp_FOUND}) @@ -10,10 +10,10 @@ if (${yaml-cpp_FOUND}) else() - #Fetches the version 0.7.0 for yaml-cpp + #Fetches the version 0.8.0 for yaml-cpp FetchContent_Declare(yaml-cpp GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git - GIT_TAG yaml-cpp-0.7.0 + GIT_TAG 0.8.0 ) # Disable everything we don't need From e5cb692eb7c8189e1d1e2b5f807ad5cd3f7bb170 Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Mon, 13 May 2024 20:29:53 +0200 Subject: [PATCH 3/7] increment version to 3.2rc1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 70d486d..fbeb581 100644 --- a/setup.py +++ b/setup.py @@ -175,7 +175,7 @@ def build_extension(self, ext): # -------------------------------------------------------------------------------- setup( name="polyhedral_gravity", - version="3.1", + version="3.2rc1", author="Jonas Schuhmacher", author_email="jonas.schuhmacher@tum.de", description="Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points " From 915db4b49b15e0bee91f14004ab589c328c49eb9 Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Tue, 14 May 2024 00:35:38 +0200 Subject: [PATCH 4/7] increment version to 3.2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fbeb581..a5139d2 100644 --- a/setup.py +++ b/setup.py @@ -175,7 +175,7 @@ def build_extension(self, ext): # -------------------------------------------------------------------------------- setup( name="polyhedral_gravity", - version="3.2rc1", + version="3.2", author="Jonas Schuhmacher", author_email="jonas.schuhmacher@tum.de", description="Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points " From 8a513597594fdceb5501dcc146cfe3b50f36c0a2 Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Tue, 14 May 2024 00:49:43 +0200 Subject: [PATCH 5/7] spelling and grammar --- docs/background/mesh_integrity.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/background/mesh_integrity.rst b/docs/background/mesh_integrity.rst index dd9dda9..7b756b0 100644 --- a/docs/background/mesh_integrity.rst +++ b/docs/background/mesh_integrity.rst @@ -54,13 +54,13 @@ The :code:`Polyhedron` class checks the pointing direction of every single normal. This way, the `Polyhedron` ensures correct results even if a mistake occurs during the definition. Since we are in 3D and might have concave and convex polyhedrons, -the viable option is the `Möller–Trumbore intersection algorithm `__. -It checks the amount of intersections the plane unit normal has with the polyhedron. -If its an even number, the normals is :code:`OUTWARDS` pointing, otherwise :code:`INWARDS`. +the most viable option is the `Möller–Trumbore intersection algorithm `__. +It checks the amount of intersections each plane unit normal has with the polyhedron. +If this is an even number, the normal is :code:`OUTWARDS` pointing, otherwise :code:`INWARDS`. In the *current implementation*, we implement a naiv version which takes :math:`O(n^2)` operations - which can get quite expensive for polyhedrons with many faces. -To make this as straightforward to use as possible, we provide four options +To make this as straightforward to use, we provide four options for the construction of a polyhedron in the form of the enum :code:`PolyhedronIntegrity`: +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------+----------------+ From 75a0732920cca127f569cb5088b7fa1a2f149a5e Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Wed, 15 May 2024 02:39:44 +0200 Subject: [PATCH 6/7] decrease spdlog version to 1.13.0 spdlog 1.14.1 an 1.14.0 are not yet available on conda-forge. This might cause issues for the conda-deployment otherwise --- cmake/spdlog.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/spdlog.cmake b/cmake/spdlog.cmake index 0aa0367..d5a8d0f 100644 --- a/cmake/spdlog.cmake +++ b/cmake/spdlog.cmake @@ -2,7 +2,7 @@ include(FetchContent) message(STATUS "Setting up spdlog") -find_package(spdlog 1.14.1 QUIET) +find_package(spdlog 1.13.0 QUIET) if (${spdlog_FOUND}) @@ -14,7 +14,7 @@ else() FetchContent_Declare(spdlog GIT_REPOSITORY https://github.com/gabime/spdlog.git - GIT_TAG v1.14.1 + GIT_TAG v1.13.0 ) # Disable stuff we don't need From fc28b110edac36bf0621dc93b2d1981376c0d5c4 Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Wed, 15 May 2024 02:43:20 +0200 Subject: [PATCH 7/7] updates versions in docs --- README.md | 6 +++--- docs/quickstart/installation.rst | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 22805c9..5c56017 100644 --- a/README.md +++ b/README.md @@ -258,12 +258,12 @@ The project uses the following dependencies, all of them are **automatically** set-up via CMake: - GoogleTest (1.13.0 or compatible), only required for testing -- spdlog (1.11.0 or compatible), required for logging +- spdlog (1.13.0 or compatible), required for logging - tetgen (1.6 or compatible), required for I/O -- yaml-cpp (0.7.0 or compatible), required for I/O +- yaml-cpp (0.8.0 or compatible), required for I/O - thrust (2.1.0 or compatible), required for parallelization and utility - xsimd (11.1.0 or compatible), required for vectorization of the `atan(..)` -- pybind11 (2.10.4 or compatible), required for the Python interface, but not the C++ standalone +- pybind11 (2.12.0 or compatible), required for the Python interface, but not the C++ standalone The module will be build using a C++17 capable compiler, CMake. Just execute the following command in diff --git a/docs/quickstart/installation.rst b/docs/quickstart/installation.rst index e4a0621..af9871c 100644 --- a/docs/quickstart/installation.rst +++ b/docs/quickstart/installation.rst @@ -105,10 +105,10 @@ Dependencies (automatically set-up) Dependencies (all of them are automatically set-up via :code:`CMake`): - GoogleTest (1.13.0 or compatible), only required for testing -- spdlog (1.11.0 or compatible), required for logging +- spdlog (1.13.0 or compatible), required for logging - tetgen (1.6 or compatible), required for I/O -- yaml-cpp (0.7.0 or compatible), required for I/O +- yaml-cpp (0.8.0 or compatible), required for I/O - thrust (2.1.0 or compatible), required for parallelization and utility - xsimd (11.1.0 or compatible), required for vectorization of the :code:`atan(..)` -- pybind11 (2.10.4 or compatible), required for the Python interface, but not the C++ standalone +- pybind11 (2.12.0 or compatible), required for the Python interface, but not the C++ standalone