Skip to content

Commit 289e84e

Browse files
huydhnmalfet
andauthored
Correctly set _GLIBCXX_USE_CXX11_ABI pybind compile options (#6744)
* Update torchao pinned commit to latest * Correctly set _GLIBCXX_USE_CXX11_ABI pybind compile options * Remove unwanted change * Update CMakeLists.txt Co-authored-by: Nikita Shulga <[email protected]> * Update CMakeLists.txt to remove the empty else branch --------- Co-authored-by: Nikita Shulga <[email protected]>
1 parent b1e6617 commit 289e84e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,10 +721,15 @@ if(EXECUTORCH_BUILD_PYBIND)
721721
-fPIC
722722
-frtti
723723
-fexceptions
724-
# libtorch is built with the old ABI, so we need to do the same for any
725-
# .cpp files that include torch, c10, or ATen targets.
726-
-D_GLIBCXX_USE_CXX11_ABI=0
727724
)
725+
if(EXECUTORCH_DO_NOT_USE_CXX11_ABI)
726+
# libtorch is built with the old ABI, so we need to do the same for any
727+
# .cpp files that include torch, c10, or ATen targets. Note that PyTorch
728+
# nightly binary is built with _GLIBCXX_USE_CXX11_ABI set to 0 while its
729+
# CI build sets this to 1 (default)
730+
list(APPEND _pybind_compile_options -D_GLIBCXX_USE_CXX11_ABI=0)
731+
endif()
732+
728733
# util lib
729734
add_library(
730735
util ${CMAKE_CURRENT_SOURCE_DIR}/extension/evalue_util/print_evalue.cpp

0 commit comments

Comments
 (0)