Skip to content

Commit

Permalink
Build pybindings with -D_GLIBCXX_USE_CXX11_ABI=0 to match libtorch.so
Browse files Browse the repository at this point in the history
libtorch.so builds with the old glibc ABI, so we need to as well,
for any source files that include torch headers.
  • Loading branch information
dbort committed Apr 16, 2024
1 parent 60bf405 commit ae1a658
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,11 @@ if(EXECUTORCH_BUILD_PYBIND)
# compile options for pybind

set(_pybind_compile_options -Wno-deprecated-declarations -fPIC -frtti
-fexceptions)
-fexceptions
# libtorch is built with the old ABI, so we need
# to do the same for any .cpp files that include
# torch, c10, or ATen targets.
-D_GLIBCXX_USE_CXX11_ABI=0)
# util lib
add_library(
util
Expand Down

0 comments on commit ae1a658

Please sign in to comment.