Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / cmake / check_features.cmake
1 # Copyright (C) 2018-2019 Intel Corporation
2 #
3 # SPDX-License-Identifier: Apache-2.0
4 #
5
6 include("features")
7 include("mode")
8 include("itt")
9
10 #64 bits platform
11 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
12     message(STATUS "Detected 64 bit architecture")
13     SET(ARCH_64 ON)
14     SET(ARCH_32 OFF)
15 else()
16     message(STATUS "Detected 32 bit architecture")
17     SET(ARCH_64 OFF)
18     SET(ARCH_32 ON)
19 endif()
20
21 if (ARCH_64)
22 else()
23     if (UNIX OR APPLE)
24         SET(ENABLE_CLDNN OFF)
25     endif()
26     SET(ENABLE_MKL_DNN OFF)
27 endif()
28
29 #apple specific
30 if (APPLE)
31     set(ENABLE_GNA OFF)
32     set(ENABLE_CLDNN OFF)
33 endif()
34
35
36 #minGW specific - under wine no support for downloading file and applying them using git
37 if (WIN32)
38     if (MINGW)
39         SET(ENABLE_CLDNN OFF) # dont have mingw dll for linking
40         set(ENABLE_SAMPLES OFF)
41     endif()
42 endif()
43
44 # Linux specific - not all OS'es are supported
45 if (LINUX)
46     include("linux_name")
47     get_linux_name(LINUX_OS_NAME)
48     if (LINUX_OS_NAME)
49         if (NOT(
50                 ${LINUX_OS_NAME} STREQUAL "Ubuntu 14.04" OR
51                 ${LINUX_OS_NAME} STREQUAL "Ubuntu 16.04" OR
52                 ${LINUX_OS_NAME} STREQUAL "CentOS 7"))
53         endif()
54     else ()
55         message(WARNING "Cannot detect Linux OS via reading /etc/*-release:\n ${release_data}")
56     endif ()
57 endif ()
58
59 if (NOT ENABLE_MKL_DNN)
60     set(ENABLE_MKL OFF)
61 endif()
62
63 #next section set defines to be accesible in c++/c code for certain feature
64 if (ENABLE_PROFILING_RAW)
65     add_definitions(-DENABLE_PROFILING_RAW=1)
66 endif()
67
68 if (ENABLE_CLDNN)
69     add_definitions(-DENABLE_CLDNN=1)
70 endif()
71
72 if (ENABLE_MKL_DNN)
73     add_definitions(-DENABLE_MKL_DNN=1)
74 endif()
75
76 if (ENABLE_GNA)
77     add_definitions(-DENABLE_GNA)
78 endif()
79
80 if (ENABLE_SAMPLES)
81     set (ENABLE_SAMPLES_CORE ON)
82 endif()
83
84 if (DEVELOPMENT_PLUGIN_MODE)
85     message (STATUS "Enabled development plugin mode")
86
87     set (ENABLE_MKL_DNN OFF)
88     set (ENABLE_TESTS OFF)
89
90     message (STATUS "Initialising submodules")
91     execute_process (COMMAND git submodule update --init ${IE_MAIN_SOURCE_DIR}/thirdparty/pugixml
92                      RESULT_VARIABLE git_res)
93
94     if (NOT ${git_res})
95         message (STATUS "Initialising submodules - done")
96     endif()
97 endif()
98
99 if (VERBOSE_BUILD)
100     set(CMAKE_VERBOSE_MAKEFILE  ON)
101 endif()
102
103 print_enabled_features()