blob: 8e3b68d1b16d2589fb68603b15435571a2bec583 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001option(BUILD_CAFFE_PARSER "Build Caffe parser" OFF)
2option(BUILD_TF_PARSER "Build Tensorflow parser" OFF)
telsoa01c577f2c2018-08-31 09:22:23 +01003option(BUILD_ONNX_PARSER "Build Onnx parser" OFF)
telsoa014fcda012018-03-09 14:13:49 +00004option(BUILD_UNIT_TESTS "Build unit tests" ON)
5option(BUILD_TESTS "Build test applications" OFF)
6option(BUILD_FOR_COVERAGE "Use no optimization and output .gcno and .gcda files" OFF)
7option(ARMCOMPUTENEON "Build with ARM Compute NEON support" OFF)
8option(ARMCOMPUTECL "Build with ARM Compute OpenCL support" OFF)
Matteo Martincighf88663c2019-08-28 16:38:53 +01009option(ARMNNREF "Build with ArmNN reference support" ON)
telsoa014fcda012018-03-09 14:13:49 +000010option(PROFILING_BACKEND_STREAMLINE "Forward the armNN profiling events to DS-5/Streamline as annotations" OFF)
telsoa01c577f2c2018-08-31 09:22:23 +010011# options used for heap profiling and leak checking
surmeh013537c2c2018-05-18 16:31:43 +010012option(HEAP_PROFILING "Build with heap profiling enabled" OFF)
telsoa01c577f2c2018-08-31 09:22:23 +010013option(LEAK_CHECKING "Build with leak checking enabled" OFF)
surmeh013537c2c2018-05-18 16:31:43 +010014option(GPERFTOOLS_ROOT "Location where the gperftools 'include' and 'lib' folders to be found" Off)
telsoa01c577f2c2018-08-31 09:22:23 +010015# options used for tensorflow lite support
16option(BUILD_TF_LITE_PARSER "Build Tensorflow Lite parser" OFF)
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +000017option(BUILD_ARMNN_SERIALIZER "Build Armnn Serializer" OFF)
Jim Flynn3091b062019-02-15 14:45:04 +000018option(BUILD_ARMNN_QUANTIZER "Build ArmNN quantizer" OFF)
Éanna Ó Catháina563b922019-05-09 11:34:06 +010019option(BUILD_ACCURACY_TOOL "Build Accuracy Tool" OFF)
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +000020option(FLATC_DIR "Path to Flatbuffers compiler" OFF)
telsoa01c577f2c2018-08-31 09:22:23 +010021option(TF_LITE_GENERATED_PATH "Tensorflow lite generated C++ schema location" OFF)
22option(FLATBUFFERS_ROOT "Location where the flatbuffers 'include' and 'lib' folders to be found" Off)
Matteo Martincighe7d44982019-08-05 12:16:47 +010023option(DYNAMIC_BACKEND_PATHS "Colon seperated list of paths where to load the dynamic backends from" "")
Colm Donelana21620d2019-10-11 13:09:49 +010024option(BUILD_GATORD_MOCK "Build the Gatord simulator for external profiling testing." ON)
Matthew Benthamb4e67202019-10-31 09:55:01 +000025option(SHARED_BOOST "Use dynamic linking for boost libraries" OFF)
telsoa014fcda012018-03-09 14:13:49 +000026
27include(SelectLibraryConfigurations)
28
29set(COMPILER_IS_GNU_LIKE 0)
30if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU OR ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
31 set(COMPILER_IS_GNU_LIKE 1)
32endif()
33
34# Enable CCache if available and not disabled
35option(USE_CCACHE "USE_CCACHE" ON)
36find_program(CCACHE_FOUND ccache)
37if(CCACHE_FOUND AND USE_CCACHE)
38 get_property(rule_launch_compile DIRECTORY PROPERTY RULE_LAUNCH_COMPILE)
39 set_property(DIRECTORY PROPERTY RULE_LAUNCH_COMPILE "CCACHE_CPP2=yes ${rule_launch_compile} ccache")
40endif()
41
42# Enable distcc if available and not disabled
43option(USE_DISTCC "USE_DISTCC" OFF)
44find_program(DISTCC_FOUND distcc)
45if(DISTCC_FOUND AND USE_DISTCC)
46 get_property(rule_launch_compile DIRECTORY PROPERTY RULE_LAUNCH_COMPILE)
47 set_property(DIRECTORY PROPERTY RULE_LAUNCH_COMPILE "${rule_launch_compile} distcc")
48endif()
49
50# Set to release configuration by default
51if(NOT CMAKE_BUILD_TYPE)
52 set(CMAKE_BUILD_TYPE "Release")
53endif()
54
55# Compiler flags that are always set
56set(CMAKE_POSITION_INDEPENDENT_CODE ON)
57if(COMPILER_IS_GNU_LIKE)
Derek Lambertiba25aee2019-12-10 22:20:54 +000058 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion")
telsoa014fcda012018-03-09 14:13:49 +000059elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
Rob Hughesfc6bf052019-12-16 17:10:51 +000060 # Disable C4996 (use of deprecated identifier) due to https://developercommunity.visualstudio.com/content/problem/252574/deprecated-compilation-warning-for-virtual-overrid.html
61 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /wd4996")
telsoa014fcda012018-03-09 14:13:49 +000062 add_definitions(-DNOMINMAX=1 -DNO_STRICT=1)
63endif()
64if("${CMAKE_SYSTEM_NAME}" STREQUAL Android)
65 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -llog")
66 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -llog")
67endif()
68
69# Compiler flags for Release builds
Matthew Benthame30054f2019-06-24 13:10:54 +010070set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
telsoa014fcda012018-03-09 14:13:49 +000071if(COMPILER_IS_GNU_LIKE)
72 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
73elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
74 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2")
75endif()
76
77# Compiler flags for Debug builds
78if(COMPILER_IS_GNU_LIKE)
Matthew Benthame30054f2019-06-24 13:10:54 +010079 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
telsoa014fcda012018-03-09 14:13:49 +000080elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
Matthew Benthame30054f2019-06-24 13:10:54 +010081 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI /Od")
telsoa014fcda012018-03-09 14:13:49 +000082 # Disable SAFESEH which is necessary for Edit and Continue to work
83 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /SAFESEH:NO")
84 set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /SAFESEH:NO")
85endif()
86
87# Modify RelWithDebInfo so that NDEBUG isn't defined.
88# This enables asserts.
89if (COMPILER_IS_GNU_LIKE)
90 string(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
91elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
92 string(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
93endif()
94
95# Compiler flags for code coverage measurements
96if(BUILD_FOR_COVERAGE)
97 if(NOT CMAKE_BUILD_TYPE EQUAL "Debug")
98 message(WARNING "BUILD_FOR_COVERAGE set so forcing to Debug build")
99 set(CMAKE_BUILD_TYPE "Debug")
100 endif()
101
102 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
103 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
104endif()
105
106if(BUILD_FOR_COVERAGE AND NOT BUILD_UNIT_TESTS)
107 message(WARNING "BUILD_FOR_COVERAGE set but not BUILD_UNIT_TESTS, so code coverage will not be able to run")
108endif()
109
110set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
111
112# Boost
Matthew Benthamb4e67202019-10-31 09:55:01 +0000113if(SHARED_BOOST)
114 add_definitions(-DBOOST_ALL_DYN_LINK)
115 set(Boost_USE_STATIC_LIBS OFF)
116else()
117 set(Boost_USE_STATIC_LIBS ON)
118endif()
telsoa014fcda012018-03-09 14:13:49 +0000119add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
Francis Murtaghf8ac8292019-12-19 11:35:55 +0000120find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework system filesystem program_options)
Matthew Bentham97fb2de2019-07-12 17:26:57 +0100121include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
122link_directories(${Boost_LIBRARY_DIRS})
telsoa014fcda012018-03-09 14:13:49 +0000123
124# pthread
125find_package (Threads)
126
127# Favour the protobuf passed on command line
telsoa01c577f2c2018-08-31 09:22:23 +0100128if(BUILD_TF_PARSER OR BUILD_CAFFE_PARSER OR BUILD_ONNX_PARSER)
telsoa014fcda012018-03-09 14:13:49 +0000129 find_library(PROTOBUF_LIBRARY_DEBUG NAMES "protobufd"
130 PATHS ${PROTOBUF_ROOT}/lib
131 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
132 find_library(PROTOBUF_LIBRARY_DEBUG NAMES "protobufd")
133
134 find_library(PROTOBUF_LIBRARY_RELEASE NAMES "protobuf"
135 PATHS ${PROTOBUF_ROOT}/lib
136 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
137 find_library(PROTOBUF_LIBRARY_RELEASE NAMES "protobuf")
138
139 select_library_configurations(PROTOBUF)
140
141 find_path(PROTOBUF_INCLUDE_DIRS "google/protobuf/message.h"
142 PATHS ${PROTOBUF_ROOT}/include
143 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
144 find_path(PROTOBUF_INCLUDE_DIRS "google/protobuf/message.h")
145
146 include_directories(SYSTEM "${PROTOBUF_INCLUDE_DIRS}")
147 add_definitions(-DPROTOBUF_USE_DLLS)
148endif()
149
150# Caffe and its dependencies
151if(BUILD_CAFFE_PARSER)
152 add_definitions(-DARMNN_CAFFE_PARSER)
153
154 find_path(CAFFE_GENERATED_SOURCES "caffe/proto/caffe.pb.h"
155 HINTS ${CAFFE_BUILD_ROOT}/include)
156 include_directories(SYSTEM "${CAFFE_GENERATED_SOURCES}")
157endif()
158
159if(BUILD_TF_PARSER)
160 add_definitions(-DARMNN_TF_PARSER)
161
162 find_path(TF_GENERATED_SOURCES "tensorflow/core/protobuf/saved_model.pb.cc")
163
164 # C++ sources generated for tf protobufs
165 file(GLOB_RECURSE TF_PROTOBUFS "${TF_GENERATED_SOURCES}/*.pb.cc")
166
167 # C++ headers generated for tf protobufs
168 include_directories(SYSTEM "${TF_GENERATED_SOURCES}")
169endif()
170
telsoa01c577f2c2018-08-31 09:22:23 +0100171if(BUILD_ONNX_PARSER)
172 add_definitions(-DARMNN_ONNX_PARSER)
173
174 find_path(ONNX_GENERATED_SOURCES "onnx/onnx.pb.cc")
175
176 # C++ headers generated for onnx protobufs
177 include_directories(SYSTEM "${ONNX_GENERATED_SOURCES}")
178endif()
179
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +0000180# Flatbuffers support for TF Lite and Armnn Serializer
181if(BUILD_TF_LITE_PARSER OR BUILD_ARMNN_SERIALIZER)
telsoa01c577f2c2018-08-31 09:22:23 +0100182 # verify we have a valid flatbuffers include path
183 find_path(FLATBUFFERS_INCLUDE_PATH flatbuffers/flatbuffers.h
184 HINTS ${FLATBUFFERS_ROOT}/include /usr/local/include /usr/include)
185
Matthew Benthamd1ae3a62019-02-22 17:30:32 +0000186 message(STATUS "Flatbuffers headers are located at: ${FLATBUFFERS_INCLUDE_PATH}")
telsoa01c577f2c2018-08-31 09:22:23 +0100187
188 find_library(FLATBUFFERS_LIBRARY
189 NAMES libflatbuffers.a flatbuffers
190 HINTS ${FLATBUFFERS_ROOT}/lib /usr/local/lib /usr/lib)
191
Matthew Benthamd1ae3a62019-02-22 17:30:32 +0000192 message(STATUS "Flatbuffers library located at: ${FLATBUFFERS_LIBRARY}")
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +0000193endif()
194
195# Flatbuffers schema support for TF Lite
196if(BUILD_TF_LITE_PARSER)
197 find_path(TF_LITE_SCHEMA_INCLUDE_PATH
198 schema_generated.h
199 HINTS ${TF_LITE_GENERATED_PATH})
200
Matthew Benthamd1ae3a62019-02-22 17:30:32 +0000201 message(STATUS "Tf Lite generated header found at: ${TF_LITE_SCHEMA_INCLUDE_PATH}")
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +0000202
Matthew Benthamd1ae3a62019-02-22 17:30:32 +0000203 add_definitions(-DARMNN_TF_LITE_PARSER)
telsoa01c577f2c2018-08-31 09:22:23 +0100204endif()
205
Kevin May43a799c2019-02-08 16:31:42 +0000206if(BUILD_ARMNN_SERIALIZER)
Kevin May43a799c2019-02-08 16:31:42 +0000207 add_definitions(-DARMNN_SERIALIZER)
Matthew Bentham268509a2019-02-25 13:58:24 +0000208 add_definitions(-DARMNN_SERIALIZER_SCHEMA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/src/armnnSerializer/ArmnnSchema.fbs")
Kevin May43a799c2019-02-08 16:31:42 +0000209endif()
210
telsoa014fcda012018-03-09 14:13:49 +0000211include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
212
213# ARM Compute
214# Note that ARM Compute has a different folder layout depending on the branch but also on
215# whether it comes from a prepackaged archive (this is why we add several hints below)
216if(ARMCOMPUTENEON OR ARMCOMPUTECL)
217 find_path(ARMCOMPUTE_INCLUDE arm_compute/core/CL/ICLKernel.h
218 PATHS ${ARMCOMPUTE_ROOT}/include
219 PATHS ${ARMCOMPUTE_ROOT}/applications/arm_compute
220 PATHS ${ARMCOMPUTE_ROOT}
221 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
222 find_path(ARMCOMPUTE_INCLUDE arm_compute/core/CL/ICLKernel.h)
223 include_directories(SYSTEM "${ARMCOMPUTE_INCLUDE}")
224
225 # Find the Arm Compute libraries if not already specified (the user may have already defined this in advance,
226 # e.g. if building clframework as a dependent cmake project)
227 if (NOT DEFINED ARMCOMPUTE_LIBRARIES)
228 # We link to the static variant so that customers don't need to find and build a compatible version of clframework.
229 # First try the folders specified ARMCOMPUTE_BUILD_DIR (with PATH_SUFFIXES for
230 # Windows builds)
231 find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static
232 PATHS ${ARMCOMPUTE_BUILD_DIR}
233 PATH_SUFFIXES "Debug"
234 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
235 find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute-static
236 PATHS ${ARMCOMPUTE_BUILD_DIR}
237 PATH_SUFFIXES "Release"
238 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
239 find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core-static
240 PATHS ${ARMCOMPUTE_BUILD_DIR}
241 PATH_SUFFIXES "Debug"
242 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
243 find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core-static
244 PATHS ${ARMCOMPUTE_BUILD_DIR}
245 PATH_SUFFIXES "Release"
246 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
247
248 # In case it wasn't there, try a default search (will work in cases where
249 # the library has been installed into a standard location)
250 find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static)
251 find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute-static)
252 find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core-static)
253 find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core-static)
254
255 set(ARMCOMPUTE_LIBRARIES
256 debug ${ARMCOMPUTE_LIBRARY_DEBUG} ${ARMCOMPUTE_CORE_LIBRARY_DEBUG}
257 optimized ${ARMCOMPUTE_LIBRARY_RELEASE} ${ARMCOMPUTE_CORE_LIBRARY_RELEASE} )
258 endif()
259endif()
260
261# ARM Compute NEON backend
262if(ARMCOMPUTENEON)
263 # Add preprocessor definition for ARM Compute NEON
264 add_definitions(-DARMCOMPUTENEON_ENABLED)
265 # The ARM Compute headers contain some NEON intrinsics, so we need to build armnn with NEON support on armv7
266 if(${CMAKE_SYSTEM_PROCESSOR} MATCHES armv7 AND COMPILER_IS_GNU_LIKE)
267 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon")
268 endif()
269endif()
270
271# ARM Compute OpenCL backend
272if(ARMCOMPUTECL)
273 # Always use Arm compute library OpenCL headers
274 find_path(OPENCL_INCLUDE CL/cl2.hpp
275 PATHS ${ARMCOMPUTE_ROOT}/include
276 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
277
Matthew Bentham3b72db02018-10-11 09:47:01 +0100278 # Link against libOpenCL in opencl-1.2-stubs, but don't search there at runtime
279 link_libraries(-L${ARMCOMPUTE_BUILD_DIR}/opencl-1.2-stubs)
280 set(OPENCL_LIBRARIES OpenCL)
telsoa014fcda012018-03-09 14:13:49 +0000281
Matthew Bentham416b41d2020-02-05 22:15:26 +0000282 include_directories(SYSTEM ${OPENCL_INCLUDE})
telsoa014fcda012018-03-09 14:13:49 +0000283
284 # Add preprocessor definition for ARM Compute OpenCL
285 add_definitions(-DARMCOMPUTECL_ENABLED)
286
287 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DARM_COMPUTE_DEBUG_ENABLED")
288endif()
289
290# Used by both Arm Compute backends, but should be added
291# to the search path after the system directories if necessary
292if(ARMCOMPUTENEON OR ARMCOMPUTECL)
293 find_path(HALF_INCLUDE half/half.hpp)
294 find_path(HALF_INCLUDE half/half.hpp
295 PATHS ${ARMCOMPUTE_ROOT}/include
296 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
telsoa01c577f2c2018-08-31 09:22:23 +0100297 include_directories(SYSTEM ${HALF_INCLUDE})
telsoa014fcda012018-03-09 14:13:49 +0000298endif()
299
Matteo Martincighdb16dd32019-08-27 16:41:11 +0100300# ArmNN reference backend
301if(ARMNNREF)
302 add_definitions(-DARMNNREF_ENABLED)
Matteo Martincighe67edb22019-08-14 14:05:46 +0100303endif()
304
Narumol Prangnawarat60a20fb2019-12-09 17:24:41 +0000305# ArmNN dynamic backend
306if(DYNAMIC_BACKEND_PATHS)
307 add_definitions(-DARMNN_DYNAMIC_BACKEND_ENABLED)
308endif()
309
Narumol Prangnawarat867eba52020-02-03 12:29:56 +0000310if(SAMPLE_DYNAMIC_BACKEND)
311 add_definitions(-DSAMPLE_DYNAMIC_BACKEND_ENABLED)
312endif()
313
telsoa014fcda012018-03-09 14:13:49 +0000314# Streamline annotate
315if(PROFILING_BACKEND_STREAMLINE)
316 include_directories("${GATOR_ROOT}/annotate")
317 add_definitions(-DARMNN_STREAMLINE_ENABLED)
318endif()
319
telsoa01c577f2c2018-08-31 09:22:23 +0100320if(HEAP_PROFILING OR LEAK_CHECKING)
surmeh013537c2c2018-05-18 16:31:43 +0100321 # enable heap profiling for everything except for referencetests
322 if(NOT ${PROJECT_NAME} STREQUAL "referencetests")
323 find_path(HEAP_PROFILER_INCLUDE gperftools/heap-profiler.h
324 PATHS ${GPERFTOOLS_ROOT}/include
325 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
326 include_directories(SYSTEM "${HEAP_PROFILER_INCLUDE}")
327 find_library(GPERF_TOOLS_LIBRARY
328 NAMES tcmalloc_debug
329 HINTS ${GPERFTOOLS_ROOT}/lib)
330 link_directories(${GPERFTOOLS_ROOT}/lib)
331
332 link_libraries(${GPERF_TOOLS_LIBRARY})
telsoa01c577f2c2018-08-31 09:22:23 +0100333 if (HEAP_PROFILING)
334 add_definitions("-DARMNN_HEAP_PROFILING_ENABLED=1")
335 endif()
336 if (LEAK_CHECKING)
337 add_definitions("-DARMNN_LEAK_CHECKING_ENABLED=1")
338 endif()
surmeh013537c2c2018-05-18 16:31:43 +0100339 else()
Rob Hughes721b82f2019-11-15 09:04:17 +0000340 message(STATUS "Heap profiling and leak checking are disabled for referencetests")
surmeh013537c2c2018-05-18 16:31:43 +0100341 endif()
342else()
343 # Valgrind only works with gperftools version number <= 2.4
344 CHECK_INCLUDE_FILE(valgrind/memcheck.h VALGRIND_FOUND)
345endif()
346
347
348if(NOT BUILD_CAFFE_PARSER)
349 message(STATUS "Caffe parser support is disabled")
350endif()
351
352if(NOT BUILD_TF_PARSER)
353 message(STATUS "Tensorflow parser support is disabled")
354endif()
355
telsoa01c577f2c2018-08-31 09:22:23 +0100356if(NOT BUILD_TF_LITE_PARSER)
357 message(STATUS "Tensorflow Lite parser support is disabled")
358endif()
David Beck10b4dfd2018-09-19 12:03:20 +0100359
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +0000360if(NOT BUILD_ARMNN_SERIALIZER)
361 message(STATUS "Armnn Serializer support is disabled")
362endif()
363
Jim Flynn3091b062019-02-15 14:45:04 +0000364if(NOT BUILD_ARMNN_QUANTIZER)
365 message(STATUS "ArmNN Quantizer support is disabled")
366endif()
367
David Beck10b4dfd2018-09-19 12:03:20 +0100368# ArmNN source files required for all build options
369include_directories(SYSTEM third-party)