Skip to content

Commit

Permalink
Make determination of PYBIND11_COMPILER_TYPE "macos" or "glibc"
Browse files Browse the repository at this point in the history
… more general.

The main motivation is to resolve these "Manylinux on 🐍 3.13t • GIL" and "Pyodide wheel" failures:

```
/__w/pybind11/pybind11/include/pybind11/conduit/pybind11_platform_abi_id.h:35:10: error: #error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE."
   35 | #        error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE."
      |          ^~~~~
```

(All other CI jobs succeeded.)

Further thought:

Essentially, under Linux and macOS the `PYBIND11_COMPILER_TYPE` is only for informational purposes.
ABI compatibility is determined by the libstdc++ or libc++ ABI version.
  • Loading branch information
rwgk committed Dec 3, 2024
1 parent ca9e699 commit 41daaa4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions include/pybind11/conduit/pybind11_platform_abi_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@
# define PYBIND11_COMPILER_TYPE "gcc_cygwin"
# elif defined(_MSC_VER)
# define PYBIND11_COMPILER_TYPE "msvc"
# elif defined(__GLIBC__) \
&& (defined(__INTEL_COMPILER) || defined(__clang__) || defined(__GNUC__))
// // Compatibility is determined based on libstdc++ or libc++ ABI version (below).
# define PYBIND11_COMPILER_TYPE "glibc"
# elif defined(__APPLE__) \
&& (defined(__INTEL_COMPILER) || defined(__clang__) || defined(__GNUC__))
// // Compatibility is (usually) determined based on libc++ ABI version (below).
# elif defined(__APPLE__)
# define PYBIND11_COMPILER_TYPE "macos"
# elif defined(__GLIBC__) || defined(_GLIBCXX_USE_CXX11_ABI)
# define PYBIND11_COMPILER_TYPE "glibc"
# else
# error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE."
# endif
Expand Down

0 comments on commit 41daaa4

Please sign in to comment.