From 1cdec869a23c1339fe4d7f38e6e68484fa89352e Mon Sep 17 00:00:00 2001 From: peng li Date: Fri, 16 Jan 2026 12:14:04 +0800 Subject: [PATCH 1/2] omp:omp macbuild --- executor/cpp-common/CMakeLists.txt | 2 +- executor/cpp-common/src/client/udpserver.cpp | 12 ++++++------ executor/cpp-common/src/deepx/shape_range.cpp | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/executor/cpp-common/CMakeLists.txt b/executor/cpp-common/CMakeLists.txt index bfe08062..cfa10084 100644 --- a/executor/cpp-common/CMakeLists.txt +++ b/executor/cpp-common/CMakeLists.txt @@ -25,7 +25,7 @@ find_package(yaml-cpp REQUIRED) target_link_libraries(deepx_common PUBLIC - yaml-cpp + yaml-cpp::yaml-cpp ) target_include_directories(deepx_common PUBLIC diff --git a/executor/cpp-common/src/client/udpserver.cpp b/executor/cpp-common/src/client/udpserver.cpp index 44759d42..7c5d4e46 100644 --- a/executor/cpp-common/src/client/udpserver.cpp +++ b/executor/cpp-common/src/client/udpserver.cpp @@ -14,7 +14,7 @@ namespace client { if (sockfd > 0) { - close(sockfd); + ::close(sockfd); } } void udpserver::start(queue &queue) @@ -33,16 +33,16 @@ namespace client servaddr.sin_addr.s_addr = INADDR_ANY; servaddr.sin_port = htons(port); - if (bind(sockfd, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) + if (::bind(sockfd, (const struct sockaddr *)&servaddr, (socklen_t)sizeof(servaddr)) < 0) { perror("bind failed"); - close(sockfd); + ::close(sockfd); exit(EXIT_FAILURE); } while (true) { len = sizeof(cliaddr); - n = recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr *)&cliaddr, &len); + n = ::recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr *)&cliaddr, &len); buffer[n] = '\0'; // 新增换行拆分逻辑 @@ -57,10 +57,10 @@ namespace client } } } - close(sockfd); + ::close(sockfd); } void udpserver::resp(string str){ - sendto(sockfd, str.c_str(), str.size(), 0, // 改为sendto + ::sendto(sockfd, str.c_str(), str.size(), 0, // 改为sendto (const struct sockaddr *)&cliaddr, sizeof(cliaddr)); } } \ No newline at end of file diff --git a/executor/cpp-common/src/deepx/shape_range.cpp b/executor/cpp-common/src/deepx/shape_range.cpp index 45d12320..bd5e2885 100644 --- a/executor/cpp-common/src/deepx/shape_range.cpp +++ b/executor/cpp-common/src/deepx/shape_range.cpp @@ -4,7 +4,6 @@ #include #include -#include #include "deepx/shape.hpp" namespace deepx { From 319458f1f0c951e5db5caa0fb573b3fe59c8c313 Mon Sep 17 00:00:00 2001 From: peng li Date: Fri, 16 Jan 2026 14:22:01 +0800 Subject: [PATCH 2/2] test --- executor/cpp-common/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/executor/cpp-common/CMakeLists.txt b/executor/cpp-common/CMakeLists.txt index cfa10084..0d48cb85 100644 --- a/executor/cpp-common/CMakeLists.txt +++ b/executor/cpp-common/CMakeLists.txt @@ -23,10 +23,11 @@ add_library(deepx_common SHARED find_package(yaml-cpp REQUIRED) -target_link_libraries(deepx_common - PUBLIC - yaml-cpp::yaml-cpp -) +if (TARGET yaml-cpp::yaml-cpp) + target_link_libraries(deepx_common PUBLIC yaml-cpp::yaml-cpp) +else() + target_link_libraries(deepx_common PUBLIC yaml-cpp) +endif() target_include_directories(deepx_common PUBLIC $