blob: f4e4ad548e5f951f991752a4d373e74fd3bf3177 [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)
Sadik Armagan6f86b692020-03-09 11:04:32 +000025option(BUILD_TIMELINE_DECODER "Build the Timeline Decoder for external profiling." ON)
Matthew Benthamb4e67202019-10-31 09:55:01 +000026option(SHARED_BOOST "Use dynamic linking for boost libraries" OFF)
telsoa014fcda012018-03-09 14:13:49 +000027
28include(SelectLibraryConfigurations)
29
30set(COMPILER_IS_GNU_LIKE 0)
31if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU OR ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
32 set(COMPILER_IS_GNU_LIKE 1)
33endif()
34
35# Enable CCache if available and not disabled
36option(USE_CCACHE "USE_CCACHE" ON)
37find_program(CCACHE_FOUND ccache)
38if(CCACHE_FOUND AND USE_CCACHE)
39 get_property(rule_launch_compile DIRECTORY PROPERTY RULE_LAUNCH_COMPILE)
40 set_property(DIRECTORY PROPERTY RULE_LAUNCH_COMPILE "CCACHE_CPP2=yes ${rule_launch_compile} ccache")
41endif()
42
43# Enable distcc if available and not disabled
44option(USE_DISTCC "USE_DISTCC" OFF)
45find_program(DISTCC_FOUND distcc)
46if(DISTCC_FOUND AND USE_DISTCC)
47 get_property(rule_launch_compile DIRECTORY PROPERTY RULE_LAUNCH_COMPILE)
48 set_property(DIRECTORY PROPERTY RULE_LAUNCH_COMPILE "${rule_launch_compile} distcc")
49endif()
50
51# Set to release configuration by default
52if(NOT CMAKE_BUILD_TYPE)
53 set(CMAKE_BUILD_TYPE "Release")
54endif()
55
56# Compiler flags that are always set
57set(CMAKE_POSITION_INDEPENDENT_CODE ON)
58if(COMPILER_IS_GNU_LIKE)
Derek Lambertiba25aee2019-12-10 22:20:54 +000059 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 +000060elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
Rob Hughesfc6bf052019-12-16 17:10:51 +000061 # Disable C4996 (use of deprecated identifier) due to https://developercommunity.visualstudio.com/content/problem/252574/deprecated-compilation-warning-for-virtual-overrid.html
62 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /wd4996")
telsoa014fcda012018-03-09 14:13:49 +000063 add_definitions(-DNOMINMAX=1 -DNO_STRICT=1)
64endif()
65if("${CMAKE_SYSTEM_NAME}" STREQUAL Android)
66 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -llog")
67 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -llog")
68endif()
69
70# Compiler flags for Release builds
Matthew Benthame30054f2019-06-24 13:10:54 +010071set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
telsoa014fcda012018-03-09 14:13:49 +000072if(COMPILER_IS_GNU_LIKE)
73 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
74elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
75 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2")
76endif()
77
78# Compiler flags for Debug builds
79if(COMPILER_IS_GNU_LIKE)
Matthew Benthame30054f2019-06-24 13:10:54 +010080 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
telsoa014fcda012018-03-09 14:13:49 +000081elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
Matthew Benthame30054f2019-06-24 13:10:54 +010082 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI /Od")
telsoa014fcda012018-03-09 14:13:49 +000083 # Disable SAFESEH which is necessary for Edit and Continue to work
84 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /SAFESEH:NO")
85 set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /SAFESEH:NO")
86endif()
87
88# Modify RelWithDebInfo so that NDEBUG isn't defined.
89# This enables asserts.
90if (COMPILER_IS_GNU_LIKE)
91 string(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
92elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
93 string(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
94endif()
95
96# Compiler flags for code coverage measurements
97if(BUILD_FOR_COVERAGE)
98 if(NOT CMAKE_BUILD_TYPE EQUAL "Debug")
99 message(WARNING "BUILD_FOR_COVERAGE set so forcing to Debug build")
100 set(CMAKE_BUILD_TYPE "Debug")
101 endif()
102
103 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
104 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
105endif()
106
107if(BUILD_FOR_COVERAGE AND NOT BUILD_UNIT_TESTS)
108 message(WARNING "BUILD_FOR_COVERAGE set but not BUILD_UNIT_TESTS, so code coverage will not be able to run")
109endif()
110
111set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
112
113# Boost
Matthew Benthamb4e67202019-10-31 09:55:01 +0000114if(SHARED_BOOST)
115 add_definitions(-DBOOST_ALL_DYN_LINK)
116 set(Boost_USE_STATIC_LIBS OFF)
117else()
118 set(Boost_USE_STATIC_LIBS ON)
119endif()
telsoa014fcda012018-03-09 14:13:49 +0000120add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
Francis Murtaghf8ac8292019-12-19 11:35:55 +0000121find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework system filesystem program_options)
Matthew Bentham97fb2de2019-07-12 17:26:57 +0100122include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
123link_directories(${Boost_LIBRARY_DIRS})
telsoa014fcda012018-03-09 14:13:49 +0000124
125# pthread
126find_package (Threads)
127
128# Favour the protobuf passed on command line
telsoa01c577f2c2018-08-31 09:22:23 +0100129if(BUILD_TF_PARSER OR BUILD_CAFFE_PARSER OR BUILD_ONNX_PARSER)
telsoa014fcda012018-03-09 14:13:49 +0000130 find_library(PROTOBUF_LIBRARY_DEBUG NAMES "protobufd"
131 PATHS ${PROTOBUF_ROOT}/lib
132 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
133 find_library(PROTOBUF_LIBRARY_DEBUG NAMES "protobufd")
134
135 find_library(PROTOBUF_LIBRARY_RELEASE NAMES "protobuf"
136 PATHS ${PROTOBUF_ROOT}/lib
137 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
138 find_library(PROTOBUF_LIBRARY_RELEASE NAMES "protobuf")
139
140 select_library_configurations(PROTOBUF)
141
142 find_path(PROTOBUF_INCLUDE_DIRS "google/protobuf/message.h"
143 PATHS ${PROTOBUF_ROOT}/include
144 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
145 find_path(PROTOBUF_INCLUDE_DIRS "google/protobuf/message.h")
146
147 include_directories(SYSTEM "${PROTOBUF_INCLUDE_DIRS}")
148 add_definitions(-DPROTOBUF_USE_DLLS)
149endif()
150
151# Caffe and its dependencies
152if(BUILD_CAFFE_PARSER)
153 add_definitions(-DARMNN_CAFFE_PARSER)
154
155 find_path(CAFFE_GENERATED_SOURCES "caffe/proto/caffe.pb.h"
156 HINTS ${CAFFE_BUILD_ROOT}/include)
157 include_directories(SYSTEM "${CAFFE_GENERATED_SOURCES}")
158endif()
159
160if(BUILD_TF_PARSER)
161 add_definitions(-DARMNN_TF_PARSER)
162
163 find_path(TF_GENERATED_SOURCES "tensorflow/core/protobuf/saved_model.pb.cc")
164
165 # C++ sources generated for tf protobufs
166 file(GLOB_RECURSE TF_PROTOBUFS "${TF_GENERATED_SOURCES}/*.pb.cc")
167
168 # C++ headers generated for tf protobufs
169 include_directories(SYSTEM "${TF_GENERATED_SOURCES}")
170endif()
171
telsoa01c577f2c2018-08-31 09:22:23 +0100172if(BUILD_ONNX_PARSER)
173 add_definitions(-DARMNN_ONNX_PARSER)
174
175 find_path(ONNX_GENERATED_SOURCES "onnx/onnx.pb.cc")
176
177 # C++ headers generated for onnx protobufs
178 include_directories(SYSTEM "${ONNX_GENERATED_SOURCES}")
179endif()
180
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +0000181# Flatbuffers support for TF Lite and Armnn Serializer
182if(BUILD_TF_LITE_PARSER OR BUILD_ARMNN_SERIALIZER)
telsoa01c577f2c2018-08-31 09:22:23 +0100183 # verify we have a valid flatbuffers include path
184 find_path(FLATBUFFERS_INCLUDE_PATH flatbuffers/flatbuffers.h
185 HINTS ${FLATBUFFERS_ROOT}/include /usr/local/include /usr/include)
186
Matthew Benthamd1ae3a62019-02-22 17:30:32 +0000187 message(STATUS "Flatbuffers headers are located at: ${FLATBUFFERS_INCLUDE_PATH}")
telsoa01c577f2c2018-08-31 09:22:23 +0100188
189 find_library(FLATBUFFERS_LIBRARY
190 NAMES libflatbuffers.a flatbuffers
191 HINTS ${FLATBUFFERS_ROOT}/lib /usr/local/lib /usr/lib)
192
Matthew Benthamd1ae3a62019-02-22 17:30:32 +0000193 message(STATUS "Flatbuffers library located at: ${FLATBUFFERS_LIBRARY}")
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +0000194endif()
195
196# Flatbuffers schema support for TF Lite
197if(BUILD_TF_LITE_PARSER)
198 find_path(TF_LITE_SCHEMA_INCLUDE_PATH
199 schema_generated.h
200 HINTS ${TF_LITE_GENERATED_PATH})
201
Matthew Benthamd1ae3a62019-02-22 17:30:32 +0000202 message(STATUS "Tf Lite generated header found at: ${TF_LITE_SCHEMA_INCLUDE_PATH}")
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +0000203
Matthew Benthamd1ae3a62019-02-22 17:30:32 +0000204 add_definitions(-DARMNN_TF_LITE_PARSER)
telsoa01c577f2c2018-08-31 09:22:23 +0100205endif()
206
Kevin May43a799c2019-02-08 16:31:42 +0000207if(BUILD_ARMNN_SERIALIZER)
Kevin May43a799c2019-02-08 16:31:42 +0000208 add_definitions(-DARMNN_SERIALIZER)
Matthew Bentham268509a2019-02-25 13:58:24 +0000209 add_definitions(-DARMNN_SERIALIZER_SCHEMA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/src/armnnSerializer/ArmnnSchema.fbs")
Kevin May43a799c2019-02-08 16:31:42 +0000210endif()
211
telsoa014fcda012018-03-09 14:13:49 +0000212include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
Sadik Armagana97a0be2020-03-03 10:44:56 +0000213include_directories(${CMAKE_CURRENT_SOURCE_DIR}/profiling)
telsoa014fcda012018-03-09 14:13:49 +0000214
215# ARM Compute
216# Note that ARM Compute has a different folder layout depending on the branch but also on
217# whether it comes from a prepackaged archive (this is why we add several hints below)
218if(ARMCOMPUTENEON OR ARMCOMPUTECL)
219 find_path(ARMCOMPUTE_INCLUDE arm_compute/core/CL/ICLKernel.h
220 PATHS ${ARMCOMPUTE_ROOT}/include
221 PATHS ${ARMCOMPUTE_ROOT}/applications/arm_compute
222 PATHS ${ARMCOMPUTE_ROOT}
223 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
224 find_path(ARMCOMPUTE_INCLUDE arm_compute/core/CL/ICLKernel.h)
225 include_directories(SYSTEM "${ARMCOMPUTE_INCLUDE}")
226
227 # Find the Arm Compute libraries if not already specified (the user may have already defined this in advance,
228 # e.g. if building clframework as a dependent cmake project)
229 if (NOT DEFINED ARMCOMPUTE_LIBRARIES)
230 # We link to the static variant so that customers don't need to find and build a compatible version of clframework.
231 # First try the folders specified ARMCOMPUTE_BUILD_DIR (with PATH_SUFFIXES for
232 # Windows builds)
233 find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static
234 PATHS ${ARMCOMPUTE_BUILD_DIR}
235 PATH_SUFFIXES "Debug"
236 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
237 find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute-static
238 PATHS ${ARMCOMPUTE_BUILD_DIR}
239 PATH_SUFFIXES "Release"
240 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
241 find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core-static
242 PATHS ${ARMCOMPUTE_BUILD_DIR}
243 PATH_SUFFIXES "Debug"
244 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
245 find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core-static
246 PATHS ${ARMCOMPUTE_BUILD_DIR}
247 PATH_SUFFIXES "Release"
248 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
249
250 # In case it wasn't there, try a default search (will work in cases where
251 # the library has been installed into a standard location)
252 find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static)
253 find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute-static)
254 find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core-static)
255 find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core-static)
256
257 set(ARMCOMPUTE_LIBRARIES
258 debug ${ARMCOMPUTE_LIBRARY_DEBUG} ${ARMCOMPUTE_CORE_LIBRARY_DEBUG}
259 optimized ${ARMCOMPUTE_LIBRARY_RELEASE} ${ARMCOMPUTE_CORE_LIBRARY_RELEASE} )
260 endif()
261endif()
262
263# ARM Compute NEON backend
264if(ARMCOMPUTENEON)
265 # Add preprocessor definition for ARM Compute NEON
266 add_definitions(-DARMCOMPUTENEON_ENABLED)
267 # The ARM Compute headers contain some NEON intrinsics, so we need to build armnn with NEON support on armv7
268 if(${CMAKE_SYSTEM_PROCESSOR} MATCHES armv7 AND COMPILER_IS_GNU_LIKE)
269 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon")
270 endif()
271endif()
272
273# ARM Compute OpenCL backend
274if(ARMCOMPUTECL)
275 # Always use Arm compute library OpenCL headers
276 find_path(OPENCL_INCLUDE CL/cl2.hpp
277 PATHS ${ARMCOMPUTE_ROOT}/include
278 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
279
Matthew Bentham3b72db02018-10-11 09:47:01 +0100280 # Link against libOpenCL in opencl-1.2-stubs, but don't search there at runtime
281 link_libraries(-L${ARMCOMPUTE_BUILD_DIR}/opencl-1.2-stubs)
282 set(OPENCL_LIBRARIES OpenCL)
telsoa014fcda012018-03-09 14:13:49 +0000283
Matthew Bentham416b41d2020-02-05 22:15:26 +0000284 include_directories(SYSTEM ${OPENCL_INCLUDE})
telsoa014fcda012018-03-09 14:13:49 +0000285
286 # Add preprocessor definition for ARM Compute OpenCL
287 add_definitions(-DARMCOMPUTECL_ENABLED)
288
289 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DARM_COMPUTE_DEBUG_ENABLED")
290endif()
291
292# Used by both Arm Compute backends, but should be added
293# to the search path after the system directories if necessary
294if(ARMCOMPUTENEON OR ARMCOMPUTECL)
295 find_path(HALF_INCLUDE half/half.hpp)
296 find_path(HALF_INCLUDE half/half.hpp
297 PATHS ${ARMCOMPUTE_ROOT}/include
298 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
telsoa01c577f2c2018-08-31 09:22:23 +0100299 include_directories(SYSTEM ${HALF_INCLUDE})
telsoa014fcda012018-03-09 14:13:49 +0000300endif()
301
Matteo Martincighdb16dd32019-08-27 16:41:11 +0100302# ArmNN reference backend
303if(ARMNNREF)
304 add_definitions(-DARMNNREF_ENABLED)
Matteo Martincighe67edb22019-08-14 14:05:46 +0100305endif()
306
Narumol Prangnawarat60a20fb2019-12-09 17:24:41 +0000307# ArmNN dynamic backend
308if(DYNAMIC_BACKEND_PATHS)
309 add_definitions(-DARMNN_DYNAMIC_BACKEND_ENABLED)
310endif()
311
Narumol Prangnawarat867eba52020-02-03 12:29:56 +0000312if(SAMPLE_DYNAMIC_BACKEND)
313 add_definitions(-DSAMPLE_DYNAMIC_BACKEND_ENABLED)
314endif()
315
telsoa014fcda012018-03-09 14:13:49 +0000316# Streamline annotate
317if(PROFILING_BACKEND_STREAMLINE)
318 include_directories("${GATOR_ROOT}/annotate")
319 add_definitions(-DARMNN_STREAMLINE_ENABLED)
320endif()
321
telsoa01c577f2c2018-08-31 09:22:23 +0100322if(HEAP_PROFILING OR LEAK_CHECKING)
surmeh013537c2c2018-05-18 16:31:43 +0100323 # enable heap profiling for everything except for referencetests
324 if(NOT ${PROJECT_NAME} STREQUAL "referencetests")
325 find_path(HEAP_PROFILER_INCLUDE gperftools/heap-profiler.h
326 PATHS ${GPERFTOOLS_ROOT}/include
327 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
328 include_directories(SYSTEM "${HEAP_PROFILER_INCLUDE}")
329 find_library(GPERF_TOOLS_LIBRARY
330 NAMES tcmalloc_debug
331 HINTS ${GPERFTOOLS_ROOT}/lib)
332 link_directories(${GPERFTOOLS_ROOT}/lib)
333
334 link_libraries(${GPERF_TOOLS_LIBRARY})
telsoa01c577f2c2018-08-31 09:22:23 +0100335 if (HEAP_PROFILING)
336 add_definitions("-DARMNN_HEAP_PROFILING_ENABLED=1")
337 endif()
338 if (LEAK_CHECKING)
339 add_definitions("-DARMNN_LEAK_CHECKING_ENABLED=1")
340 endif()
surmeh013537c2c2018-05-18 16:31:43 +0100341 else()
Rob Hughes721b82f2019-11-15 09:04:17 +0000342 message(STATUS "Heap profiling and leak checking are disabled for referencetests")
surmeh013537c2c2018-05-18 16:31:43 +0100343 endif()
344else()
345 # Valgrind only works with gperftools version number <= 2.4
346 CHECK_INCLUDE_FILE(valgrind/memcheck.h VALGRIND_FOUND)
347endif()
348
349
350if(NOT BUILD_CAFFE_PARSER)
351 message(STATUS "Caffe parser support is disabled")
352endif()
353
354if(NOT BUILD_TF_PARSER)
355 message(STATUS "Tensorflow parser support is disabled")
356endif()
357
telsoa01c577f2c2018-08-31 09:22:23 +0100358if(NOT BUILD_TF_LITE_PARSER)
359 message(STATUS "Tensorflow Lite parser support is disabled")
360endif()
David Beck10b4dfd2018-09-19 12:03:20 +0100361
Nattapat Chaimanowong949f1252019-01-31 15:36:39 +0000362if(NOT BUILD_ARMNN_SERIALIZER)
363 message(STATUS "Armnn Serializer support is disabled")
364endif()
365
Jim Flynn3091b062019-02-15 14:45:04 +0000366if(NOT BUILD_ARMNN_QUANTIZER)
367 message(STATUS "ArmNN Quantizer support is disabled")
368endif()
369
David Beck10b4dfd2018-09-19 12:03:20 +0100370# ArmNN source files required for all build options
371include_directories(SYSTEM third-party)