Skip to content

Commit 6f84d26

Browse files
authored
ARROW-133 Only set the GLIBCXX_USE_CXX11_ABI when building wheels (#116)
1 parent aaffabf commit 6f84d26

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bindings/python/setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
# Whether to create libarrow symlinks on posix systems.
1919
CREATE_LIBARROW_SYMLINKS = os.environ.get("MONGO_CREATE_LIBARROW_SYMLINKS", "1")
2020

21+
# Whether to add the GLIBCXX override.
22+
# Arrow's manylinux{2010, 2014} binaries are built with gcc <= 4.8 which predates CXX11 ABI
23+
# - https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html
24+
ADD_GLIBCXX_OVERRIDE = os.environ.get("MONGO_ADD_GLIBCXX_OVERRIDE", "1")
25+
2126
# Set a default value for MACOSX_DEPLOYMENT_TARGET.
2227
os.environ.setdefault("MACOSX_DEPLOYMENT_TARGET", "10.15")
2328

@@ -152,10 +157,7 @@ def append_arrow_flags(ext):
152157
if os.name == "posix":
153158
ext.extra_compile_args.append("-std=c++17")
154159

155-
# Arrow's manylinux{2010, 2014} binaries are built with gcc < 4.8 which predates CXX11 ABI
156-
# - https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html
157-
# - https://arrow.apache.org/docs/python/extending.html#example
158-
if "std=" not in os.environ.get("CXXFLAGS", ""):
160+
if ADD_GLIBCXX_OVERRIDE:
159161
ext.extra_compile_args.append("-D_GLIBCXX_USE_CXX11_ABI=0")
160162

161163
elif os.name == "nt":

0 commit comments

Comments
 (0)