telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | option(BUILD_CAFFE_PARSER "Build Caffe parser" OFF) |
| 2 | option(BUILD_TF_PARSER "Build Tensorflow parser" OFF) |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 3 | option(BUILD_ONNX_PARSER "Build Onnx parser" OFF) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | option(BUILD_UNIT_TESTS "Build unit tests" ON) |
| 5 | option(BUILD_TESTS "Build test applications" OFF) |
| 6 | option(BUILD_FOR_COVERAGE "Use no optimization and output .gcno and .gcda files" OFF) |
| 7 | option(ARMCOMPUTENEON "Build with ARM Compute NEON support" OFF) |
| 8 | option(ARMCOMPUTECL "Build with ARM Compute OpenCL support" OFF) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 9 | option(PROFILING_BACKEND_STREAMLINE "Forward the armNN profiling events to DS-5/Streamline as annotations" OFF) |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 10 | # options used for heap profiling and leak checking |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 11 | option(HEAP_PROFILING "Build with heap profiling enabled" OFF) |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 12 | option(LEAK_CHECKING "Build with leak checking enabled" OFF) |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 13 | option(GPERFTOOLS_ROOT "Location where the gperftools 'include' and 'lib' folders to be found" Off) |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 14 | # options used for tensorflow lite support |
| 15 | option(BUILD_TF_LITE_PARSER "Build Tensorflow Lite parser" OFF) |
| 16 | option(TF_LITE_GENERATED_PATH "Tensorflow lite generated C++ schema location" OFF) |
| 17 | option(FLATBUFFERS_ROOT "Location where the flatbuffers 'include' and 'lib' folders to be found" Off) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 18 | |
| 19 | include(SelectLibraryConfigurations) |
| 20 | |
| 21 | set(COMPILER_IS_GNU_LIKE 0) |
| 22 | if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU OR ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) |
| 23 | set(COMPILER_IS_GNU_LIKE 1) |
| 24 | endif() |
| 25 | |
| 26 | # Enable CCache if available and not disabled |
| 27 | option(USE_CCACHE "USE_CCACHE" ON) |
| 28 | find_program(CCACHE_FOUND ccache) |
| 29 | if(CCACHE_FOUND AND USE_CCACHE) |
| 30 | get_property(rule_launch_compile DIRECTORY PROPERTY RULE_LAUNCH_COMPILE) |
| 31 | set_property(DIRECTORY PROPERTY RULE_LAUNCH_COMPILE "CCACHE_CPP2=yes ${rule_launch_compile} ccache") |
| 32 | endif() |
| 33 | |
| 34 | # Enable distcc if available and not disabled |
| 35 | option(USE_DISTCC "USE_DISTCC" OFF) |
| 36 | find_program(DISTCC_FOUND distcc) |
| 37 | if(DISTCC_FOUND AND USE_DISTCC) |
| 38 | get_property(rule_launch_compile DIRECTORY PROPERTY RULE_LAUNCH_COMPILE) |
| 39 | set_property(DIRECTORY PROPERTY RULE_LAUNCH_COMPILE "${rule_launch_compile} distcc") |
| 40 | endif() |
| 41 | |
| 42 | # Set to release configuration by default |
| 43 | if(NOT CMAKE_BUILD_TYPE) |
| 44 | set(CMAKE_BUILD_TYPE "Release") |
| 45 | endif() |
| 46 | |
| 47 | # Compiler flags that are always set |
| 48 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) |
| 49 | if(COMPILER_IS_GNU_LIKE) |
| 50 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion") |
| 51 | elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) |
| 52 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP") |
| 53 | add_definitions(-DNOMINMAX=1 -DNO_STRICT=1) |
| 54 | endif() |
| 55 | if("${CMAKE_SYSTEM_NAME}" STREQUAL Android) |
| 56 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -llog") |
| 57 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -llog") |
| 58 | endif() |
| 59 | |
| 60 | # Compiler flags for Release builds |
| 61 | set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG") |
| 62 | if(COMPILER_IS_GNU_LIKE) |
| 63 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") |
| 64 | elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) |
| 65 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2") |
| 66 | endif() |
| 67 | |
| 68 | # Compiler flags for Debug builds |
| 69 | if(COMPILER_IS_GNU_LIKE) |
Matteo Martincigh | 3d6898c | 2019-01-15 16:11:44 +0000 | [diff] [blame] | 70 | set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 71 | elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) |
| 72 | set(CMAKE_CXX_FLAGS_DEBUG "/MDd /ZI /Od") |
| 73 | # Disable SAFESEH which is necessary for Edit and Continue to work |
| 74 | set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /SAFESEH:NO") |
| 75 | set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /SAFESEH:NO") |
| 76 | endif() |
| 77 | |
| 78 | # Modify RelWithDebInfo so that NDEBUG isn't defined. |
| 79 | # This enables asserts. |
| 80 | if (COMPILER_IS_GNU_LIKE) |
| 81 | string(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") |
| 82 | elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) |
| 83 | string(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") |
| 84 | endif() |
| 85 | |
| 86 | # Compiler flags for code coverage measurements |
| 87 | if(BUILD_FOR_COVERAGE) |
| 88 | if(NOT CMAKE_BUILD_TYPE EQUAL "Debug") |
| 89 | message(WARNING "BUILD_FOR_COVERAGE set so forcing to Debug build") |
| 90 | set(CMAKE_BUILD_TYPE "Debug") |
| 91 | endif() |
| 92 | |
| 93 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") |
| 94 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") |
| 95 | endif() |
| 96 | |
| 97 | if(BUILD_FOR_COVERAGE AND NOT BUILD_UNIT_TESTS) |
| 98 | message(WARNING "BUILD_FOR_COVERAGE set but not BUILD_UNIT_TESTS, so code coverage will not be able to run") |
| 99 | endif() |
| 100 | |
| 101 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) |
| 102 | |
| 103 | # Boost |
| 104 | add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually |
| 105 | set(Boost_USE_STATIC_LIBS ON) |
| 106 | find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework system filesystem log program_options) |
| 107 | include_directories(SYSTEM "${Boost_INCLUDE_DIR}") |
| 108 | link_directories(${Boost_LIBRARY_DIR}) |
| 109 | |
| 110 | # pthread |
| 111 | find_package (Threads) |
| 112 | |
| 113 | # Favour the protobuf passed on command line |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 114 | if(BUILD_TF_PARSER OR BUILD_CAFFE_PARSER OR BUILD_ONNX_PARSER) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 115 | find_library(PROTOBUF_LIBRARY_DEBUG NAMES "protobufd" |
| 116 | PATHS ${PROTOBUF_ROOT}/lib |
| 117 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 118 | find_library(PROTOBUF_LIBRARY_DEBUG NAMES "protobufd") |
| 119 | |
| 120 | find_library(PROTOBUF_LIBRARY_RELEASE NAMES "protobuf" |
| 121 | PATHS ${PROTOBUF_ROOT}/lib |
| 122 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 123 | find_library(PROTOBUF_LIBRARY_RELEASE NAMES "protobuf") |
| 124 | |
| 125 | select_library_configurations(PROTOBUF) |
| 126 | |
| 127 | find_path(PROTOBUF_INCLUDE_DIRS "google/protobuf/message.h" |
| 128 | PATHS ${PROTOBUF_ROOT}/include |
| 129 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 130 | find_path(PROTOBUF_INCLUDE_DIRS "google/protobuf/message.h") |
| 131 | |
| 132 | include_directories(SYSTEM "${PROTOBUF_INCLUDE_DIRS}") |
| 133 | add_definitions(-DPROTOBUF_USE_DLLS) |
| 134 | endif() |
| 135 | |
| 136 | # Caffe and its dependencies |
| 137 | if(BUILD_CAFFE_PARSER) |
| 138 | add_definitions(-DARMNN_CAFFE_PARSER) |
| 139 | |
| 140 | find_path(CAFFE_GENERATED_SOURCES "caffe/proto/caffe.pb.h" |
| 141 | HINTS ${CAFFE_BUILD_ROOT}/include) |
| 142 | include_directories(SYSTEM "${CAFFE_GENERATED_SOURCES}") |
| 143 | endif() |
| 144 | |
| 145 | if(BUILD_TF_PARSER) |
| 146 | add_definitions(-DARMNN_TF_PARSER) |
| 147 | |
| 148 | find_path(TF_GENERATED_SOURCES "tensorflow/core/protobuf/saved_model.pb.cc") |
| 149 | |
| 150 | # C++ sources generated for tf protobufs |
| 151 | file(GLOB_RECURSE TF_PROTOBUFS "${TF_GENERATED_SOURCES}/*.pb.cc") |
| 152 | |
| 153 | # C++ headers generated for tf protobufs |
| 154 | include_directories(SYSTEM "${TF_GENERATED_SOURCES}") |
| 155 | endif() |
| 156 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 157 | if(BUILD_ONNX_PARSER) |
| 158 | add_definitions(-DARMNN_ONNX_PARSER) |
| 159 | |
| 160 | find_path(ONNX_GENERATED_SOURCES "onnx/onnx.pb.cc") |
| 161 | |
| 162 | # C++ headers generated for onnx protobufs |
| 163 | include_directories(SYSTEM "${ONNX_GENERATED_SOURCES}") |
| 164 | endif() |
| 165 | |
| 166 | |
| 167 | # Flatbuffers support for TF Lite |
| 168 | if(BUILD_TF_LITE_PARSER) |
| 169 | find_path(TF_LITE_SCHEMA_INCLUDE_PATH |
| 170 | schema_generated.h |
| 171 | HINTS ${TF_LITE_GENERATED_PATH}) |
| 172 | |
| 173 | if(NOT TF_LITE_SCHEMA_INCLUDE_PATH) |
| 174 | message(WARNING |
| 175 | "Couldn't find 'schema_generated.h' at ${TF_LITE_GENERATED_PATH}. Disabling Tf Lite support") |
| 176 | set(BUILD_TF_LITE_PARSER Off) |
| 177 | else() |
| 178 | message(STATUS "Tf Lite generated header found at: ${TF_LITE_SCHEMA_INCLUDE_PATH}") |
| 179 | endif() |
| 180 | |
| 181 | # verify we have a valid flatbuffers include path |
| 182 | find_path(FLATBUFFERS_INCLUDE_PATH flatbuffers/flatbuffers.h |
| 183 | HINTS ${FLATBUFFERS_ROOT}/include /usr/local/include /usr/include) |
| 184 | |
| 185 | if(NOT FLATBUFFERS_INCLUDE_PATH) |
| 186 | message(WARNING |
| 187 | "Couldn't find 'flatbuffers/flatbuffers.h' at ${FLATBUFFERS_ROOT}/include. Disabling Tf Lite support") |
| 188 | set(BUILD_TF_LITE_PARSER Off) |
| 189 | else() |
| 190 | message(STATUS "Flatbuffers headers are located at: ${FLATBUFFERS_INCLUDE_PATH}") |
| 191 | endif() |
| 192 | |
| 193 | find_library(FLATBUFFERS_LIBRARY |
| 194 | NAMES libflatbuffers.a flatbuffers |
| 195 | HINTS ${FLATBUFFERS_ROOT}/lib /usr/local/lib /usr/lib) |
| 196 | |
| 197 | if(NOT FLATBUFFERS_LIBRARY) |
| 198 | message(WARNING |
| 199 | "Couldn't find flatbuffers library. Disabling Tf Lite support") |
| 200 | set(BUILD_TF_LITE_PARSER Off) |
| 201 | else() |
| 202 | message(STATUS "Flatbuffers library located at: ${FLATBUFFERS_LIBRARY}") |
| 203 | endif() |
| 204 | |
| 205 | # Setup includes and libs only if we still want Tf Lite |
| 206 | if(BUILD_TF_LITE_PARSER) |
| 207 | include_directories(SYSTEM "${TF_LITE_SCHEMA_INCLUDE_PATH}") |
| 208 | include_directories(SYSTEM "${FLATBUFFERS_INCLUDE_PATH}") |
| 209 | add_definitions(-DARMNN_TF_LITE_PARSER) |
| 210 | add_definitions(-DARMNN_TF_LITE_SCHEMA_PATH="${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs") |
| 211 | endif() |
| 212 | endif() |
| 213 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 214 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) |
| 215 | |
| 216 | # ARM Compute |
| 217 | # Note that ARM Compute has a different folder layout depending on the branch but also on |
| 218 | # whether it comes from a prepackaged archive (this is why we add several hints below) |
| 219 | if(ARMCOMPUTENEON OR ARMCOMPUTECL) |
| 220 | find_path(ARMCOMPUTE_INCLUDE arm_compute/core/CL/ICLKernel.h |
| 221 | PATHS ${ARMCOMPUTE_ROOT}/include |
| 222 | PATHS ${ARMCOMPUTE_ROOT}/applications/arm_compute |
| 223 | PATHS ${ARMCOMPUTE_ROOT} |
| 224 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 225 | find_path(ARMCOMPUTE_INCLUDE arm_compute/core/CL/ICLKernel.h) |
| 226 | include_directories(SYSTEM "${ARMCOMPUTE_INCLUDE}") |
| 227 | |
| 228 | # Find the Arm Compute libraries if not already specified (the user may have already defined this in advance, |
| 229 | # e.g. if building clframework as a dependent cmake project) |
| 230 | if (NOT DEFINED ARMCOMPUTE_LIBRARIES) |
| 231 | # We link to the static variant so that customers don't need to find and build a compatible version of clframework. |
| 232 | # First try the folders specified ARMCOMPUTE_BUILD_DIR (with PATH_SUFFIXES for |
| 233 | # Windows builds) |
| 234 | find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static |
| 235 | PATHS ${ARMCOMPUTE_BUILD_DIR} |
| 236 | PATH_SUFFIXES "Debug" |
| 237 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 238 | find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute-static |
| 239 | PATHS ${ARMCOMPUTE_BUILD_DIR} |
| 240 | PATH_SUFFIXES "Release" |
| 241 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 242 | find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core-static |
| 243 | PATHS ${ARMCOMPUTE_BUILD_DIR} |
| 244 | PATH_SUFFIXES "Debug" |
| 245 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 246 | find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core-static |
| 247 | PATHS ${ARMCOMPUTE_BUILD_DIR} |
| 248 | PATH_SUFFIXES "Release" |
| 249 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 250 | |
| 251 | # In case it wasn't there, try a default search (will work in cases where |
| 252 | # the library has been installed into a standard location) |
| 253 | find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static) |
| 254 | find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute-static) |
| 255 | find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core-static) |
| 256 | find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core-static) |
| 257 | |
| 258 | set(ARMCOMPUTE_LIBRARIES |
| 259 | debug ${ARMCOMPUTE_LIBRARY_DEBUG} ${ARMCOMPUTE_CORE_LIBRARY_DEBUG} |
| 260 | optimized ${ARMCOMPUTE_LIBRARY_RELEASE} ${ARMCOMPUTE_CORE_LIBRARY_RELEASE} ) |
| 261 | endif() |
| 262 | endif() |
| 263 | |
| 264 | # ARM Compute NEON backend |
| 265 | if(ARMCOMPUTENEON) |
| 266 | # Add preprocessor definition for ARM Compute NEON |
| 267 | add_definitions(-DARMCOMPUTENEON_ENABLED) |
| 268 | # The ARM Compute headers contain some NEON intrinsics, so we need to build armnn with NEON support on armv7 |
| 269 | if(${CMAKE_SYSTEM_PROCESSOR} MATCHES armv7 AND COMPILER_IS_GNU_LIKE) |
| 270 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon") |
| 271 | endif() |
| 272 | endif() |
| 273 | |
| 274 | # ARM Compute OpenCL backend |
| 275 | if(ARMCOMPUTECL) |
| 276 | # Always use Arm compute library OpenCL headers |
| 277 | find_path(OPENCL_INCLUDE CL/cl2.hpp |
| 278 | PATHS ${ARMCOMPUTE_ROOT}/include |
| 279 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 280 | |
Matthew Bentham | 3b72db0 | 2018-10-11 09:47:01 +0100 | [diff] [blame] | 281 | # Link against libOpenCL in opencl-1.2-stubs, but don't search there at runtime |
| 282 | link_libraries(-L${ARMCOMPUTE_BUILD_DIR}/opencl-1.2-stubs) |
| 283 | set(OPENCL_LIBRARIES OpenCL) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 284 | |
| 285 | include_directories(${OPENCL_INCLUDE}) |
| 286 | |
| 287 | # Add preprocessor definition for ARM Compute OpenCL |
| 288 | add_definitions(-DARMCOMPUTECL_ENABLED) |
| 289 | |
| 290 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DARM_COMPUTE_DEBUG_ENABLED") |
| 291 | endif() |
| 292 | |
| 293 | # Used by both Arm Compute backends, but should be added |
| 294 | # to the search path after the system directories if necessary |
| 295 | if(ARMCOMPUTENEON OR ARMCOMPUTECL) |
| 296 | find_path(HALF_INCLUDE half/half.hpp) |
| 297 | find_path(HALF_INCLUDE half/half.hpp |
| 298 | PATHS ${ARMCOMPUTE_ROOT}/include |
| 299 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 300 | include_directories(SYSTEM ${HALF_INCLUDE}) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 301 | endif() |
| 302 | |
| 303 | # Streamline annotate |
| 304 | if(PROFILING_BACKEND_STREAMLINE) |
| 305 | include_directories("${GATOR_ROOT}/annotate") |
| 306 | add_definitions(-DARMNN_STREAMLINE_ENABLED) |
| 307 | endif() |
| 308 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 309 | if(HEAP_PROFILING OR LEAK_CHECKING) |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 310 | # enable heap profiling for everything except for referencetests |
| 311 | if(NOT ${PROJECT_NAME} STREQUAL "referencetests") |
| 312 | find_path(HEAP_PROFILER_INCLUDE gperftools/heap-profiler.h |
| 313 | PATHS ${GPERFTOOLS_ROOT}/include |
| 314 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) |
| 315 | include_directories(SYSTEM "${HEAP_PROFILER_INCLUDE}") |
| 316 | find_library(GPERF_TOOLS_LIBRARY |
| 317 | NAMES tcmalloc_debug |
| 318 | HINTS ${GPERFTOOLS_ROOT}/lib) |
| 319 | link_directories(${GPERFTOOLS_ROOT}/lib) |
| 320 | |
| 321 | link_libraries(${GPERF_TOOLS_LIBRARY}) |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 322 | if (HEAP_PROFILING) |
| 323 | add_definitions("-DARMNN_HEAP_PROFILING_ENABLED=1") |
| 324 | endif() |
| 325 | if (LEAK_CHECKING) |
| 326 | add_definitions("-DARMNN_LEAK_CHECKING_ENABLED=1") |
| 327 | endif() |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 328 | else() |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 329 | message("Heap profiling and leak checking are disabled for referencetests") |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 330 | endif() |
| 331 | else() |
| 332 | # Valgrind only works with gperftools version number <= 2.4 |
| 333 | CHECK_INCLUDE_FILE(valgrind/memcheck.h VALGRIND_FOUND) |
| 334 | endif() |
| 335 | |
| 336 | |
| 337 | if(NOT BUILD_CAFFE_PARSER) |
| 338 | message(STATUS "Caffe parser support is disabled") |
| 339 | endif() |
| 340 | |
| 341 | if(NOT BUILD_TF_PARSER) |
| 342 | message(STATUS "Tensorflow parser support is disabled") |
| 343 | endif() |
| 344 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 345 | if(NOT BUILD_TF_LITE_PARSER) |
| 346 | message(STATUS "Tensorflow Lite parser support is disabled") |
| 347 | endif() |
David Beck | 10b4dfd | 2018-09-19 12:03:20 +0100 | [diff] [blame] | 348 | |
| 349 | # ArmNN source files required for all build options |
| 350 | include_directories(SYSTEM third-party) |