Skip to content

Commit f99f0cf

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 e078e93 commit f99f0cf

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
@@ -530,7 +530,11 @@ if(EXECUTORCH_BUILD_PYBIND)
530530
# compile options for pybind
531531

532532
set(_pybind_compile_options -Wno-deprecated-declarations -fPIC -frtti
533-
-fexceptions)
533+
-fexceptions
534+
# libtorch is built with the old ABI, so we need
535+
# to do the same for any .cpp files that include
536+
# torch, c10, or ATen targets.
537+
-D_GLIBCXX_USE_CXX11_ABI=0)
534538
# util lib
535539
add_library(
536540
util

0 commit comments

Comments
 (0)