OpenCV 2.2 CrossCompilation for ARM – fixes (Bug #842)
Description
Hello there,
A few days ago we tried to compile the newest OpenCV release (2.2) for our OMAP cpu using the CodeSourcery g++ compiler. There are, again, a few issues that need to be solved in order to guarantee compilation of OpenCV without any troubles.
First of all, the number of “errors” has been greatly diminished since the last few releases. It’s quite nice to see, that our comments are regarded useful by you folks!
Since were not completely through with the cross compilation for the ARM processor using our g++ CodeSourcery compiler the following fixes aren’t complete. Since we aren’t using a unix- or windows-like system, most of the errors seem to come from platform dependencies.
- /include/opencv2/core/internal.hpp
- #include <sys/mman.h> can not be found: we had to remove this
line since this header could not be found. The removal had no
effect – it seems that this header isn’t needed at all. - define of ‘expl’ is missing in /modules/ml/src/gbt.cpp
- at line 14-16 we had to remove the #if ANDROID flag in order to
use #define expl(x) exp(x). - /modules/core/src/rand.cpp: issues with pthread
- This was actual already a problem in previous version of
OpenCV, but we did never commit the “bug”. From line 634-668 we
had to remove the functionality since this won’t work on our
system. We inserted a new define NO_OS that switches between
implementations.
1#ifdef NO_OS
2RNG& theRNG()
3{
4 CV_Assert(FALSE); // runtime stop if this one is really used! psa
5 RNG* rng = NULL;
6 return *rng;
7}
8#else
9static pthread_key_t tlsRNGKey = 0;
10
11static void deleteRNG(void* data)
12{
13 delete (RNG*)data;
14}
15
16RNG& theRNG()
17{
18 if( !tlsRNGKey )
19 {
20 int errcode = pthread_key_create(&tlsRNGKey, deleteRNG);
21 CV_Assert(errcode == 0);
22 }
23 RNG* rng = (RNG*)pthread_getspecific(tlsRNGKey);
24 if( !rng )
25 {
26 rng = new RNG;
27 pthread_setspecific(tlsRNGKey, rng);
28 }
29 return *rng;
30}
31#endif
There are a few more issues that need addressing, but at the moment, the ones above are the most important.
Regards
Matthias
Associated revisions
#842 #include <sys/mman.h> is moved from public headers closer to usage
History
Updated by Vadim Pisarevsky over 13 years ago
Are the bugs are now fixed/obsolete?
- Status deleted (
Open)
Updated by Andrey Kamaev over 13 years ago
Actually this ticked is not related to Android platform. It is about compatibility of OpenCV with non-unix like and non-windows like systems. So I'm not responsible for making a decision whether suggested changes are good for OpenCV.
By the way CodeSourcery g++ compiler for unix-like systems is able to compile OpenCV with only single change - it has no clock_gettime function used in getTickCount (switching to gettimeofday branch inside getTickCount implementation solves the problem)
Updated by Alexander Shishkov about 13 years ago
- Description changed from Hello there, A few days ago we tried to compile the newest [[OpenCV]] releas... to Hello there, A few days ago we tried to compile the newest OpenCV release (2... More
Updated by Alexander Shishkov almost 13 years ago
- Target version deleted ()
Updated by Alexander Shishkov almost 13 years ago
- Status set to Open
Updated by Alexander Shishkov almost 13 years ago
- Priority changed from Normal to Low
Updated by Alexander Shishkov almost 13 years ago
- Assignee deleted (
Vadim Pisarevsky)
Updated by Andrey Kamaev almost 13 years ago
1. Fixed in r7673
2. Fixed in r4302
3. Need mode details about pthreads implementation because theRNG()
function is really used in many parts of the library and can not be simply turned off.
- Status changed from Open to Done
- Description changed from Hello there, A few days ago we tried to compile the newest OpenCV release (2... to Hello there, A few days ago we tried to compile the newest OpenCV release (2... More
- Assignee set to Andrey Kamaev
Updated by Alexander Shishkov almost 13 years ago
- Target version set to 2.4.0