I’ve just flashed my TX1 using JetPack 2.1 and installed L4T r23.2 (because that L4T version is compatible with a stereo camera, DUO M, that I’m using).
I’m trying to build OpenCV 3.3.0 from source, and I’m currently just doing the following:
Installing the required packages listed in this guide (not doing the cherry-picking…is that important?): OpenCV: Building OpenCV for Tegra with CUDA
Then just:
$git clone https://github.com/opencv/opencv.git
$cd opencv
$git checkout 3.3.0
$mkdir build
$cd build
$cmake -DCMAKE_BUILD_TYPE=RELEASE ..
The build seems to go ok, because I get the following (not posting the whole thing):
General configuration for OpenCV 3.3.0 ===============
Version control: 3.3.0
Platform:
..
(which modules to be built etc. etc.)
..
Install path: /usr/local
cvconfig.h is in: /home/ubuntu/Desktop/opencv/build
------------------------------------------------------
but after this it says “configuration incomplete, errors occured”. The first error in CMakeError.log is:
===== BUILD LOG =====
Change Dir: /home/ubuntu/Desktop/opencv/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec1149311775/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1149311775.dir/build.make CMakeFiles/cmTryCompileExec1149311775.dir/build
make[1]: Entering directory `/home/ubuntu/Desktop/opencv/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ubuntu/Desktop/opencv/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1149311775.dir/cxx11.cpp.o
/usr/bin/c++ -o CMakeFiles/cmTryCompileExec1149311775.dir/cxx11.cpp.o -c /home/ubuntu/Desktop/opencv/cmake/checks/cxx11.cpp
/home/ubuntu/Desktop/opencv/cmake/checks/cxx11.cpp:4:2: error: #error "C++11 is not supported"
#error "C++11 is not supported"
^
/home/ubuntu/Desktop/opencv/cmake/checks/cxx11.cpp: In function ‘int main()’:
/home/ubuntu/Desktop/opencv/cmake/checks/cxx11.cpp:11:10: error: ‘res’ does not name a type
auto res = test();
^
/home/ubuntu/Desktop/opencv/cmake/checks/cxx11.cpp:12:12: error: ‘res’ was not declared in this scope
return res;
^
make[1]: *** [CMakeFiles/cmTryCompileExec1149311775.dir/cxx11.cpp.o] Error 1
make[1]: Leaving directory `/home/ubuntu/Desktop/opencv/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec1149311775/fast] Error 2
===== END =====
This seems almost identical to this issue (just that this is regarding TK1): https://devtalk.nvidia.com/default/topic/1025047/jetson-tk1/building-opencv-3-3-requires-a-newer-gcc/
And I’ve tried with the cmake flag -DENABLE_CXX11=ON </i> , without any luck. My c++ version is:
$c++ --version
c++ (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.4) 4.8.4
I haven’t tried with a newer L4T-version, but that’s no point since I need L4T r23.2 for the stereo camera to work with the TX1.
I actually need OpenCV with the contrib modules, and I would like to use the Tegra optimized version of OpenCV (OpenCV with CUDA or OpenCV4Tegra, if those are two different things), but I’m just trying to build OpenCV one step at a time.
Anyone got any tips?