1 | Hello there,
|
2 | Im doing some efforts on compiling OpenCV 2.0 on an OMAP-Plattform which consists of a DSP and an ARM9 processor. I previously succeeded with the OpenCV1.1pre version of the library but had to apply some minor changes.
|
3 |
|
4 | Im using the CodeSourcery (09Q3lite) compiler to cross-compile the library for the host platform. The platform prefix is arm-none-eabi and therefore has no linux system beneath. The compiling environment is cygwin.
|
5 |
|
6 | Im using the following configure script to build the library:
|
7 |
|
8 | export DEVROOT=/cygdrive/c/devtools/CodeSourcery09Q3lite
|
9 | export APP_PREFIX=arm-none-eabi
|
10 | export GCC_HOST=i686-pc-linux-gnu
|
11 | export OFLAGS=-O2
|
12 | export PATH=$DEVROOT/bin:$PATH
|
13 | export CYGPATH=cygpath
|
14 |
|
15 | ./configure \
|
16 | --host=$APP_PREFIX \
|
17 | --build=$GCC_HOST \
|
18 | --disable-shared \
|
19 | --enable-static \
|
20 | --without-imageio --without-carbon \
|
21 | --without-quicktime --without-python \
|
22 | --without-gtk --without-swig \
|
23 | --without-v4l \
|
24 | --disable-apps \
|
25 | --prefix=$DEVROOT/$APP_PREFIX \
|
26 | CC=$DEVROOT/bin/$APP_PREFIX-gcc \
|
27 | CXXFLAGS="-ftree-vectorize -ftree-vectorizer-verbose=5 -mfpu=neon -mfloat-abi=softfp -fsigned-char $OFLAGS -pipe" \
|
28 | LD=$DEVROOT/bin/$APP_PREFIX-ld \
|
29 | CPP=$DEVROOT/bin/$APP_PREFIX-cpp \
|
30 | CXXCPP=$DEVROOT/bin/$APP_PREFIX-cpp \
|
31 | CXX=$DEVROOT/bin/$APP_PREFIX-g++ \
|
32 | AR=$DEVROOT/bin/$APP_PREFIX-ar \
|
33 | RANLIB=$DEVROOT/bin/$APP_PREFIX-ranlib \
|
34 | NM=$DEVROOT/bin/$APP_PREFIX-nm \
|
35 | STRIP=$DEVROOT/bin/$APP_PREFIX-strip \
|
36 | AS=$DEVROOT/bin/$APP_PREFIX-as
|
37 |
|
38 | This has worked pretty well for the 1.1pre-release but results in major errors on version 2.0. The errors seam to come from system signals such as _kill and _abort. The CodeSourcey-gcc has the possibility to skip those signals and insert stubs. Therefore I had to add -T generic.ld to the CXX flags.
|
39 |
|
40 | CXXFLAGS="-g3 -T generic.ld -ftree-vectorize -ftree-vectorizer-verbose=5 -mfpu=neon -mfloat-abi=softfp -fsigned-char $OFLAGS -pipe" \
|
41 |
|
42 | This will configure version 2.0 successfully but here the problems start getting nasty. The first thing that pops up is the log2()-function in /cxcore/cxdxt.cpp. This specific function obviously collides with the name of a function that is defined by the gcc! Simply renaming it to log_2() on three positions inside the file solves the problem. Maybe you can rename this function in another revision so this wont happen anymore.
|
43 |
|
44 | But there is more, because obviously your naming convention of local variables collides with some gcc macros. Its maybe easiest to show you an example.
|
45 |
|
46 | The /cxcore/cxlapack.cpp defines at line 759 a Mat _S. The convention to write variables with underscore and one following upper case letter seems to result in problems with the CodeSourcery cross-compiler. By simply renaming the variable from _S to mat_S the problem is solved for this file. Unluckily one faces this problem in many more cases, i.e. in /cxcore/cxmatmul.cpp. There are three variables _A, _B, _C that fit the same profile. To solve problems like this, maybe you could discuss about changing your naming conventions, so that underscore-upper-case-letter-variables wont be allowed anymore.
|
47 |
|
48 | I will go on trying to compile the library with the CodeSourcery gcc and let you know about my findings. To get this easier for you, Ill post the naming collisions and other errors to the TRAC bug report.
|
49 |
|
50 | If someone knows how to get rid of these errors without editing the source files Id appreciate any hint!
|
51 |
|
52 | Greetings from Germany
|
53 | Matthias
|
54 |
|
55 |
|
56 |
|