linux zynq opencv 2.4.9 交叉编译

1、新建目录 opencv-arm

2、cd opencv-arm

3、gedit toolchain.cmake

set(CMAKE_SYSTEM_NAME Linux)

set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_C_COMPILER arm-xilinx-linux-gnueabi-gcc)

set(CMAKE_CXX_COMPILER arm-xilinx-linux-gnueabi-gc++)

set(CMAKE_FIND_ROOT_PATH ~/targetfs)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

4、运行 cmake -DCMAKE-TOOLCHAIN-FILE=toolchain.cmake ../opencv-2.4.9  (后为opencv路径,且opencv应为刚解压后的干净源码)

5、cmake-gui

6、source code ->源码目录

     build binarie ->opencv-arm

7、configure ->unix makefiles

                       specify options for cross-compiling

8、next -> operation system  arm-linux

                 version                    2.4.9

               compilers              C 交叉编译工具路径/bin/gcc

               compilers              C ++交叉编译工具路径/bin/g++

              find  target root     交叉编译工具路径

9、configure 

根据具体选项进行配置,注意安装路径与板子上运行挂载路径一致,不选build_openexr build opencv_ocl with openexr with_opencl gtk ffmpeg

10、generate

11、修改cmakecache.txt

CMAKE_EXE_LINKER_FLAGS=-lpthread -lrt -lm

12、make

13、sudo make install    

你可能感兴趣的:(linux zynq opencv 2.4.9 交叉编译)