1 # Copyright (C) 2018-2019 Intel Corporation
3 # SPDX-License-Identifier: Apache-2.0
6 cmake_policy(SET CMP0054 NEW)
8 #features trigger supported by build system
9 include(check_features)
12 #we have number of dependencies stored on ftp
13 include(dependency_solver)
15 #prepare temporary folder
16 if (DEFINED ENV{${DL_SDK_TEMP}} AND NOT $ENV{${DL_SDK_TEMP}} STREQUAL "")
18 string(REPLACE "\\" "\\\\" TEMP $ENV{${DL_SDK_TEMP}})
20 set(TEMP $ENV{${DL_SDK_TEMP}})
23 if (ENABLE_ALTERNATIVE_TEMP)
24 set(ALTERNATIVE_PATH ${IE_MAIN_SOURCE_DIR}/temp)
27 message(STATUS "DL_SDK_TEMP envionment not set")
28 set(TEMP ${IE_MAIN_SOURCE_DIR}/temp)
32 include(ExternalProject)
34 if (ENABLE_SAME_BRANCH_FOR_MODELS)
35 branchName(MODELS_BRANCH)
37 set(MODELS_BRANCH "master")
40 ## enable cblas_gemm from OpenBLAS package
41 if (GEMM STREQUAL "OPENBLAS")
42 if(NOT BLAS_LIBRARIES OR NOT BLAS_INCLUDE_DIRS)
43 find_package(BLAS REQUIRED)
45 find_path(BLAS_INCLUDE_DIRS cblas.h)
47 message(ERROR "OpenBLAS not found: install OpenBLAS or set -DBLAS_INCLUDE_DIRS=<path to dir with cblas.h> and -DBLAS_LIBRARIES=<path to libopenblas.so or openblas.lib>")
50 debug_message(STATUS "openblas=" ${BLAS_LIBRARIES})
54 if (GEMM STREQUAL "MKL")
56 message(FATAL_ERROR "MKLROOT not found: install MKL and set -DMKLROOT=<path_to_MKL>")
59 debug_message(STATUS "mkl_ml=" ${MKLROOT})
63 if (THREADING STREQUAL "OMP")
65 RESOLVE_DEPENDENCY(OMP
66 ARCHIVE_WIN "iomp.zip"
67 TARGET_PATH "${TEMP}/omp"
69 VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*")
71 RESOLVE_DEPENDENCY(OMP
72 ARCHIVE_LIN "iomp.tgz"
73 TARGET_PATH "${TEMP}/omp"
75 VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*")
77 RESOLVE_DEPENDENCY(OMP
78 ARCHIVE_MAC "iomp_20190130_mac.tgz"
79 TARGET_PATH "${TEMP}/omp"
81 VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*")
83 log_rpath_from_dir(OMP "${OMP}/lib")
84 debug_message(STATUS "intel_omp=" ${OMP})
88 if (THREADING STREQUAL "TBB")
90 #TODO: add target_path to be platform specific as well, to avoid following if
91 RESOLVE_DEPENDENCY(TBB
92 ARCHIVE_WIN "tbb2019_20181010_win.zip" #TODO: windows zip archive created incorrectly using old name for folder
93 TARGET_PATH "${TEMP}/tbb"
95 VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*")
97 RESOLVE_DEPENDENCY(TBB
98 ARCHIVE_LIN "tbb2019_20181010_lin.tgz"
99 TARGET_PATH "${TEMP}/tbb"
100 ENVIRONMENT "TBBROOT")
102 RESOLVE_DEPENDENCY(TBB
103 ARCHIVE_MAC "tbb2019_20190130_mac.tgz"
104 TARGET_PATH "${TEMP}/tbb"
105 ENVIRONMENT "TBBROOT"
106 VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*")
108 log_rpath_from_dir(TBB "${TBB}/lib")
109 debug_message(STATUS "tbb=" ${TBB})
114 RESOLVE_DEPENDENCY(OPENCV
115 ARCHIVE_WIN "opencv_4.1.0-0437.zip"
116 TARGET_PATH "${TEMP}/opencv_4.1.0"
117 ENVIRONMENT "OpenCV_DIR"
118 VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*")
119 log_rpath_from_dir(OPENCV "\\opencv_4.1.0\\bin")
120 set( ENV{OpenCV_DIR} ${OPENCV}/cmake )
122 RESOLVE_DEPENDENCY(OPENCV
123 ARCHIVE_MAC "opencv_4.1.0-0437_osx.tar.xz"
124 TARGET_PATH "${TEMP}/opencv_4.1.0_osx"
125 ENVIRONMENT "OpenCV_DIR"
126 VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*")
127 log_rpath_from_dir(OPENCV "opencv_4.1.0_osx/lib")
128 set( ENV{OpenCV_DIR} ${OPENCV}/cmake )
130 if (${LINUX_OS_NAME} STREQUAL "Ubuntu 16.04")
131 RESOLVE_DEPENDENCY(OPENCV
132 ARCHIVE_LIN "opencv_4.1.0-0437_ubuntu16.tar.xz"
133 TARGET_PATH "${TEMP}/opencv_4.1.0_ubuntu16"
134 ENVIRONMENT "OpenCV_DIR"
135 VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*")
136 log_rpath_from_dir(OPENCV "opencv_4.1.0_ubuntu16/lib")
137 elseif (${LINUX_OS_NAME} STREQUAL "Ubuntu 18.04")
138 RESOLVE_DEPENDENCY(OPENCV
139 ARCHIVE_LIN "opencv_4.1.0-0437_ubuntu18.tar.xz"
140 TARGET_PATH "${TEMP}/opencv_4.1.0_ubuntu18"
141 ENVIRONMENT "OpenCV_DIR"
142 VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*")
143 log_rpath_from_dir(OPENCV "opencv_4.1.0_ubuntu18/lib")
144 elseif (${LINUX_OS_NAME} STREQUAL "CentOS 7")
145 RESOLVE_DEPENDENCY(OPENCV
146 ARCHIVE_LIN "opencv_4.1.0-0437_centos7.tar.xz"
147 TARGET_PATH "${TEMP}/opencv_4.1.0_centos"
148 ENVIRONMENT "OpenCV_DIR"
149 VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*")
150 log_rpath_from_dir(OPENCV "opencv_4.1.0_centos/lib")
151 elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l" AND
152 (${LINUX_OS_NAME} STREQUAL "Debian 9" OR
153 ${LINUX_OS_NAME} STREQUAL "Raspbian 9"))
154 RESOLVE_DEPENDENCY(OPENCV
155 ARCHIVE_LIN "opencv_4.1.0-0437_debian9arm.tar.xz"
156 TARGET_PATH "${TEMP}/opencv_4.1.0_debian9arm"
157 ENVIRONMENT "OpenCV_DIR"
158 VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*")
159 log_rpath_from_dir(OPENCV "opencv_4.1.0_debian9arm/lib")
161 set( ENV{OpenCV_DIR} ${OPENCV}/cmake )
163 debug_message(STATUS "opencv=" ${OPENCV})
170 RESOLVE_DEPENDENCY(GNA
171 ARCHIVE_UNIFIED "gna_20181120.zip"
172 TARGET_PATH "${TEMP}/gna")
176 "${CMAKE_SOURCE_DIR}/cmake/share/InferenceEngineConfig.cmake.in"
177 "${CMAKE_BINARY_DIR}/share/InferenceEngineConfig.cmake"
181 "${CMAKE_SOURCE_DIR}/cmake/share/InferenceEngineConfig-version.cmake.in"
182 "${CMAKE_BINARY_DIR}/share/InferenceEngineConfig-version.cmake"
186 "${CMAKE_SOURCE_DIR}/cmake/ie_parallel.cmake"
187 "${CMAKE_BINARY_DIR}/share/ie_parallel.cmake"