hi,
I want to cross compiler the opencv application on my pc,but always failed in cmake.I have copyed the /usr of xavier to my pc .Below is the CMakeLists.txt and erros about cmake.
CMakeLists.txt
# cmake needs this line
cmake_minimum_required(VERSION 2.8)
# Define project name
project(opencv_example_project)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER /opt/gcc-linaro-6.4.1-2017.08-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER /opt/gcc-linaro-6.4.1-2017.08-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++)
set(CMAKE_FIND_ROOT_PATH /home/work/rootfs/ )
set(CMAKE_MODULE_PATH /home/work/rootfs/usr/share/cmake-3.10/Modules/)
set(CUDA_TOOLKIT_ROOT_DIR /home/work/rootfs/usr/local/cuda)
find_package(CUDA REQUIRED)
message(STATUS " libraries: ${CUDA_LIBS}")
set(OpenCV_DIR /home/work/rootfs/home/nvidia/work/opencv-nocuda/opencv-3.4.0/release/)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
# If the package has been found, several variables will
# be set, you can find the full list with descriptions
# in the OpenCVConfig.cmake file.
# Print some message showing some of them
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
if(CMAKE_VERSION VERSION_LESS "2.8.11")
# Add OpenCV headers location to your include paths
include_directories(${OpenCV_INCLUDE_DIRS})
endif()
# Declare the executable target built from your sources
add_executable(opencv_example example.cpp)
# Link your application with OpenCV libraries
target_link_libraries(opencv_example ${OpenCV_LIBS})
cmake errors
$ cmake ..
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
/home/work/rootfs/usr/local/cuda/bin/nvcc: 1: /home/work/rootfs/usr/local/cuda/bin/nvcc: ELF��I@@Ȼ@8@@@@@@PP��@�@ee@@������C�C�: not found
/home/work/rootfs/usr/local/cuda/bin/nvcc: 2: /home/workrootfs/usr/local/cuda/bin/nvcc: Syntax error: "(" unexpected
CMake Error at /home/work/rootfs/usr/share/cmake-3.10/Modules/FindCUDA.cmake:746 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
CMakeLists.txt:28 (find_package)
CMake Error at /home/work/rootfs/usr/share/cmake-3.10/Modules/FindCUDA.cmake:747 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
CMakeLists.txt:28 (find_package)
-- Found CUDA: /home/work/rootfs/usr/local/cuda (found version ".")
-- libraries:
CMake Error at /home/work/rootfs/home/nvidia/work/opencv-nocuda/opencv-3.4.0/release/OpenCVConfig.cmake:108 (message):
OpenCV static library was compiled with CUDA 10.0 support. Please, use the
same version or rebuild OpenCV with CUDA .
Call Stack (most recent call first):
CMakeLists.txt:42 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/work/cross-compiler/cam_c++11/example_cmake/build/CMakeFiles/CMakeOutput.log".