Skip to content

Commit 516ba48

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 638433f commit 516ba48

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,11 @@ if(EXECUTORCH_BUILD_PYBIND)
526526
# compile options for pybind
527527

528528
set(_pybind_compile_options -Wno-deprecated-declarations -fPIC -frtti
529-
-fexceptions)
529+
-fexceptions
530+
# libtorch is built with the old ABI, so we need
531+
# to do the same for any .cpp files that include
532+
# torch, c10, or ATen targets.
533+
-D_GLIBCXX_USE_CXX11_ABI=0)
530534
# util lib
531535
add_library(
532536
util

0 commit comments

Comments
 (0)