From 1edd35502a0891abba166e4c80b8660d69ae2c3f Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 21 Jun 2024 17:50:31 -0400 Subject: [PATCH 1/2] fix build on macos/windows Signed-off-by: Jinzhe Zeng (cherry picked from commit 4c28b7570b606d6b532e9cc3d99d9b59044fdfde) --- source/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 3a357e1321..6a3103616e 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -219,6 +219,9 @@ if(ENABLE_PYTORCH AND NOT DEEPMD_C_ROOT) set(OP_CXX_ABI ${CMAKE_MATCH_1}) add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${OP_CXX_ABI}) endif() + else() + # Maybe in macos/windows + set(OP_CXX_ABI_PT ${OP_CXX_ABI}) endif() # get torch directory get the directory of the target "torch" get_target_property(_TORCH_LOCATION torch LOCATION) From bd7da0bf5ff48507ede5548ecb75a5c9a8631ba4 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 21 Jun 2024 21:44:36 -0400 Subject: [PATCH 2/2] prevent OP_CXX_ABI not defined Signed-off-by: Jinzhe Zeng --- source/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 6a3103616e..cf516b9755 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -221,7 +221,10 @@ if(ENABLE_PYTORCH AND NOT DEEPMD_C_ROOT) endif() else() # Maybe in macos/windows - set(OP_CXX_ABI_PT ${OP_CXX_ABI}) + if(NOT DEFINED OP_CXX_ABI) + set(OP_CXX_ABI 0) + endif() + set(OP_CXX_ABI_PT "${OP_CXX_ABI}") endif() # get torch directory get the directory of the target "torch" get_target_property(_TORCH_LOCATION torch LOCATION)