Compiling opencv1.0 with DaVinci toolchain

Source: Internet
Author: User

[Root @ localhost filecopy_dec] # arm_v5t_le-gcc-V
Reading specs from/opt/mv_pro_4.0/montavista/Pro/devkit/ARM/v5t_le/bin/../lib/GCC/armv5tl-montavista-linuxeabi/3.4.3/specs
Configured :.. /configure -- Host = i686-pc-linux-gnu -- target = armv5tl-montavista-linuxeabi -- prefix =/opt/montavista/Foundation/devkit/ARM/v5t_le -- Exec-Prefix =/opt/montavista/Foundation/devkit/ARM /v5t_le -- bindir =/opt/montavista/Foundation/devkit/ARM/v5t_le/bin
-- Sbindir =/opt/montavista/Foundation/devkit/ARM/v5t_le/sbin -- sysconfdir =/opt/montavista/Foundation/devkit/ARM/v5t_le/etc -- datadir =/opt/ montavista/Foundation/devkit/ARM/v5t_le/share -- includedir =/opt/montavista/Foundation/devkit/ARM/v5t_le/include -- libdir =/opt/montavista/Foundation/devkit/ ARM/v5t_le/lib
-- Libexecdir =/opt/montavista/Foundation/devkit/ARM/v5t_le/libexec -- localstatedir =/opt/montavista/Foundation/devkit/ARM/v5t_le/var -- sharedstatedir =/opt/ montavista/Foundation/devkit/ARM/v5t_le/share -- Mandir =/opt/montavista/Foundation/devkit/ARM/v5t_le/man
-- Infodir =/opt/montavista/Foundation/devkit/ARM/v5t_le/info -- Build = i686-pc-linux-gnu -- Program-transform-name = s, ^, arm_v5t_le -, -- enable-cross -- With-sysroot =/opt/montavista/Foundation/devkit/ARM/v5t_le/target -- enable-shared -- enable-ages = C, c ++ -- enable-_ cxa_atexit
-- Enable-threads = POSIX -- disable-multilib -- With-gxx-include-Dir =$ {prefix}/lib/GCC/armv5tl-montavista-linuxeabi/3.4.3 /.. /.. /.. /.. /target/usr/include/C ++/3.4.3 -- With-NUMA-policy = yes -- With-float = soft -- With-CPU = arm10tdmi -- With-interwork -- With-arch = armv5t
-- With-tune = arm10tdmi -- libexecdir =/opt/montavista/Foundation/devkit/ARM/v5t_le/lib
Thread model: POSIX

GCC version 3.4.3 (FIG)


#### 1
Using arm_v5t_le-g ++ to compile opencv 1.0
Cvpyrsegmentation. cpp: In function 'cvstatus icvpyrsegmentation8uc3r (uchar *, Int, uchar *, Int, cvsize, cvfilter, cvseq **, cvmemstorage *, Int, Int, INT )':
Cvpyrsegmentation. cpp: 1021: Internal compiler error: In verify_local_live_at_start, at flow. C: 546
Please submit a full bug report,
With preprocessed source if appropriate.
Send email to montavista software, Inc. for instructions.

Http://article.gmane.org/gmane.linux.davinci/6544

Follow the prompts on this page to delete the content of the icvpyrsegmentation8uc3r function, directly return cv_ OK, and then compile


#### 2
Modify the/cxcore/include/cxtype. h file before configuration compilation. The arm is different from the x86 size end without modification. During some operations that call the cvround function, a black screen will appear.
Cv64suf temp;
Temp. f = value + 6755399441055744.0;
Return (INT) temp. U;
Change the return value to: Return (INT) (Value + 0.5)


#### 3
Cross-compilation specifies -- Host = arm-Linux, but the platform used by DaVinci is arm_v5t_le-
Reference http://www.61ic.com/Article/DaVinci/TMS320DM3x/201104/33721.html
Modify/autotools/config. sub
| Arc | arm | Arm [BL] E | Arme [LB] | armv [2345] | armv [345] [LB] | AVR | arm_v5t_le \
Add arm_v5t_le
However, some packages include config. sub does not include this option. Try to use -- Host = arm-Linux directly. It can be used only if it cannot be changed. It may only cause problems and find the wrong library.


#### 4
The following error message indicates that the PNG and JPEG libraries are missing. Follow the prompts provided at the following URL to install the two libraries. Then, opencv can be compiled smoothly. You can change the corresponding path as needed.

Http://apps.hi.baidu.com/share/detail/30991378

Install the PNG Library. This is used to display PNG images. Many images in MiniGUI are PNG. Without this library, your MiniGUI will not work properly. Remember to remember!

Http://prdownloads.sourceforge.net/libpng/libpng-1.2.18.tar.bz2? Download (PNG Library)

In other words, do not use the latest database. The latest database may be faulty. If you use this old database, it will be okay.

[Root] # tar zxf libpng-1.2.18 .tar.gz
[Root] # libpng-1.2.18 CD
[Root] #. /configure cc = arm-Linux-GCC -- Build = i686-pc-linux -- target = arm-Linux -- Host = arm-Linux prefix =/usr/local/ARM/3.4.1/ARM-Linux
Note the configuration here: ① use the cross compiler ② installation directory ③-host specifies that the software will run the platform, otherwise the terminal
You will also be prompted to use the-host parameter.
# Make
# Make install
After installation, check whether LibPNG. A exists in the Lib folder in the/usr/local/ARM/3.4.1/ARM-Linux/directory,
Whether PNG. H, pngconf. H, and libpng12 files exist in files such as LibPNG. So and the include folder.

Step 3: Install the JPEG Library
Download To/root/Cross/In http://download.enet.com.cn/html/242232006010901.html (JPEG Library)
# Jpeg-6b/CD/root/Cross/
#. /Configure cc = arm-Linux-GCC -- Build = i686-pc-linux -- target = arm-Linux -- Host = arm-Linux prefix =/usr/local/ARM/3.4.1/ARM-Linux -- enable-shared
Note before make: Copy libtool from the source code directory of the previous libpng-1.2.18, put
/Home/source/MiniGUI/jpeg-6b directory, otherwise the "Make:./libtool: Command not found" error may occur.
In addition, you must note that the libtool of the system cannot be used, because cross-compilation is required here.
# Make
Create a directory. Otherwise, an error will be reported during make install.
# Mkdir-P/usr/local/ARM/3.4.1/ARM-Linux/man/Man1
# Make install
After installation, check whether libjpeg. So exists in the Lib folder in the/usr/local/ARM/3.4.1/ARM-Linux/directory,
Libjpeg. so.62.0.0 and other files are included in the include folder.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.