Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

CMakeLists.txt 1.5 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  1. cmake_minimum_required(VERSION 3.5)
  2. project(YOLO11TritonCPP VERSION 0.1)
  3. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  4. set(CMAKE_CXX_STANDARD 17)
  5. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  6. # Require external Triton client directory as a parameter
  7. if(NOT DEFINED TRITON_CLIENT_DIR)
  8. message(FATAL_ERROR "Please specify -DTRITON_CLIENT_DIR=/path/to/tritonclient")
  9. endif()
  10. # Triton-related paths
  11. set(Protobuf_DIR "${TRITON_CLIENT_DIR}/protobuf/lib/cmake/protobuf")
  12. set(gRPC_DIR "${TRITON_CLIENT_DIR}/grpc")
  13. set(c-ares_DIR "${TRITON_CLIENT_DIR}/c-ares/lib/cmake/c-ares")
  14. set(TritonClient_DIR "${TRITON_CLIENT_DIR}/lib/cmake/TritonClient")
  15. set(TritonCommon_DIR "${TRITON_CLIENT_DIR}/lib/cmake/TritonCommon")
  16. # Compiler optimizations
  17. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mf16c -mavx2 -O3 -ffast-math -march=native")
  18. # OpenCV setup
  19. find_package(OpenCV REQUIRED)
  20. include_directories(${OpenCV_INCLUDE_DIRS})
  21. # Find Triton packages
  22. find_package(TritonCommon REQUIRED)
  23. find_package(TritonClient REQUIRED)
  24. # Project source files
  25. set(PROJECT_SOURCES
  26. main.cpp
  27. inference.cpp
  28. inference.hpp
  29. )
  30. # Define executable target
  31. add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})
  32. # Include directories
  33. target_include_directories(${PROJECT_NAME}
  34. PRIVATE
  35. ${TRITON_CLIENT_DIR}/include
  36. ${OpenCV_INCLUDE_DIRS}
  37. )
  38. # Link directories
  39. target_link_directories(${PROJECT_NAME}
  40. PRIVATE
  41. ${TRITON_CLIENT_DIR}/lib
  42. )
  43. # Link libraries
  44. target_link_libraries(${PROJECT_NAME}
  45. PRIVATE
  46. ${OpenCV_LIBS}
  47. grpcclient
  48. )
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...