Failed to cross compile OpenCV3.4.9 for aarch64 targets

asked 2020-02-13 01:08:55 -0500

 Host: Ubuntu18.04
Target: Nvidia Xavier with QNX system
Cmake Version: 3.10.2

I input the following commands int Terminal:

mkdir -p <opencv_src_dir>
cmake -DCMAKE_TOOLCHAIN_FILE=<path to the OpenCV source directory>/platforms/linux/aarch64-gnu.toolchain.cmake -DOPENCV_EXTRA_MODULES_PATH=<path to opencv_contrib modules directoyr> ENABLE_CXX11=ON <path to the OpenCV source directory>

And the CMakeError.log is:

Build output check failed:

    Regex: 'command line option .* is valid for .* but not for C\+\+'
    Output line: 'cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++'
Compilation failed:
    source file: '/home/tang/openCV/opencv-3.4.9/platforms/linux/build_aarch64/CMakeFiles/CMakeTmp/src.cxx'
    check option: ' -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations  -Wmissing-prototypes'
===== BUILD LOG =====
Change Dir: /home/tang/openCV/opencv-3.4.9/platforms/linux/build_aarch64/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e055b/fast"
/usr/bin/make -f CMakeFiles/cmTC_e055b.dir/build.make CMakeFiles/cmTC_e055b.dir/build
make[1]: Entering directory '/home/tang/openCV/opencv-3.4.9/platforms/linux/build_aarch64/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_e055b.dir/src.cxx.o
/usr/bin/c++    -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi  -O3 -DNDEBUG -fPIE   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -o CMakeFiles/cmTC_e055b.dir/src.cxx.o -c /home/tang/openCV/opencv-3.4.9/platforms/linux/build_aarch64/CMakeFiles/CMakeTmp/src.cxx
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
/home/tang/openCV/opencv-3.4.9/platforms/linux/build_aarch64/CMakeFiles/CMakeTmp/src.cxx:1:0: warning: ignoring #pragma   [-Wunknown-pragmas]
 #pragma

Linking CXX executable cmTC_e055b
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e055b.dir/link.txt --verbose=1
/usr/bin/c++   -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi  -O3 -DNDEBUG  -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now   -rdynamic CMakeFiles/cmTC_e055b.dir/src.cxx.o  -o cmTC_e055b
make[1]: Leaving directory '/home/tang/openCV/opencv-3.4.9/platforms/linux/build_aarch64/CMakeFiles/CMakeTmp'

===== END =====
edit retag flag offensive close merge delete

Comments

Try OpenCV 4.2.0.

supra56 gravatar imagesupra56 ( 2020-02-13 03:54:15 -0500 )edit