C++ How can I build opencv for vs 2015 x86 - c++

I want to use opencv in my VS2015 C++ project and I need it exactly for x86 platform, not x64.
I used CMake as advised everywhere in the internet. What is more I tried to configure several versions of opencv - 2.4.9; 3.0.0; 3.1.0
And on each configuring and generating through CMake I get a lot of errors.
Here's a log from CMake gui after configuring:
CMake Deprecation Warning at CMakeLists.txt:69 (cmake_policy):
The OLD behavior for policy CMP0022 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at CMakeLists.txt:74 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
The CXX compiler identification is MSVC 19.0.23506.0
The C compiler identification is MSVC 19.0.23506.0
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Performing Test HAVE_CXX_FSIGNED_CHAR
Performing Test HAVE_CXX_FSIGNED_CHAR - Failed
Performing Test HAVE_C_FSIGNED_CHAR
Performing Test HAVE_C_FSIGNED_CHAR - Failed
Check if the system is big endian
Searching 16 bit integer
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of unsigned short
Check size of unsigned short - done
Using unsigned short
Check if the system is big endian - little endian
Looking for fseeko
Looking for fseeko - not found
Looking for unistd.h
Looking for unistd.h - not found
Check size of off64_t
Check size of off64_t - failed
Looking for assert.h
Looking for assert.h - found
Looking for fcntl.h
Looking for fcntl.h - found
Looking for io.h
Looking for io.h - found
Looking for jbg_newlen
Looking for jbg_newlen - not found
Looking for mmap
Looking for mmap - not found
Looking for search.h
Looking for search.h - found
Looking for string.h
Looking for string.h - found
Looking for unistd.h
Looking for unistd.h - not found
CMake Warning at 3rdparty/ippicv/downloader.cmake:54 (message):
ICV: Local copy of ICV package has invalid MD5 hash:
d41d8cd98f00b204e9800998ecf8427e (expected:
b59f865d1ba16e8c84124e19d78eec57)
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
ICV: Downloading ippicv_windows_20141027.zip...
CMake Error at 3rdparty/ippicv/downloader.cmake:71 (file):
file DOWNLOAD HASH mismatch
for file: [D:/opencv-3.0/opencv/sources/3rdparty/ippicv/downloads/windows-b59f865d1ba16e8c84124e19d78eec57/ippicv_windows_20141027.zip]
expected hash: [b59f865d1ba16e8c84124e19d78eec57]
actual hash: [d41d8cd98f00b204e9800998ecf8427e]
status: [6;"Couldn't resolve host name"]
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
CMake Error at 3rdparty/ippicv/downloader.cmake:75 (message):
ICV: Failed to download ICV package: ippicv_windows_20141027.zip.
Status=6;"Couldn't resolve host name"
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
Configuring incomplete, errors occurred!
See also "D:/opencv-build/CMakeFiles/CMakeOutput.log".
See also "D:/opencv-build/CMakeFiles/CMakeError.log".
And this log is after generating:
CMake Deprecation Warning at CMakeLists.txt:69 (cmake_policy):
The OLD behavior for policy CMP0022 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at CMakeLists.txt:74 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Warning at 3rdparty/ippicv/downloader.cmake:54 (message):
ICV: Local copy of ICV package has invalid MD5 hash:
d41d8cd98f00b204e9800998ecf8427e (expected:
b59f865d1ba16e8c84124e19d78eec57)
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
ICV: Downloading ippicv_windows_20141027.zip...
CMake Error at 3rdparty/ippicv/downloader.cmake:71 (file):
file DOWNLOAD HASH mismatch
for file: [D:/opencv-3.0/opencv/sources/3rdparty/ippicv/downloads/windows-b59f865d1ba16e8c84124e19d78eec57/ippicv_windows_20141027.zip]
expected hash: [b59f865d1ba16e8c84124e19d78eec57]
actual hash: [d41d8cd98f00b204e9800998ecf8427e]
status: [6;"Couldn't resolve host name"]
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
CMake Error at 3rdparty/ippicv/downloader.cmake:75 (message):
ICV: Failed to download ICV package: ippicv_windows_20141027.zip.
Status=6;"Couldn't resolve host name"
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
Configuring incomplete, errors occurred!
See also "D:/opencv-build/CMakeFiles/CMakeOutput.log".
See also "D:/opencv-build/CMakeFiles/CMakeError.log".
Both CMakeOutput.log and CMakeError.log are not readable. They are full of unreadable characters.
How can I get this vc14 x86 version of opencv!?
I'm stuck.

In OpenCVConfig.cmake,
if(MSVC)
message("CMAKE_CL_64 is ${CMAKE_CL_64}")
if(CMAKE_CL_64)
set(OpenCV_ARCH x64)
elseif((CMAKE_GENERATOR MATCHES "ARM") OR ("${arch_hint}" STREQUAL "ARM") OR (CMAKE_VS_EFFECTIVE_PLATFORMS MATCHES "ARM|arm"))
# see Modules/CmakeGenericSystem.cmake
set(OpenCV_ARCH ARM)
else()
set(OpenCV_ARCH x86)
endif()

Related

"TBB library cannot be found" CMake on MacOS

