Skip to content

Commit 8f0f43a

Browse files
committed
Build pybindings with -D_GLIBCXX_USE_CXX11_ABI=0 to match libtorch.so
libtorch.so builds with the old glibc ABI, so we need to as well, for any source files that include torch headers.
1 parent fae6dcb commit 8f0f43a

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
@@ -528,9 +528,14 @@ if(EXECUTORCH_BUILD_PYBIND)
528528
PATHS "${TORCH_INSTALL_PREFIX}/lib")
529529

530530
# compile options for pybind
531-
532-
set(_pybind_compile_options -Wno-deprecated-declarations -fPIC -frtti
533-
-fexceptions)
531+
set(_pybind_compile_options
532+
-Wno-deprecated-declarations
533+
-fPIC
534+
-frtti
535+
-fexceptions
536+
# libtorch is built with the old ABI, so we need to do the same for any
537+
# .cpp files that include torch, c10, or ATen targets.
538+
-D_GLIBCXX_USE_CXX11_ABI=0)
534539
# util lib
535540
add_library(
536541
util

0 commit comments

Comments
 (0)