Support newer toolchains: C++17, CMake 4, Boost 1.92, GDAL 3.13, SWIG 4.5, Python 3.14 - #286
Open
zihaooo wants to merge 1 commit into
Open
Support newer toolchains: C++17, CMake 4, Boost 1.92, GDAL 3.13, SWIG 4.5, Python 3.14#286zihaooo wants to merge 1 commit into
zihaooo wants to merge 1 commit into
Conversation
…4 and boost 1.92, GDAL 3.13 and SWIG 4.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes fmm build with current toolchains, tested with GCC 15.3, CMake 4.4, Boost 1.92, GDAL 3.13, SWIG 4.5 and Python 3.14, while still building with the versions that work today (tested with GCC 13.3, CMake 3.28, Boost 1.74, GDAL 3.4.3, SWIG 4.0/4.2, Python 3.10). No functional change: the map matching output is identical before and after.
Today the newest usable combination is roughly Boost 1.74 / Python 3.10, because Boost.Geometry >= 1.75 requires C++14 and the Python detection relies on
distutils, which was removed in Python 3.12.Changes
CMake
CMAKE_CXX_STANDARD 17(Boost.Geometry >= 1.75 needs C++14, GDAL >= 3.9 headers need C++17);cmake_minimum_required(VERSION 3.16...4.4).find_package(Python3 COMPONENTS Interpreter Development.Module); the module is installed intoPython3_SITEARCH(override with-DFMM_PYTHON_INSTALL_DIR=...). This replacesFindPythonInterp/FindPythonLibsand thedistutils.sysconfigcall. The extension is no longer linked againstlibpython, as recommended for CPython extension modules.GDAL::GDAL,Boost::serialization,Boost::headers,OpenMP::OpenMP_CXX), so the build also works with CMake >= 3.30 where theFindBoostmodule was removed in favour ofBoostConfig.cmake.swig_add_library+target_link_librariesand installs$<TARGET_PROPERTY:pyfmm,SWIG_SUPPORT_FILES>instead of a hard-coded path tofmm.py.-O3 -DNDEBUGnow come from theReleasebuild type (the default) instead of overridingCMAKE_CXX_FLAGS, so user flags are respected. An unknownCMAKE_BUILD_TYPEfalls back toReleaseinstead of silently building without optimisation.FMM_NATIVE_ARCH(default OFF, adds-march=native) andFMM_SPDLOG_ACTIVE_LEVEL(defaultSPDLOG_LEVEL_TRACE, unchanged behaviour).Sources
third_party/cxxopts/cxxopts.hpp: add#include <cstdint>(newer libstdc++ no longer includes it transitively).src/network/network.cpp:OGRGeomFieldDefn::GetSpatialRef()returnsconst OGRSpatialReference *in GDAL 3.boost/function_output_iterator.hppinclude (unused).Verification
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com