Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To be more specific, I'm using linaro toolchain. I used NFS to mount target machine /usr and /lib to my host machine /opt/Hackberryfs/usr and /opt/Hackberry/lib.

Progress I made so far: I can run cmake to find out all 3rd party library installed in my target machine except python.

Here is steps I did:

  1. Modify OpenCV-2.4.3/cmake/OpenCVFindPkgConfig.cmake ... find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin DOC "pkg-config executable" NO_CMAKE_FIND_ROOT_PATH)

  2. Change pkg-config env variables: export SYSROOT=/opt/Hackberryfs export PKG_CONFIG_SYSROOT_DIR=${SYSROOT} export PKG_CONFIG_PATH=${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/local/lib/pkgconfig:${SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${SYSROOT}/usr/share/pkgconfig

  3. Use the following toolchain.cmake set( CMAKE_SYSTEM_NAME Linux ) set( CMAKE_SYSTEM_PROCESSOR arm ) set( CMAKE_C_COMPILER /opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc ) set( CMAKE_CXX_COMPILER /opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ ) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH /opt/Hackberryfs /opt/Hackberryfs/usr/local/lib )

  4. Disable python support when running ccmake.

Conclusion: 1. I looked into OpenCV-2.4.3/cmake/OpenCVDetectPython.cmake. It doesn't make sense to me that it tried to find host machine python. I'm not so sure how it works.

  1. I got linking error when compiling OpenCV. I looked into issues. It can't find target rule for libz.so. I'm scratching my head to take a look into build.cmake file. But auto-generated file from CMake is way too complicated to debug.

It is a pain in the ass to do cross compile. It already wasted me two days to figure out how cmake. For now, I'd live with arm board to do native compiling. I'm done with it.

To be more specific, I'm using linaro toolchain. I used NFS to mount target machine /usr and /lib to my host machine /opt/Hackberryfs/usr and /opt/Hackberry/lib.

Progress I made so far: I can run cmake to find out all 3rd party library installed in my target machine except python.

Here is steps I did:

  1. Modify OpenCV-2.4.3/cmake/OpenCVFindPkgConfig.cmake ... find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin DOC "pkg-config executable" NO_CMAKE_FIND_ROOT_PATH)

  2. Change pkg-config env variables: export SYSROOT=/opt/Hackberryfs export PKG_CONFIG_SYSROOT_DIR=${SYSROOT} export PKG_CONFIG_PATH=${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/local/lib/pkgconfig:${SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${SYSROOT}/usr/share/pkgconfig

  3. Use the following toolchain.cmake set( CMAKE_SYSTEM_NAME Linux ) set( CMAKE_SYSTEM_PROCESSOR arm ) set( CMAKE_C_COMPILER /opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc ) set( CMAKE_CXX_COMPILER /opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ ) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH /opt/Hackberryfs /opt/Hackberryfs/usr/local/lib )

  4. Disable python support when running ccmake.

Conclusion: 1. Conclusion:

  1. I looked into OpenCV-2.4.3/cmake/OpenCVDetectPython.cmake. It doesn't make sense to me that it tried to find host machine python. I'm not so sure how it works.

    1. I got linking error when compiling OpenCV. I looked into issues. It can't find target rule for libz.so. I'm scratching my head to take a look into build.cmake file. But auto-generated file from CMake is way too complicated to debug.

    It is a pain in the ass to do cross compile. It already wasted me two days to figure out how cmake. For now, I'd live with arm board to do native compiling. I'm done with it.

To be more specific, I'm using linaro toolchain. I used NFS to mount target machine /usr and /lib to my host machine /opt/Hackberryfs/usr and /opt/Hackberry/lib.

Progress I made so far: I can run cmake to find out all 3rd party library installed in my target machine except python.

Here is steps I did:

  1. Modify OpenCV-2.4.3/cmake/OpenCVFindPkgConfig.cmake ... find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin DOC "pkg-config executable" NO_CMAKE_FIND_ROOT_PATH)

  2. Change pkg-config env variables: variables:

export SYSROOT=/opt/Hackberryfs SYSROOT=/opt/Hackberryfs

export PKG_CONFIG_SYSROOT_DIR=${SYSROOT} PKG_CONFIG_SYSROOT_DIR=${SYSROOT}

export PKG_CONFIG_PATH=${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/local/lib/pkgconfig:${SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${SYSROOT}/usr/share/pkgconfig

  1. Use the following toolchain.cmake set( CMAKE_SYSTEM_NAME Linux ) toolchain.cmake

    set( CMAKE_SYSTEM_PROCESSOR arm ) )

    set( CMAKE_C_COMPILER /opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc ) )

    set( CMAKE_CXX_COMPILER /opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ ) )

    set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) ONLY)

    set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) ONLY)

    set(CMAKE_FIND_ROOT_PATH /opt/Hackberryfs /opt/Hackberryfs/usr/local/lib )

  2. Disable python support when running ccmake.

Conclusion:

  1. I looked into OpenCV-2.4.3/cmake/OpenCVDetectPython.cmake. It doesn't make sense to me that it tried to find host machine python. I'm not so sure how it works.

  2. I got linking error when compiling OpenCV. I looked into issues. It can't find target rule for libz.so. I'm scratching my head to take a look into build.cmake file. But auto-generated file from CMake is way too complicated to debug.

It is a pain in the ass to do cross compile. It already wasted me two days to figure out how cmake. For now, I'd live with arm board to do native compiling. I'm done with it.