Running on Ubuntu 22.04 as my host build machine.
If I install cmake with sudo apt update
then sudo apt install cmake
or sudo apt install catkin
(since catkin
includes cmake
), my Buildroot build using cmake no longer can find my compiler. Why?
After running make
in my buildroot project, the compiler is unknown:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /home/gabriel/dev/repos/my_repo/output/my_board/host/bin/ccache
-- Check for working C compiler: /home/gabriel/dev/repos/my_repo/output/my_board/host/bin/ccache - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"/home/gabriel/dev/repos/my_repo/output/my_board/host/bin/ccache"
is not able to compile a simple test program.
It fails with the following output:
...
So, uninstalling cmake from my host via sudo apt remove cmake
removes this problem, but then I get a new error when I run make
in my Buildroot project:
CMake Error at CMakeLists.txt:8 (find_package):
By not providing "FindTinyXML2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "TinyXML2",
but CMake did not find one.
Could not find a package configuration file provided by "TinyXML2" with any
of the following names:
TinyXML2Config.cmake
tinyxml2-config.cmake
Add the installation prefix of "TinyXML2" to CMAKE_PREFIX_PATH or set
"TinyXML2_DIR" to a directory containing one of the above files. If
"TinyXML2" provides a separate development package or SDK, be sure it has
been installed.
...but at least it can find my compiler now. Here is the output just prior to the error above, showing it now can find my gcc-11 "C compiler" and g++-11 "CXX compiler":
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/gabriel/dev/repos/my_repo/output/my_board/host/bin/ccache - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/gabriel/dev/repos/my_repo/output/my_board/host/bin/ccache - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/gabriel/dev/repos/my_repo/output/my_board/build/host-rospack-2.6.2/devel
-- Using CMAKE_PREFIX_PATH: /home/gabriel/dev/repos/my_repo/output/my_board/host//opt/ros/indigo/;/home/gabriel/dev/repos/my_repo/output/my_board/host/usr
-- This workspace overlays: /home/gabriel/dev/repos/my_repo/output/my_board/host//opt/ros/indigo/
-- Found PythonInterp: /home/gabriel/dev/repos/my_repo/output/my_board/host/usr/bin/python (found version "3.8.2")
-- Using PYTHON_EXECUTABLE: /home/gabriel/dev/repos/my_repo/output/my_board/host/usr/bin/python
-- Using default Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/gabriel/dev/repos/my_repo/output/my_board/build/host-rospack-2.6.2/test_results
-- Found gtest: gtests will be built
CMake Warning at /home/gabriel/dev/repos/my_repo/output/my_board/host/opt/ros/indigo/share/catkin/cmake/test/nosetests.cmake:96 (message):
nosetests not found, Python tests can not be run (try installing package
'python3-nose')
Call Stack (most recent call first):
/home/gabriel/dev/repos/my_repo/output/my_board/host/opt/ros/indigo/share/catkin/cmake/all.cmake:147 (include)
/home/gabriel/dev/repos/my_repo/output/my_board/host/opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:4 (find_package)
-- catkin 0.6.19
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found components: filesystem program_options system
-- Found PythonLibs: /home/gabriel/dev/repos/my_repo/output/my_board/host/usr/lib/libpython3.8.so (found suitable version "3.8.2", minimum required is "3.8")
What's going on here? I expect it to find my compiler in both cases, but it won't if I have cmake locally installed, and I expect it to find the tinyxml2 package, but it won't, even though tinyxml2 is locally installed, as I explain here.