From 3971b831faf3de0334586923c58e7566b967a4d1 Mon Sep 17 00:00:00 2001 From: dovahkiiin Date: Thu, 11 Sep 2025 10:15:13 +0800 Subject: [PATCH 1/2] init --- src/torch_atb/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/torch_atb/CMakeLists.txt b/src/torch_atb/CMakeLists.txt index 50111f2e..19fcdba1 100644 --- a/src/torch_atb/CMakeLists.txt +++ b/src/torch_atb/CMakeLists.txt @@ -11,6 +11,10 @@ file(GLOB_RECURSE pybind11_source_files "*.cpp") pybind11_add_module(_C ${pybind11_source_files}) set_target_properties(_C PROPERTIES OUTPUT_NAME "_C" SUFFIX ".so") +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + target_compile_options(_C PRIVATE -Wno-error=odr) + target_link_options(_C PRIVATE -Wno-error=odr) +endif() target_link_options(_C PRIVATE -rdynamic -ldl -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,--build-id=none -fexceptions) target_link_libraries(_C PRIVATE torch_npu) target_include_directories(_C PRIVATE ${ATB_INCLUDE_DIR}) -- Gitee From e2ec48d60e83f91d5e5d75b88aee145ea6cff716 Mon Sep 17 00:00:00 2001 From: dovahkiiin Date: Fri, 12 Sep 2025 14:50:01 +0800 Subject: [PATCH 2/2] modify according to security copmile options --- src/torch_atb/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/torch_atb/CMakeLists.txt b/src/torch_atb/CMakeLists.txt index 19fcdba1..85ac8d15 100644 --- a/src/torch_atb/CMakeLists.txt +++ b/src/torch_atb/CMakeLists.txt @@ -12,8 +12,8 @@ file(GLOB_RECURSE pybind11_source_files "*.cpp") pybind11_add_module(_C ${pybind11_source_files}) set_target_properties(_C PROPERTIES OUTPUT_NAME "_C" SUFFIX ".so") if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") - target_compile_options(_C PRIVATE -Wno-error=odr) - target_link_options(_C PRIVATE -Wno-error=odr) + target_compile_options(_C PRIVATE -Wno-odr) + target_link_options(_C PRIVATE -Wno-odr) endif() target_link_options(_C PRIVATE -rdynamic -ldl -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,--build-id=none -fexceptions) target_link_libraries(_C PRIVATE torch_npu) -- Gitee