diff --git a/CMakeLists.txt b/CMakeLists.txt index 09b2be67f4967a72b811b12b7d9a1031801fc67c..3f7590adfc1119ebf4e07541c0183814eab599ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,16 +26,14 @@ function(check_debug_log_out) endif() endfunction() -if(ENABLE_KERNEL_ATEN) - execute_process(COMMAND python -c "import torch; print(torch.compiled_with_cxx11_abi())" OUTPUT_VARIABLE PYTORCH_CXX11_ABI_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - - if("${PYTORCH_CXX11_ABI_VERSION}" STREQUAL "True") - message("-- Enable _GLIBCXX_USE_CXX11_ABI") - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) - else() - message("-- Disable _GLIBCXX_USE_CXX11_ABI") - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) - endif() +# Fix undefined symbol error caused by PyTorch abi flag +execute_process(COMMAND python -c "import torch; print(torch.compiled_with_cxx11_abi())" OUTPUT_VARIABLE PYTORCH_CXX11_ABI_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) +if("${PYTORCH_CXX11_ABI_VERSION}" STREQUAL "True") + message("-- Enable _GLIBCXX_USE_CXX11_ABI") + add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) +else() + message("-- Disable _GLIBCXX_USE_CXX11_ABI") + add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) endif() add_subdirectory(${PROJECT_SOURCE_DIR}/inferrt/src) \ No newline at end of file