Uh oh!
There was an error while loading. Please reload this page.
fix: PYBIND11_PLATFORM_ABI_ID Modernization Continued (platforms other than MSVC) - #5439
Conversation
rwgk
commented
Nov 11, 2024
With this PR at commit 14f8425 and logs_30720380481.zip downloaded from here: This doesn't look right, @robertmaynard I was trying to follow your #4953 (comment) but maybe I'm misunderstanding? (I want to leave NVHPC for later.) |
robertmaynard
commented
Nov 12, 2024
This presumes that GCC will rev the major value of |
isuruf
commented
Nov 12, 2024
One more thing to fix would be to remove the compiler id |
wjakob
commented
Nov 15, 2024
I am surprised by |
rwgk
commented
Nov 15, 2024
It's generated in this line: |
wjakob
commented
Nov 17, 2024
Ah, interesting. So for |
isuruf
commented
Nov 18, 2024
Yes. |
Further constrain to GXX_ABI 1002 or greater and less than 2000, hopefully future proof by summarizing that as `1` along with CXX11 on or off.
cryos
commented
Nov 20, 2024
I just pushed a new commit that produces something like It also ensures |
Here are the results extracted from the latest CI logs: (Click on any job, then the gear that appears in the top-right corner of the window with the log for that job, then "Download log archive".) On chat @cryos and I decided to go with Looking at these: I think we want to omit But what about Does anyone know if And what should we do about this one? Could/should we just omit these lines and rely on the new |
After discussions with Ralf Grosse-Kunstleve we think these would make good identifiers that are concise and clear.
Within the `__GXX_ABI_VERSION` block this should always be defined, guard against unexpected defines and make the error obvious.
rwgk
commented
Nov 21, 2024
Here are the results extracted from the latest CI logs:
|
rwgk
commented
Nov 24, 2024
The current changes affect "C language object files created with the compiler are binary compatible with the GCC and C/C++ language library." AFAICT, the compiler also links against the system Upshot: I think we should also omit |
…X_USE_CXX11_ABI` (similarly to `gxx_abi` for `__GXX_ABI_VERSION`).
…`_gcc` with `_system`
rwgk
commented
Nov 24, 2024
I just pushed up the experimental commit fe2dbcb which changes Rationale:
I'll post a new |
rwgk
commented
Nov 25, 2024
Latest logs_31272968106.zip — https://github.com/pybind/pybind11/actions/runs/11999580827/job/33447666543?pr=5439 |
rwgk
commented
Nov 25, 2024
@robertmaynard do you have a moment to look at this PR? (The changes are small and all in just one file.)
|
robertmaynard
commented
Nov 25, 2024
Looks good to me
NVHPC should be ABI compatible with gcc. I am fine either way in how you want to manage that integration from a PR perspective. |
rwgk
commented
Nov 25, 2024
Thanks a lot @robertmaynard for the review!
Based on your comment, I added commit 9fc9515: Add NVHPC (__PGI) to the list of compilers (assumed to be) compatible with system compiler. |
| # define PYBIND11_COMPILER_TYPE "gcc_cygwin" | ||
| # elif defined(_MSC_VER) | ||
| # define PYBIND11_COMPILER_TYPE "msvc" | ||
| # elif defined(__INTEL_COMPILER) || defined(__clang__) || defined(__GNUC__) |
There was a problem hiding this comment.
In the interest of simplification, consider removing defined(__INTEL_COMPILER)
The Intel classic compilers, icc for C and icpc for C++, define __GNUC__ as well as __INTEL_COMPILER.
The last version was 2021.10 and it stopped shipping in 2023.
The "Intel(R) oneAPI DPC++/C++ Compilers", icx for C and icpx for C++, do not define __INTEL_COMPILER.
They do define all of these: __GNUC__, __clang__, __INTEL_CLANG_COMPILER, and __INTEL_LLVM_COMPILER.
wjakob
commented
Dec 20, 2024
This PR looks great to me now, are there any other planned changes? |
rwgk
commented
Dec 20, 2024
Only some work on the PR description. Sadly Flu + RSV have wiped out a lot of my time. I'll try to do it tonight. |
PYBIND11_PLATFORM_ABI_ID Modernization Continued (WIP)PYBIND11_PLATFORM_ABI_ID Modernization Continued (platforms other than MSVC)rwgk
commented
Dec 20, 2024
I updated the PR description. Thanks so much Everybody for all the input and feedback! |
PYBIND11_PLATFORM_ABI_ID Modernization Continued (platforms other than MSVC)PYBIND11_PLATFORM_ABI_ID Modernization Continued (platforms other than MSVC)* Squashed prepv300/manuscript — 30b9c26 — 2025-03-30 14:56:03 -0700 [skip ci] [Browse prepv300/manuscript tree](https://github.com/rwgk/pybind11/tree/30b9c268aeb98308ea42aaccfd5fe454e173c6fc) [Browse prepv300/manuscript commits](https://github.com/rwgk/pybind11/commits/30b9c268aeb98308ea42aaccfd5fe454e173c6fc/) * docs: update changelog Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: upgrade guide CMake suggestions Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Explain type_caster_enum_type_enabled, copyable_holder_caster_shared_ptr_with_smart_holder_support_enabled, move_only_holder_caster_unique_ptr_with_smart_holder_support_enabled in Upgrade guide. * Add a small section for py::bind_vector, py::bind_map & py::smart_holder * Fix tiny oversight: Reference back to the current release v2.13 (not v2.12) * Remove sentence: Using self._pybind11_conduit_v1_() ... should keep extension compatibility. This isn't true, because we also modernized `PYBIND11_PLATFORM_ABI_ID` (which I believe was absolutely necessary). I think it'll be too complicated to explain that here, and there is a mention in the Upgrade guide. * Changelog: combine #4953 and #5439 * Trivial whitespace/formatting fixes/enhancements. * chore: add more to deprecation page Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: update for recent additions Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: fixes and set rc1 version Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: support rc versions Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Undo erroneous copilot change: We need to use `detail::enable_if_t`, for compatibility with C++11 and C++14. * Empty lines cleanup. * Rewording of "CMake support now defaults to ..." paragraph. * Add missing backticks in upgrade guide. * Try :ref:deprecated instead of :doc:deprecated * docs: last bit of polish Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Piggy-back trivial whitespace cleanup that was missed in PR #5669 --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Description
This PR updates
PYBIND11_PLATFORM_ABI_ID, which determines cross-extension ABI compatibility, to improve accuracy across all platforms other than MSVC (which was modernized previously in #4953). For context on the importance ofPYBIND11_PLATFORM_ABI_ID, please refer to PRs #5296 and #5375.The accuracy improvements can be seen by comparing the
PYBIND11_INTERNALS_IDsummaries before and after:master @ 741d86f (logs_32284154734.zip, logs_32284154873.zip):
This PR (pr5439_logs_32281771697.zip, pr5439_logs_32281771739.zip):
Note that the compiler-specific identifiers
clang,gcc,icc,pgino longer appear. ABI compatibility is now determined primarily bylibstdcpp(gcc) orlibcpp(clang) ABI preprocessor macros.It is expected that overrides like those in pytorch will not be needed anymore. However, this PR ensures that existing overrides will still function, allowing for gradual community adoption.
Similar to #4953, silent fallbacks for unexpected situations have been replaced with
#error ... PLEASE REVISE THIS CODE.directives. For such cases, command-line overrides for the affected macros can serve as temporary workarounds. To eliminate the need for such workarounds, users are encouraged to contribute updates topybind11/conduit/pybind11_platform_abi_id.has needed.For completeness, the counts for MSVC (unchanged):
The work on this PR was informed by:
Suggested changelog entry: