Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYBIND11_PLATFORM_ABI_ID Modernization Continued (WIP) #5439

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
14f8425
THIS IS JUST A START: First attempt to combine information from PR #4…
rwgk Nov 10, 2024
e46982c
Merge branch 'master' into pybind11_platform_abi_id_cont
rwgk Nov 18, 2024
b72c42d
Include GXX_ABI and USE_CXX in the identifier
cryos Nov 20, 2024
8369fdc
style: pre-commit fixes
pre-commit-ci[bot] Nov 20, 2024
476c322
Use `gxx_abi_1xxx` and simplify the Clang string
cryos Nov 21, 2024
271720f
Error if `_GLIBCXX_USE_CXX11_ABI` is not defined
cryos Nov 21, 2024
970a7eb
Merge branch 'master' into pybind11_platform_abi_id_cont
rwgk Nov 24, 2024
28081fc
Change `usecxx11` to `use_cxx11_abi` for correspondence with `_GLIBCX…
rwgk Nov 24, 2024
fe2dbcb
`PYBIND11_COMPILER_TYPE` overhaul, mainly: replace `_icc`, `_clang`, …
rwgk Nov 24, 2024
9acf764
Merge branch 'master' into pybind11_platform_abi_id_cont
rwgk Nov 25, 2024
9fc9515
Add NVHPC (__PGI) to the list of compilers compatible with system com…
rwgk Nov 25, 2024
d412303
Fix oversight: remove __NVCOMPILER elif branch in PYBIND11_BUILD_ABI …
rwgk Nov 25, 2024
b6ccce3
Revert "Fix oversight: remove __NVCOMPILER elif branch in PYBIND11_BU…
rwgk Nov 26, 2024
a584398
Revert "Add NVHPC (__PGI) to the list of compilers compatible with sy…
rwgk Nov 26, 2024
23a5f2b
Define NVHPC PYBIND11_BUILD_ABI using __GNUC__, __GNUC_MINOR__, _GLIB…
rwgk Nov 26, 2024
8fa10bf
Use _GLIBCXX_USE_CXX11_ABI to detect libstdc++, then assume that NVHP…
rwgk Nov 26, 2024
02daf15
Enhance NVHPC comment and limited future proofing.
rwgk Nov 26, 2024
3f90808
The `PYBIND11_STDLIB` is obsolete but kept around to maintain backwar…
rwgk Dec 1, 2024
b47be2d
Move `PYBIND11_BUILD_TYPE` down in the file, so that the order of mac…
rwgk Dec 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions include/pybind11/conduit/pybind11_platform_abi_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,18 @@
// A user can manually set this string if they know their
// compiler is compatible.
#ifndef PYBIND11_COMPILER_TYPE
# if defined(_MSC_VER)
# define PYBIND11_COMPILER_TYPE "_msvc"
# elif defined(__INTEL_COMPILER)
# define PYBIND11_COMPILER_TYPE "_icc"
# elif defined(__clang__)
# define PYBIND11_COMPILER_TYPE "_clang"
# elif defined(__PGI)
# define PYBIND11_COMPILER_TYPE "_pgi"
# elif defined(__MINGW32__)
# if defined(__MINGW32__)
# define PYBIND11_COMPILER_TYPE "_mingw"
# elif defined(__CYGWIN__)
# define PYBIND11_COMPILER_TYPE "_gcc_cygwin"
# elif defined(__GNUC__)
# define PYBIND11_COMPILER_TYPE "_gcc"
# elif defined(_MSC_VER)
# define PYBIND11_COMPILER_TYPE "_msvc"
# elif defined(__PGI)
# define PYBIND11_COMPILER_TYPE "_pgi"
# elif defined(__INTEL_COMPILER) || defined(__clang__) || defined(__GNUC__)
# define PYBIND11_COMPILER_TYPE "_system" // Assumed compatible with system compiler.
# else
# define PYBIND11_COMPILER_TYPE "_unknown"
# error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE."
# endif
#endif

Expand All @@ -54,9 +50,7 @@
#endif

#ifndef PYBIND11_BUILD_ABI
# if defined(__GXX_ABI_VERSION) // Linux/OSX.
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_PLATFORM_ABI_ID_TOSTRING(__GXX_ABI_VERSION)
# elif defined(_MSC_VER) // See PR #4953.
# if defined(_MSC_VER) // See PR #4953.
# if defined(_MT) && defined(_DLL) // Corresponding to CL command line options /MD or /MDd.
# if (_MSC_VER) / 100 == 19
# define PYBIND11_BUILD_ABI "_md_mscver19"
Expand All @@ -72,8 +66,21 @@
# error "Unknown major version for MSC_VER: PLEASE REVISE THIS CODE."
# endif
# endif
# elif defined(__NVCOMPILER) // NVHPC (PGI-based).
# define PYBIND11_BUILD_ABI "" // TODO: What should be here, to prevent UB?
# elif defined(__NVCOMPILER) // NVHPC (PGI-based).
# define PYBIND11_BUILD_ABI "" // TODO: What should be here, to prevent UB?
# elif defined(_LIBCPP_ABI_VERSION) // https://libcxx.llvm.org/DesignDocs/ABIVersioning.html
# define PYBIND11_BUILD_ABI "_abi" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_LIBCPP_ABI_VERSION)
# elif defined(__GXX_ABI_VERSION)
# if __GXX_ABI_VERSION >= 1002 && __GXX_ABI_VERSION < 2000
# if !defined(_GLIBCXX_USE_CXX11_ABI)
# error "UNEXPECTED: _GLIBCXX_USE_CXX11_ABI not defined: PLEASE REVISE THIS CODE."
# endif
# define PYBIND11_BUILD_ABI \
"_gxx_abi_1xxx_use_cxx11_abi_" PYBIND11_PLATFORM_ABI_ID_TOSTRING( \
_GLIBCXX_USE_CXX11_ABI)
# else
# error "Unknown platform or compiler (__GXX_ABI_VERSION): PLEASE REVISE THIS CODE."
# endif
# else
# error "Unknown platform or compiler: PLEASE REVISE THIS CODE."
# endif
Expand Down