Skip to content

Commit 0fe0f62

Browse files
miaobytepeng li
andauthored
omp:omp macos build (#105)
* omp:omp macos build --------- Co-authored-by: peng li <lipeng@mirrorsoft.cn>
1 parent 08068fd commit 0fe0f62

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

executor/cpp-common/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ add_library(deepx_common SHARED
2323

2424
find_package(yaml-cpp REQUIRED)
2525

26-
target_link_libraries(deepx_common
27-
PUBLIC
28-
yaml-cpp
29-
)
26+
if (TARGET yaml-cpp::yaml-cpp)
27+
target_link_libraries(deepx_common PUBLIC yaml-cpp::yaml-cpp)
28+
else()
29+
target_link_libraries(deepx_common PUBLIC yaml-cpp)
30+
endif()
3031

3132
target_include_directories(deepx_common PUBLIC
3233
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>

executor/cpp-common/src/client/udpserver.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace client
1414
{
1515
if (sockfd > 0)
1616
{
17-
close(sockfd);
17+
::close(sockfd);
1818
}
1919
}
2020
void udpserver::start(queue<deepx::tf::TF> &queue)
@@ -33,16 +33,16 @@ namespace client
3333
servaddr.sin_addr.s_addr = INADDR_ANY;
3434
servaddr.sin_port = htons(port);
3535

36-
if (bind(sockfd, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
36+
if (::bind(sockfd, (const struct sockaddr *)&servaddr, (socklen_t)sizeof(servaddr)) < 0)
3737
{
3838
perror("bind failed");
39-
close(sockfd);
39+
::close(sockfd);
4040
exit(EXIT_FAILURE);
4141
}
4242
while (true)
4343
{
4444
len = sizeof(cliaddr);
45-
n = recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr *)&cliaddr, &len);
45+
n = ::recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr *)&cliaddr, &len);
4646
buffer[n] = '\0';
4747

4848
// 新增换行拆分逻辑
@@ -57,10 +57,10 @@ namespace client
5757
}
5858
}
5959
}
60-
close(sockfd);
60+
::close(sockfd);
6161
}
6262
void udpserver::resp(string str){
63-
sendto(sockfd, str.c_str(), str.size(), 0, // 改为sendto
63+
::sendto(sockfd, str.c_str(), str.size(), 0, // 改为sendto
6464
(const struct sockaddr *)&cliaddr, sizeof(cliaddr));
6565
}
6666
}

executor/cpp-common/src/deepx/shape_range.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <any>
55
#include <thread>
66

7-
#include <omp.h>
87
#include "deepx/shape.hpp"
98
namespace deepx
109
{

0 commit comments

Comments
 (0)