.../opencv/modules/core/src/glob.cpp will not compile (Bug #3256)
Description
I am not sure if it is a bug in the RubyInstaller DevKit, GCC, or OpenCv.
I have installed DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
it supplies the following compiler,
D:\usr\opencv\release>gcc --version gcc (rubenvb-4.7.2-release) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I have an up to date source of OpenCV as of 5/09/2013 9:40:51.
After running cmake and make, the process gets as far as compiling glob.cpp in core.
the first working lines in glob.cpp are
#include "precomp.hpp" #if defined WIN32 || defined _WIN32 || defined WINCE # include <windows.h>
precomp.hpp includes emmintrin.h via cvdef.h with the following code,
#if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2) # include <emmintrin.h>
However windows.h includes intrin.h via winnt.h
These two files include the same function definitions, however one does it with C linkage and the other does it with C++ linkage.
To get glob.cpp compiled I commented out emmintrin.h. It did compile, but I can not help feeling that I cheated.
Associated revisions
Merge pull request #3256 from vbystricky:oclopt_BFMatcher
History
Updated by Alexander Smorkalov over 11 years ago
- Assignee changed from Vadim Pisarevsky to Alexander Smorkalov
Updated by Alexander Smorkalov over 11 years ago
- Priority changed from Blocker to Normal
- Target version set to 3.0
Updated by Phillip Shelton over 11 years ago
The solution will look something like the following.
cvdef.h will need the following addition
#if defined SSE2 || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2)
+ #if defined WINDOWS_USES_INTRIN
+ #include <intrin.h>
+ #else
#include <emmintrin.h>
+ #endif
then in the configure stage cmake will have to determine which of intrin.h or emmintrin.h, windows.h includes and set WINDOWS_USES_INTRIN accordingly.
Updated by Vladislav Vinogradov over 11 years ago
- Description changed from I am not sure if it is a bug in the RubyInstaller DevKit, GCC, or OpenCv. I ... to I am not sure if it is a bug in the RubyInstaller DevKit, GCC, or OpenCv. I ... More
Updated by Anna Kogan over 11 years ago
- Affected version changed from branch 'master' (2.9) to branch '2.4' (2.4-dev)
- Status changed from New to Open
Updated by Anna Kogan over 11 years ago
- Affected version changed from branch '2.4' (2.4-dev) to branch 'master' (3.0-dev)
Updated by Alexander Smorkalov over 11 years ago
I do not find any forcing to C or C++ language in OpenCV code, so it looks like a compiler issue. I cancel the ticket.
- Status changed from Open to Cancelled