I'm trying to build PrusaSlicer from source on Mac. I don't have any experience with CMake. I'm following the instructions given here.
Every time I try to build dependencies. This command cmake ..gives me errors. Earlier it was saying "Boost cannot be found." I fixed that by installing boost with brew. Now it's stuck on TBB.
OS X SDK Path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk
OS X Deployment Target: (default)
-- Boost::boost exists
CMake Error at /opt/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
TBB library cannot be found. Consider set TBBROOT environment variable.
(missing: TBB_LIBRARIES) (found version "2020.3")
Call Stack (most recent call first):
/opt/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindTBB.cmake.in:286 (find_package_handle_standard_args)
cmake/modules/FindTBB.cmake:29 (include)
CMakeLists.txt:384 (find_package)
-- Configuring incomplete, errors occurred!
I have installed TBB. If you would notice even this error has the version listed.
Things I have tried:
Installing boost, cmake and tbb via brew.
Installing boost, cmake and tbb via macports.
Try the following
cmake .. -DTBB_LIBRARYDIR=/opt/intel/tbb/lib/intel64/gcc4.8 -DTBB_INCLUDEDIR=/opt/intel/tbb/include
Note the subtle differences in the CMake var names and the path to include, not include/tbb.Let me know how that goes

Drake cmake Could NOT find Gurobi

I use ubuntu 20.04 and I trying install Drake software.
I have got error while making with cmake cmake -DWITH_GUROBI=ON -DWITH_MOSEK=ON ../drake:
CMake Error at cmake/modules/FindGurobi.cmake:13 (file):
file STRINGS file
"/home/dmitriy/git/drake/Gurobi_INCLUDE_DIR-NOTFOUND/gurobi_c.h" cannot be
read.
Call Stack (most recent call first):
CMakeLists.txt:450 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Gurobi: Found unsuitable version ".;.", but required is
exact version "9.5.1" (found Gurobi_INCLUDE_DIR-NOTFOUND)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:391 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindGurobi.cmake:52 (find_package_handle_standard_args)
CMakeLists.txt:450 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/dmitriy/git/drake-build/CMakeFiles/CMakeOutput.log".
I installed Gurobi and error dosappeared.

Yotta build results in CMake Deprecation Warning, cmake-policies OLD behaviours

I am trying to build the code that is already made as examples for the Micro:bit using the recommended yotta build but after following every step I am getting this error:
yotta build
info: generate for target: bbc-microbit-classic-gcc 0.2.3 at /home/dragos/microbit-samples/yotta_targets/bbc-microbit-classic-gcc
CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
The OLD behavior for policy CMP0017 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at /usr/share/cmake-3.16/Modules/CMakeForceCompiler.cmake:75 (message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
/home/dragos/microbit-samples/yotta_targets/mbed-gcc/CMake/toolchain.cmake:78 (cmake_force_c_compiler)
toolchain.cmake:8 (include)
CMakeFiles/3.16.3/CMakeSystem.cmake:6 (include)
CMakeLists.txt:76 (project)
CMake Deprecation Warning at /usr/share/cmake-3.16/Modules/CMakeForceCompiler.cmake:89 (message):
The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set
CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
/home/dragos/microbit-samples/yotta_targets/mbed-gcc/CMake/toolchain.cmake:79 (cmake_force_cxx_compiler)
toolchain.cmake:8 (include)
CMakeFiles/3.16.3/CMakeSystem.cmake:6 (include)
CMakeLists.txt:76 (project)
I have to specify that I did not change any code from the initial git: lancaster-university /
microbit-samples and I have done the update on my system several times. Also, I am running it on Ubuntu 20.04.1 LTS

Could NOT find MPI_C and MPI cmake on Ubuntu 18.04

- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'libusb-1.0>=1.0.17'
-- Found libusb-1.0, version 1.0.21
-- Checking for module 'opencv>=3.0'
-- Found opencv, version 3.2.0
-- Checking for module 'libcaer>=2.0'
-- Found libcaer, version 3.3.7
-- Could NOT find MPI_C (missing: MPI_C_WORKS)
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1")
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find MPI (missing: MPI_C_FOUND) (found version "3.1")
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindMPI.cmake:1444 (find_package_handle_standard_args)
CMakeLists.txt:193 (find_package)
Tried everything exported the paths done everything I've found on google still have this annoying error.
Reading package lists... Done
Building dependency tree
Reading state information... Done
cmake is already the newest version (3.10.2-1ubuntu2.18.04.1).
Which command results:
endrel#Siraly:~/Developer/BrainHarmonics/build$ which mpicc
/usr/bin/mpicc
endrel#Siraly:~/Developer/BrainHarmonics/build$ which mpicxx
/usr/bin/mpicxx
From FindMPI.cmake module:
If the find procedure fails for a variable MPI_<lang>_WORKS, then the settings detected by or passed to the module did not work and even a simple MPI test program failed to compile.
-- Could NOT find MPI_C (missing: MPI_C_WORKS)
Your mpicc is found but probably not working correctly.
Maybe your CMakeLists.txt is wrong, but you didn't provide it's content, so it's hard to say.

CMake Error: Could NOT find CryptoPP during Artery installation

I'm looking for solution to resolve the problems below. The error messages are generated during Vanetza installation of Artery ITS-G5 V2X system on Window OS.
Platform and tools are:
Window 10
MinGw-7.3.0
CMake-3.13.0-rc1
Boost 1.68
Crypto++ -7.0.0
The error message:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find CryptoPP (missing: CryptoPP_INCLUDE_DIR CryptoPP_LIBRARY)
(Required is at least version "5.6.1")
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/FindCryptoPP.cmake:11 (find_package_handle_standard_args)
CMakeLists.txt:77 (find_package)
Though I have searched much information related, I could not find the proper solution.
I need your help. Thanks a lot in advance.