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

Summary.cmake 7.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
  1. ################################################################################################
  2. # Caffe status report function.
  3. # Automatically align right column and selects text based on condition.
  4. # Usage:
  5. # caffe_status(<text>)
  6. # caffe_status(<heading> <value1> [<value2> ...])
  7. # caffe_status(<heading> <condition> THEN <text for TRUE> ELSE <text for FALSE> )
  8. function(caffe_status text)
  9. set(status_cond)
  10. set(status_then)
  11. set(status_else)
  12. set(status_current_name "cond")
  13. foreach(arg ${ARGN})
  14. if(arg STREQUAL "THEN")
  15. set(status_current_name "then")
  16. elseif(arg STREQUAL "ELSE")
  17. set(status_current_name "else")
  18. else()
  19. list(APPEND status_${status_current_name} ${arg})
  20. endif()
  21. endforeach()
  22. if(DEFINED status_cond)
  23. set(status_placeholder_length 23)
  24. string(RANDOM LENGTH ${status_placeholder_length} ALPHABET " " status_placeholder)
  25. string(LENGTH "${text}" status_text_length)
  26. if(status_text_length LESS status_placeholder_length)
  27. string(SUBSTRING "${text}${status_placeholder}" 0 ${status_placeholder_length} status_text)
  28. elseif(DEFINED status_then OR DEFINED status_else)
  29. message(STATUS "${text}")
  30. set(status_text "${status_placeholder}")
  31. else()
  32. set(status_text "${text}")
  33. endif()
  34. if(DEFINED status_then OR DEFINED status_else)
  35. if(${status_cond})
  36. string(REPLACE ";" " " status_then "${status_then}")
  37. string(REGEX REPLACE "^[ \t]+" "" status_then "${status_then}")
  38. message(STATUS "${status_text} ${status_then}")
  39. else()
  40. string(REPLACE ";" " " status_else "${status_else}")
  41. string(REGEX REPLACE "^[ \t]+" "" status_else "${status_else}")
  42. message(STATUS "${status_text} ${status_else}")
  43. endif()
  44. else()
  45. string(REPLACE ";" " " status_cond "${status_cond}")
  46. string(REGEX REPLACE "^[ \t]+" "" status_cond "${status_cond}")
  47. message(STATUS "${status_text} ${status_cond}")
  48. endif()
  49. else()
  50. message(STATUS "${text}")
  51. endif()
  52. endfunction()
  53. ################################################################################################
  54. # Function for fetching Caffe version from git and headers
  55. # Usage:
  56. # caffe_extract_caffe_version()
  57. function(caffe_extract_caffe_version)
  58. set(Caffe_GIT_VERSION "unknown")
  59. find_package(Git)
  60. if(GIT_FOUND)
  61. execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty
  62. ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
  63. WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
  64. OUTPUT_VARIABLE Caffe_GIT_VERSION
  65. RESULT_VARIABLE __git_result)
  66. if(NOT ${__git_result} EQUAL 0)
  67. set(Caffe_GIT_VERSION "unknown")
  68. endif()
  69. endif()
  70. set(Caffe_GIT_VERSION ${Caffe_GIT_VERSION} PARENT_SCOPE)
  71. set(Caffe_VERSION "<TODO> (Caffe doesn't declare its version in headers)" PARENT_SCOPE)
  72. # caffe_parse_header(${Caffe_INCLUDE_DIR}/caffe/version.hpp Caffe_VERSION_LINES CAFFE_MAJOR CAFFE_MINOR CAFFE_PATCH)
  73. # set(Caffe_VERSION "${CAFFE_MAJOR}.${CAFFE_MINOR}.${CAFFE_PATCH}" PARENT_SCOPE)
  74. # or for #define Caffe_VERSION "x.x.x"
  75. # caffe_parse_header_single_define(Caffe ${Caffe_INCLUDE_DIR}/caffe/version.hpp Caffe_VERSION)
  76. # set(Caffe_VERSION ${Caffe_VERSION_STRING} PARENT_SCOPE)
  77. endfunction()
  78. ################################################################################################
  79. # Prints accumulated caffe configuration summary
  80. # Usage:
  81. # caffe_print_configuration_summary()
  82. function(caffe_print_configuration_summary)
  83. caffe_extract_caffe_version()
  84. set(Caffe_VERSION ${Caffe_VERSION} PARENT_SCOPE)
  85. caffe_merge_flag_lists(__flags_rel CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS)
  86. caffe_merge_flag_lists(__flags_deb CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS)
  87. caffe_status("")
  88. caffe_status("******************* Caffe Configuration Summary *******************")
  89. caffe_status("General:")
  90. caffe_status(" Version : ${CAFFE_TARGET_VERSION}")
  91. caffe_status(" Git : ${Caffe_GIT_VERSION}")
  92. caffe_status(" System : ${CMAKE_SYSTEM_NAME}")
  93. caffe_status(" C++ compiler : ${CMAKE_CXX_COMPILER}")
  94. caffe_status(" Release CXX flags : ${__flags_rel}")
  95. caffe_status(" Debug CXX flags : ${__flags_deb}")
  96. caffe_status(" Build type : ${CMAKE_BUILD_TYPE}")
  97. caffe_status("")
  98. caffe_status(" BUILD_SHARED_LIBS : ${BUILD_SHARED_LIBS}")
  99. caffe_status(" BUILD_python : ${BUILD_python}")
  100. caffe_status(" BUILD_matlab : ${BUILD_matlab}")
  101. caffe_status(" BUILD_docs : ${BUILD_docs}")
  102. caffe_status(" CPU_ONLY : ${CPU_ONLY}")
  103. caffe_status(" USE_OPENCV : ${USE_OPENCV}")
  104. caffe_status(" USE_LEVELDB : ${USE_LEVELDB}")
  105. caffe_status(" USE_LMDB : ${USE_LMDB}")
  106. caffe_status(" USE_NCCL : ${USE_NCCL}")
  107. caffe_status(" ALLOW_LMDB_NOLOCK : ${ALLOW_LMDB_NOLOCK}")
  108. caffe_status("")
  109. caffe_status("Dependencies:")
  110. caffe_status(" BLAS : " APPLE THEN "Yes (vecLib)" ELSE "Yes (${BLAS})")
  111. caffe_status(" Boost : Yes (ver. ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION})")
  112. caffe_status(" glog : Yes")
  113. caffe_status(" gflags : Yes")
  114. caffe_status(" protobuf : " PROTOBUF_FOUND THEN "Yes (ver. ${PROTOBUF_VERSION})" ELSE "No" )
  115. if(USE_LMDB)
  116. caffe_status(" lmdb : " LMDB_FOUND THEN "Yes (ver. ${LMDB_VERSION})" ELSE "No")
  117. endif()
  118. if(USE_LEVELDB)
  119. caffe_status(" LevelDB : " LEVELDB_FOUND THEN "Yes (ver. ${LEVELDB_VERSION})" ELSE "No")
  120. caffe_status(" Snappy : " SNAPPY_FOUND THEN "Yes (ver. ${Snappy_VERSION})" ELSE "No" )
  121. endif()
  122. if(USE_OPENCV)
  123. caffe_status(" OpenCV : Yes (ver. ${OpenCV_VERSION})")
  124. endif()
  125. caffe_status(" CUDA : " HAVE_CUDA THEN "Yes (ver. ${CUDA_VERSION})" ELSE "No" )
  126. caffe_status("")
  127. if(HAVE_CUDA)
  128. caffe_status("NVIDIA CUDA:")
  129. caffe_status(" Target GPU(s) : ${CUDA_ARCH_NAME}" )
  130. caffe_status(" GPU arch(s) : ${NVCC_FLAGS_EXTRA_readable}")
  131. if(USE_CUDNN)
  132. caffe_status(" cuDNN : " HAVE_CUDNN THEN "Yes (ver. ${CUDNN_VERSION})" ELSE "Not found")
  133. else()
  134. caffe_status(" cuDNN : Disabled")
  135. endif()
  136. caffe_status("")
  137. endif()
  138. if(HAVE_PYTHON)
  139. caffe_status("Python:")
  140. caffe_status(" Interpreter :" PYTHON_EXECUTABLE THEN "${PYTHON_EXECUTABLE} (ver. ${PYTHON_VERSION_STRING})" ELSE "No")
  141. caffe_status(" Libraries :" PYTHONLIBS_FOUND THEN "${PYTHON_LIBRARIES} (ver ${PYTHONLIBS_VERSION_STRING})" ELSE "No")
  142. caffe_status(" NumPy :" NUMPY_FOUND THEN "${NUMPY_INCLUDE_DIR} (ver ${NUMPY_VERSION})" ELSE "No")
  143. caffe_status("")
  144. endif()
  145. if(BUILD_matlab)
  146. caffe_status("Matlab:")
  147. caffe_status(" Matlab :" HAVE_MATLAB THEN "Yes (${Matlab_mex}, ${Matlab_mexext}" ELSE "No")
  148. caffe_status(" Octave :" Octave_compiler THEN "Yes (${Octave_compiler})" ELSE "No")
  149. if(HAVE_MATLAB AND Octave_compiler)
  150. caffe_status(" Build mex using : ${Matlab_build_mex_using}")
  151. endif()
  152. caffe_status("")
  153. endif()
  154. if(BUILD_docs)
  155. caffe_status("Documentaion:")
  156. caffe_status(" Doxygen :" DOXYGEN_FOUND THEN "${DOXYGEN_EXECUTABLE} (${DOXYGEN_VERSION})" ELSE "No")
  157. caffe_status(" config_file : ${DOXYGEN_config_file}")
  158. caffe_status("")
  159. endif()
  160. caffe_status("Install:")
  161. caffe_status(" Install path : ${CMAKE_INSTALL_PREFIX}")
  162. caffe_status("")
  163. endfunction()
Tip!

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

Comments

Loading...