On TK1’s Ubuntu I’m trying to compile OpenCV and it fails. The first error from CMakeFiles/CMakeError.log is:
Compilation failed:
source file: '/home/nvidia/work/opencv/cmake/checks/cxx11.cpp'
check option: ''
===== BUILD LOG =====
Change Dir: /home/nvidia/work/opencv/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_cb2c5/fast"
/usr/bin/make -f CMakeFiles/cmTC_cb2c5.dir/build.make CMakeFiles/cmTC_cb2c5.dir/build
make[1]: Entering directory '/home/nvidia/work/opencv/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_cb2c5.dir/cxx11.cpp.o
/usr/bin/c++ -o CMakeFiles/cmTC_cb2c5.dir/cxx11.cpp.o -c /home/nvidia/work/opencv/cmake/checks/cxx11.cpp
/home/nvidia/work/opencv/cmake/checks/cxx11.cpp:4:2: error: #error "C++11 is not supported"
#error "C++11 is not supported"
^
/home/nvidia/work/opencv/cmake/checks/cxx11.cpp: In function 'int main()':
/home/nvidia/work/opencv/cmake/checks/cxx11.cpp:11:10: error: 'res' does not name a type
auto res = test();
^
/home/nvidia/work/opencv/cmake/checks/cxx11.cpp:12:12: error: 'res' was not declared in this scope
return res;
^
CMakeFiles/cmTC_cb2c5.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_cb2c5.dir/cxx11.cpp.o' failed
make[1]: *** [CMakeFiles/cmTC_cb2c5.dir/cxx11.cpp.o] Error 1
make[1]: Leaving directory '/home/nvidia/work/opencv/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_cb2c5/fast' failed
make: *** [cmTC_cb2c5/fast] Error 2
===== END =====
I understand the c++ compiler is too old:
$ c++ --version
c++ (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
I looked into how to install a newer Linaro gcc and I found on the Linaro website:
https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/
I’m looking there at gcc-linaro-7.1.1-2017.08-x86_64_aarch64-linux-gnu.tar.xz and I’m wondering if there is an easier way to install a newer gcc on the TK1’s Ubuntu.