Unverified Commit aac0c91d authored by Atream's avatar Atream Committed by GitHub
Browse files

Merge pull request #1060 from kvcache-ai/fix-compile

Fix compile
parents 6ca743ed fa87c1ae
cmake_minimum_required(VERSION 3.10)
find_package(PythonInterp REQUIRED)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "
import torch
print(torch.compiled_with_cxx11_abi())
"
OUTPUT_VARIABLE TORCH_CXX11_ABI
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(TORCH_CXX11_ABI MATCHES "True|False")
if(TORCH_CXX11_ABI)
message(STATUS "PyTorch was compiled with CXX11 ABI: ON")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=1")
else()
message(STATUS "PyTorch was compiled with CXX11 ABI: OFF")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
else()
message(WARNING "Could not determine if PyTorch was compiled with CXX11 ABI. Defaulting to OFF.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
......@@ -26,9 +26,6 @@ add_custom_target(
COMMENT "Running clang-format on all source files"
)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
set(BUILD_SHARED_LIBS ON)
set(ENABLE_PUSH OFF)
set(ENABLE_COMPRESSION OFF)
......
......@@ -17,8 +17,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(BUILD_TEST OFF)
set(BUILD_PYTHON_EXT OFF)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
# set(USE_IO_URING ON)
if(USE_IO_URING)
message(STATUS "Using io_uring")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment