移植opencv-2.4.6到tiny210v2
2013-11-06 17:04
330 查看
环境: ubuntu
交叉编译:arm-linux-gcc
参考:
blog.csdn.net/top_dada/article/details/8183758
一、编译libz
下载:
www.zlib.net/
配置:
./configure --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --shared
修改Makefile:
CC=arm-linux-gcc
LDSHARED=arm-linux-gcc
-shared -wl, -soname,libz.so.1,--version-script,zlib.map
CPP=arm-linux-gcc
-E
AR=arm-linux-ar
RANLIB=arm-linux-ranlib
编译:
make
sudo
make install
二、编译libjpeg
下载:
http://www.ijg.org/
配置:
./configure
--host=arm-linux --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --enable-shared --enable-static
编译:
make
sudo
make install
出错:
arm-linux-ranlib: command not found
解决:
google得是sudo的问题,在make install 之前采用su。几番尝试不行,更改安装目录
新建个目录:
~/arm/libjpeg
./configure --host=arm-linux --prefix=/home/host/arm/libjpeg --enable-shared --enable-static
再make
make install
再复制到/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi
三、编译libpng
下载:
http://sourceforge.net/projects/libpng/files/latest/download?source=files
配置:
./configure --host=arm-linux --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --enable-shared --enable-static
编译make
sudo make install
四、编译yasm
下载:
http://yasm.tortall.net/Download.html
配置:
./configure
--host=arm-linux --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --enable-shared --enable-static
编译make
make install
五、编译libx264
下载:
http://www.videolan.org/developers/x264.html
配置:
./configure
--enable-shared --host=arm-linux --disable-asm --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi
修改config.mak,如下
CC=arm-linux-gcc
LD=arm-linux-gcc
-o
AR=arm-linux-ar
rc
RANLINB=arm-linux-ranlib
修改库位置
编译:
make
sudo
make install
六、编译libxvid
下载:
cd
build/generic
./configure
--prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --host=arm-linux --disable-assembly
make
sudo
make install
七、编译ffmpeg
下载:
git
clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
配置:
./configure
--prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --enable-shared --disable-static --enable-gpl --enable-cross-compile --arch=arm --disable-stripping --target-os=linux --enable-libx264 --enable-libxvid --cc=arm-linux-gcc --enable-swscale
当出现
make
make
install
编译opencv之前安装cmake-gui
八、编译opencv
交叉编译工具链所在目录 /opt/FriendlyARM/toolschain/4.5.1/
安装opencv的目录 /usr/local/
opencv源码所在目录 /home/dongyu/opencv-2.4.6/
编译好的opencv库所在目录 /home/dongyu/opencv-2.4.6/build
#mkdir build
#cd build
#cmake-gui
选择源代码目录/home/dongyu/opencv-2.4.6/
选择Build目录:/home/dongyuopencv-2.4.6/build
点击Configure,保持generator为Unix Makefiles,
选择Specify options for cross-compiling,点击Next,
Operating System填写arm-linux
C Compilers填写/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-gcc
C++ Compilers填写/opt/FriendlyARM/toolschain/4.5.1//bin/arm-linux-g++
程序库的Target Root填写/opt/FriendlyARM/toolschain/4.5.1/
然后点击Finish,点击Configure,产生配置列表,在其中
选择安装目录(CMAKE_INSTALL_PREFIX)为/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi
去掉WITH_CUDA,WITH_TIFF勾选,点击Generate生成Makefile
修改CMakeCache.txt,CMAKE_EXE_LINKER_FLAGS原来为空,加上-lpthread -lrt
#make
出现错误:
../../lib/libopencv_highgui.so: undefined reference to `_TIFFerrorHandler'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFrealloc'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmalloc'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemcpy'
../../lib/libopencv_highgui.so: undefined reference to `TIFFOpen'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFfree'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFwarningHandler'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemcmp'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemset'
CMAKE去掉TIFF支持即可;
#make install
安装完毕
交叉编译:arm-linux-gcc
参考:
blog.csdn.net/top_dada/article/details/8183758
一、编译libz
下载:
www.zlib.net/
配置:
./configure --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --shared
修改Makefile:
CC=arm-linux-gcc
LDSHARED=arm-linux-gcc
-shared -wl, -soname,libz.so.1,--version-script,zlib.map
CPP=arm-linux-gcc
-E
AR=arm-linux-ar
RANLIB=arm-linux-ranlib
编译:
make
sudo
make install
二、编译libjpeg
下载:
http://www.ijg.org/
配置:
./configure
--host=arm-linux --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --enable-shared --enable-static
编译:
make
sudo
make install
出错:
arm-linux-ranlib: command not found
解决:
google得是sudo的问题,在make install 之前采用su。几番尝试不行,更改安装目录
新建个目录:
~/arm/libjpeg
./configure --host=arm-linux --prefix=/home/host/arm/libjpeg --enable-shared --enable-static
再make
make install
再复制到/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi
三、编译libpng
下载:
http://sourceforge.net/projects/libpng/files/latest/download?source=files
配置:
./configure --host=arm-linux --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --enable-shared --enable-static
编译make
sudo make install
四、编译yasm
下载:
http://yasm.tortall.net/Download.html
配置:
./configure
--host=arm-linux --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --enable-shared --enable-static
编译make
make install
五、编译libx264
下载:
http://www.videolan.org/developers/x264.html
配置:
./configure
--enable-shared --host=arm-linux --disable-asm --prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi
修改config.mak,如下
CC=arm-linux-gcc
LD=arm-linux-gcc
-o
AR=arm-linux-ar
rc
RANLINB=arm-linux-ranlib
修改库位置
编译:
make
sudo
make install
六、编译libxvid
下载:
cd
build/generic
./configure
--prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --host=arm-linux --disable-assembly
make
sudo
make install
七、编译ffmpeg
下载:
git
clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
配置:
./configure
--prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi --enable-shared --disable-static --enable-gpl --enable-cross-compile --arch=arm --disable-stripping --target-os=linux --enable-libx264 --enable-libxvid --cc=arm-linux-gcc --enable-swscale
当出现
tmp/ccOmDdh7.s: Assembler messages: /tmp/ccOmDdh7.s:51789: Error: thumb conditional instruction should be in IT block -- `movgt fp,r9' /tmp/ccOmDdh7.s:51790: Error: thumb conditional instruction should be in IT block -- `movgt r9,r8' /tmp/ccOmDdh7.s:51792: Error: thumb conditional instruction should be in IT block -- `movle r9,r7' /tmp/ccOmDdh7.s:51794: Error: thumb conditional instruction should be in IT block -- `movgt fp,r9'
这需要修改~/ffmpeg-0.5.1/config.mak,在OPTFLAGS(line:16)选项中添加:-Wa,-mimplicit-it=thumb
make
make
install
编译opencv之前安装cmake-gui
八、编译opencv
交叉编译工具链所在目录 /opt/FriendlyARM/toolschain/4.5.1/
安装opencv的目录 /usr/local/
opencv源码所在目录 /home/dongyu/opencv-2.4.6/
编译好的opencv库所在目录 /home/dongyu/opencv-2.4.6/build
#mkdir build
#cd build
#cmake-gui
选择源代码目录/home/dongyu/opencv-2.4.6/
选择Build目录:/home/dongyuopencv-2.4.6/build
点击Configure,保持generator为Unix Makefiles,
选择Specify options for cross-compiling,点击Next,
Operating System填写arm-linux
C Compilers填写/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-gcc
C++ Compilers填写/opt/FriendlyARM/toolschain/4.5.1//bin/arm-linux-g++
程序库的Target Root填写/opt/FriendlyARM/toolschain/4.5.1/
然后点击Finish,点击Configure,产生配置列表,在其中
选择安装目录(CMAKE_INSTALL_PREFIX)为/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi
去掉WITH_CUDA,WITH_TIFF勾选,点击Generate生成Makefile
修改CMakeCache.txt,CMAKE_EXE_LINKER_FLAGS原来为空,加上-lpthread -lrt
#make
出现错误:
../../lib/libopencv_highgui.so: undefined reference to `_TIFFerrorHandler'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFrealloc'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmalloc'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemcpy'
../../lib/libopencv_highgui.so: undefined reference to `TIFFOpen'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFfree'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFwarningHandler'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemcmp'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemset'
CMAKE去掉TIFF支持即可;
#make install
安装完毕
相关文章推荐
- 移植opencv-2.4.6到tiny210v2
- 基于Ubuntu14.04环境下编译qt-everywhere-opensource-src-5.6.1配置qt creater 的arm编译器环境并移植到tiny210v2开发板上
- 基于tiny210v2的linux-3.9.6内核驱动移植4:PWM移植
- 移植linux-3.9内核到tiny210v2
- 基于tiny210v2的linux-3.9.6内核驱动移植1:led驱动
- 基于tiny210v2的linux-3.9.6内核驱动移植2:按键驱动
- 基于tiny210v2的linux-3.9.6内核驱动移植3:LCD移植
- 移植u-boot-2012-10到tiny210v2(一)-----基本芯片介绍和启动流程介绍
- 交叉编译OpenCV2.2.0及移植到Tiny210
- opencv2.4.2移植到tiny6410
- 【OpenCV移植系列】01:OpenCV简介
- opencv2.4.9移植迅为4412开发板文档
- FatFs之tiny FatFs移植
- 最新OpenCV2.4.6与VS2010开发环境搭建
- ubuntu12.04交叉编译opencv移植到arm板
- Linux下移植OpenCV + Qt 到ARM(Tiny6410)总结 转
- opencv2.0在arm上的移植
- tiny210(s5pv210)移植u-boot(基于 2014.4 版本)——NAND 启动
- S5pv210移植opencv
- opencv在hisi3516上的移植总结