Skip to content

Commit f1c8094

Browse files
committed
Merge pull request opencv#8575 from lupustr3:pvlasov/icv2017u2_initial_update
2 parents b051936 + 35c7216 commit f1c8094

27 files changed

+2062
-1823
lines changed

3rdparty/ippicv/CMakeLists.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# ----------------------------------------------------------------------------
2+
# CMake file for IPP IW. See root CMakeLists.txt
3+
#
4+
# ----------------------------------------------------------------------------
5+
project(${IPP_IW_LIBRARY})
6+
7+
ocv_include_directories(${IPP_INCLUDE_DIRS} ${IPP_IW_PATH}/include)
8+
add_definitions(-DIW_BUILD)
9+
if(HAVE_IPP_ICV_ONLY)
10+
add_definitions(-DICV_BASE)
11+
endif()
12+
13+
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c)
14+
file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IPP_IW_PATH}/include/iw++/*.hpp)
15+
16+
# ----------------------------------------------------------------------------------
17+
# Define the library target:
18+
# ----------------------------------------------------------------------------------
19+
20+
add_library(${IPP_IW_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
21+
22+
if(UNIX)
23+
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
24+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-unused-function")
25+
endif()
26+
endif()
27+
28+
set_target_properties(${IPP_IW_LIBRARY}
29+
PROPERTIES OUTPUT_NAME ${IPP_IW_LIBRARY}
30+
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
31+
COMPILE_PDB_NAME ${IPP_IW_LIBRARY}
32+
COMPILE_PDB_NAME_DEBUG "${IPP_IW_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
33+
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
34+
)
35+
36+
if(ENABLE_SOLUTION_FOLDERS)
37+
set_target_properties(${IPP_IW_LIBRARY} PROPERTIES FOLDER "3rdparty")
38+
endif()
39+
40+
if(NOT BUILD_SHARED_LIBS)
41+
ocv_install_target(${IPP_IW_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
42+
endif()

3rdparty/ippicv/ippicv.cmake

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,38 @@ function(download_ippicv root_var)
22
set(${root_var} "" PARENT_SCOPE)
33

44
# Commit SHA in the opencv_3rdparty repo
5-
set(IPPICV_COMMIT "81a676001ca8075ada498583e4166079e5744668")
5+
set(IPPICV_COMMIT "a62e20676a60ee0ad6581e217fe7e4bada3b95db")
66
# Define actual ICV versions
77
if(APPLE)
8-
set(OPENCV_ICV_NAME "ippicv_macosx_20151201.tgz")
9-
set(OPENCV_ICV_HASH "4ff1fde9a7cfdfe7250bfcd8334e0f2f")
108
set(OPENCV_ICV_PLATFORM "macosx")
11-
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_osx")
9+
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
10+
if(X86_64)
11+
set(OPENCV_ICV_NAME "ippicv_2017u2_mac_intel64_20170418.tgz")
12+
set(OPENCV_ICV_HASH "0c25953c99dbb499ff502485a9356d8d")
13+
else()
14+
set(OPENCV_ICV_NAME "ippicv_2017u2_mac_ia32_20170418.tgz")
15+
set(OPENCV_ICV_HASH "5f225948f3f64067c681293c098d50d8")
16+
endif()
1217
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
13-
set(OPENCV_ICV_NAME "ippicv_linux_20151201.tgz")
14-
set(OPENCV_ICV_HASH "808b791a6eac9ed78d32a7666804320e")
1518
set(OPENCV_ICV_PLATFORM "linux")
1619
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
20+
if(X86_64)
21+
set(OPENCV_ICV_NAME "ippicv_2017u2_lnx_intel64_20170418.tgz")
22+
set(OPENCV_ICV_HASH "87cbdeb627415d8e4bc811156289fa3a")
23+
else()
24+
set(OPENCV_ICV_NAME "ippicv_2017u2_lnx_ia32_20170406.tgz")
25+
set(OPENCV_ICV_HASH "f2cece00d802d4dea86df52ed095257e")
26+
endif()
1727
elseif(WIN32 AND NOT ARM)
18-
set(OPENCV_ICV_NAME "ippicv_windows_20151201.zip")
19-
set(OPENCV_ICV_HASH "04e81ce5d0e329c3fbc606ae32cad44d")
2028
set(OPENCV_ICV_PLATFORM "windows")
2129
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
30+
if(X86_64)
31+
set(OPENCV_ICV_NAME "ippicv_2017u2_win_intel64_20170418.zip")
32+
set(OPENCV_ICV_HASH "75060a0c662c0800f48995b7e9b085f6")
33+
else()
34+
set(OPENCV_ICV_NAME "ippicv_2017u2_win_ia32_20170418.zip")
35+
set(OPENCV_ICV_HASH "60fcf3ccd9a2ebc9e432ffb5cb91638b")
36+
endif()
2237
else()
2338
return()
2439
endif()

CMakeLists.txt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 O
270270
OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )
271271
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" (WIN32 OR ANDROID OR APPLE) AND NOT WINRT)
272272
OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID )
273+
OCV_OPTION(BUILD_IPP_IW "Build IPP IW from source" NOT MINGW IF (X86_64 OR X86) AND NOT WINRT )
273274

274275
# OpenCV installation options
275276
# ===================================================
@@ -1238,17 +1239,27 @@ status("")
12381239
status(" Other third-party libraries:")
12391240

12401241
if(WITH_IPP AND HAVE_IPP)
1241-
status(" Use IPP:" "${IPP_VERSION_STR} [${IPP_VERSION_MAJOR}.${IPP_VERSION_MINOR}.${IPP_VERSION_BUILD}]")
1242-
status(" at:" "${IPP_ROOT_DIR}")
1242+
status(" Use Intel IPP:" "${IPP_VERSION_STR} [${IPP_VERSION_MAJOR}.${IPP_VERSION_MINOR}.${IPP_VERSION_BUILD}]")
1243+
status(" at:" "${IPP_ROOT_DIR}")
12431244
if(NOT HAVE_IPP_ICV_ONLY)
1244-
status(" linked:" BUILD_WITH_DYNAMIC_IPP THEN "dynamic" ELSE "static")
1245+
status(" linked:" BUILD_WITH_DYNAMIC_IPP THEN "dynamic" ELSE "static")
1246+
endif()
1247+
if(HAVE_IPP_IW)
1248+
if(BUILD_IPP_IW)
1249+
status(" Use Intel IPP IW:" "build (${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE})")
1250+
else()
1251+
status(" Use Intel IPP IW:" "prebuilt binaries (${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE})")
1252+
endif()
1253+
else()
1254+
status(" Use Intel IPP IW:" NO)
12451255
endif()
12461256
else()
1247-
status(" Use IPP:" WITH_IPP AND NOT HAVE_IPP THEN "IPP not found or implicitly disabled" ELSE NO)
1257+
status(" Use Intel IPP:" WITH_IPP AND NOT HAVE_IPP THEN "IPP not found or implicitly disabled" ELSE NO)
1258+
status(" Use Intel IPP IW:" WITH_IPP AND NOT HAVE_IPP AND HAVE_IPP_IW THEN "IPP not found or implicitly disabled" ELSE NO)
12481259
endif()
12491260

12501261
if(DEFINED WITH_IPP_A)
1251-
status(" Use IPP Async:" HAVE_IPP_A THEN "YES" ELSE NO)
1262+
status(" Use Intel IPP Async:" HAVE_IPP_A THEN "YES" ELSE NO)
12521263
endif(DEFINED WITH_IPP_A)
12531264

12541265
if(DEFINED WITH_VA)

cmake/OpenCVFindIPP.cmake

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ unset(IPP_VERSION_MINOR)
3535
unset(IPP_VERSION_BUILD)
3636

3737
if (X86 AND UNIX AND NOT APPLE AND NOT ANDROID AND BUILD_SHARED_LIBS)
38-
message(STATUS "On 32-bit Linux IPP can not currently be used with dynamic libs because of linker errors. Set BUILD_SHARED_LIBS=OFF")
38+
message(STATUS "On 32-bit Linux Intel IPP can not currently be used with dynamic libs because of linker errors. Set BUILD_SHARED_LIBS=OFF")
3939
return()
4040
endif()
4141

@@ -47,14 +47,14 @@ if(CMAKE_CL_64)
4747
set(IPP_X64 1)
4848
endif()
4949

50-
# This function detects IPP version by analyzing .h file
50+
# This function detects Intel IPP version by analyzing .h file
5151
macro(ipp_get_version VERSION_FILE)
5252
unset(_VERSION_STR)
5353
unset(_MAJOR)
5454
unset(_MINOR)
5555
unset(_BUILD)
5656

57-
# read IPP version info from file
57+
# read Intel IPP version info from file
5858
file(STRINGS ${VERSION_FILE} STR1 REGEX "IPP_VERSION_MAJOR")
5959
file(STRINGS ${VERSION_FILE} STR2 REGEX "IPP_VERSION_MINOR")
6060
file(STRINGS ${VERSION_FILE} STR3 REGEX "IPP_VERSION_BUILD")
@@ -96,29 +96,29 @@ macro(ipp_detect_version)
9696
elseif(EXISTS ${IPP_ROOT_DIR}/include/ipp.h)
9797
# nothing
9898
else()
99-
_ipp_not_supported("Can't resolve IPP directory: ${IPP_ROOT_DIR}")
99+
_ipp_not_supported("Can't resolve Intel IPP directory: ${IPP_ROOT_DIR}")
100100
endif()
101101

102102
ipp_get_version(${IPP_INCLUDE_DIRS}/ippversion.h)
103103
ocv_assert(IPP_VERSION_STR VERSION_GREATER "1.0")
104104

105-
message(STATUS "found IPP${__msg}: ${_MAJOR}.${_MINOR}.${_BUILD} [${IPP_VERSION_STR}]")
105+
message(STATUS "found Intel IPP${__msg}: ${_MAJOR}.${_MINOR}.${_BUILD} [${IPP_VERSION_STR}]")
106106
message(STATUS "at: ${IPP_ROOT_DIR}")
107107

108108
if(${IPP_VERSION_STR} VERSION_LESS "7.0")
109-
_ipp_not_supported("IPP ${IPP_VERSION_STR} is not supported")
109+
_ipp_not_supported("Intel IPP ${IPP_VERSION_STR} is not supported")
110110
endif()
111111

112112
set(HAVE_IPP 1)
113113

114114
macro(_ipp_set_library_dir DIR)
115115
if(NOT EXISTS ${DIR})
116-
_ipp_not_supported("IPP library directory not found")
116+
_ipp_not_supported("Intel IPP library directory not found")
117117
endif()
118118
set(IPP_LIBRARY_DIR ${DIR})
119119
endmacro()
120120

121-
if(APPLE)
121+
if(APPLE AND NOT HAVE_IPP_ICV_ONLY)
122122
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib)
123123
elseif(IPP_X64)
124124
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib/intel64)
@@ -127,7 +127,7 @@ macro(ipp_detect_version)
127127
endif()
128128

129129
macro(_ipp_add_library name)
130-
# dynamic linking is only supported for standalone version of IPP
130+
# dynamic linking is only supported for standalone version of Intel IPP
131131
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
132132
if (WIN32)
133133
set(IPP_LIB_PREFIX ${CMAKE_IMPORT_LIBRARY_PREFIX})
@@ -142,7 +142,7 @@ macro(ipp_detect_version)
142142
endif ()
143143
if (EXISTS ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
144144
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
145-
# When using dynamic libraries from standalone IPP it is your responsibility to install those on the target system
145+
# When using dynamic libraries from standalone Intel IPP it is your responsibility to install those on the target system
146146
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
147147
else ()
148148
add_library(ipp${name} STATIC IMPORTED)
@@ -161,33 +161,32 @@ macro(ipp_detect_version)
161161
endif()
162162
endif()
163163
else()
164-
message(STATUS "Can't find IPP library: ${name} at ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}")
164+
message(STATUS "Can't find Intel IPP library: ${name} at ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}")
165165
endif()
166166
endmacro()
167167

168168
set(IPP_PREFIX "ipp")
169169
if(${IPP_VERSION_STR} VERSION_LESS "8.0")
170170
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
171-
set(IPP_SUFFIX "") # dynamic not threaded libs suffix IPP 7.x
171+
set(IPP_SUFFIX "") # dynamic not threaded libs suffix Intel IPP 7.x
172172
else ()
173-
set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x
173+
set(IPP_SUFFIX "_l") # static not threaded libs suffix Intel IPP 7.x
174174
endif ()
175175
else ()
176176
if(WIN32)
177177
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
178-
set(IPP_SUFFIX "") # dynamic not threaded libs suffix IPP 8.x for Windows
178+
set(IPP_SUFFIX "") # dynamic not threaded libs suffix Intel IPP 8.x for Windows
179179
else ()
180-
set(IPP_SUFFIX "mt") # static not threaded libs suffix IPP 8.x for Windows
180+
set(IPP_SUFFIX "mt") # static not threaded libs suffix Intel IPP 8.x for Windows
181181
endif ()
182182
else()
183-
set(IPP_SUFFIX "") # static not threaded libs suffix IPP 8.x for Linux/OS X
183+
set(IPP_SUFFIX "") # static not threaded libs suffix Intel IPP 8.x for Linux/OS X
184184
endif()
185185
endif()
186186

187187
if(HAVE_IPP_ICV_ONLY)
188188
_ipp_add_library(icv)
189189
else()
190-
_ipp_add_library(m)
191190
_ipp_add_library(cv)
192191
_ipp_add_library(i)
193192
_ipp_add_library(cc)
@@ -201,7 +200,7 @@ macro(ipp_detect_version)
201200
get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../compiler/lib REALPATH)
202201
endif()
203202
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR})
204-
_ipp_not_supported("IPP configuration error: can't find Intel compiler library dir ${INTEL_COMPILER_LIBRARY_DIR}")
203+
_ipp_not_supported("Intel IPP configuration error: can't find Intel compiler library dir ${INTEL_COMPILER_LIBRARY_DIR}")
205204
endif()
206205
if(NOT APPLE)
207206
if(IPP_X64)
@@ -231,7 +230,7 @@ macro(ipp_detect_version)
231230
endif()
232231
endif()
233232

234-
#message(STATUS "IPP libs: ${IPP_LIBRARIES}")
233+
#message(STATUS "Intel IPP libs: ${IPP_LIBRARIES}")
235234
endmacro()
236235

237236
# OPENCV_IPP_PATH is an environment variable for internal usage only, do not use it
@@ -240,12 +239,6 @@ if(DEFINED ENV{OPENCV_IPP_PATH} AND NOT DEFINED IPPROOT)
240239
endif()
241240

242241
if(NOT DEFINED IPPROOT)
243-
if(IOS AND NOT x86_64)
244-
# 2016/10: There is an issue with MacOS binary .a file.
245-
# It is fat multiarch library, and can't be "merged" multiple times.
246-
# So try to ignore i386 version
247-
return()
248-
endif()
249242
include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/ippicv.cmake")
250243
download_ippicv(IPPROOT)
251244
if(NOT IPPROOT)
@@ -261,7 +254,7 @@ endif()
261254

262255

263256
if(WIN32 AND MINGW AND NOT IPP_VERSION_MAJOR LESS 7)
264-
# Since IPP built with Microsoft compiler and /GS option
257+
# Since Intel IPP built with Microsoft compiler and /GS option
265258
# ======================================================
266259
# From Windows SDK 7.1
267260
# (usually in "C:\Program Files\Microsoft Visual Studio 10.0\VC\lib"),

0 commit comments

Comments
 (0)