Posted 6/18/16 10:26 AM, 10 messages.
- $begingroup$ I also learned that catkin must be executed when the venv is activated, and then you start catkin in the folder where you generate the build folder. But it does not solve the issue here, I still get No module named catkinpkg.package. $endgroup$ – questionto42 Dec 14 '20 at 20:17.
- Hi, I have followed the steps to install ROS1 under Ubuntu 16.04 manually. Then, I installed some libraries for OpenManipulator-X using the steps described in the e-Manual. When I executed catkinm.
Developer(s) | Andy Cedilnik, Bill Hoffman, Brad King, Ken Martin, Alexander Neundorf |
---|---|
Initial release | 2000; 21 years ago |
Stable release | |
Repository | |
Written in | C, C++[2] |
Operating system | Cross-platform |
Type | Software development tools |
License | New BSD |
Website | cmake.org |
In software development, CMake is cross-platformfree and open-source software for build automation, testing, packaging and installation of software by using a compiler-independent method.[3] CMake is not a build system but rather it generates another system's build files. It supports directory hierarchies and applications that depend on multiple libraries. It is used in conjunction with native build environments such as Make, Qt Creator, Ninja, Android Studio, Apple's Xcode, and Microsoft Visual Studio. It has minimal dependencies, requiring only a C++ compiler on its own build system.
CMake is distributed as open-source software under permissive New BSD license.[4]
History[edit]
CMake development began in 1999 in response to the need for a cross-platform build environment for the Insight Segmentation and Registration Toolkit.[5] The project is funded by the United States National Library of Medicine as part of the Visible Human Project. It was partially inspired by pcmaker, which was made by Ken Martin and other developers to support the Visualization Toolkit (VTK). At Kitware, Bill Hoffman blended components of pcmaker with his own ideas, striving to mimic the functionality of Unixconfigure scripts. CMake was first implemented in 2000 and further developed in 2001.
Continued development and improvements were fueled by the incorporation of CMake into developers’ own systems, including the VXL Project,[clarification needed] the CABLE[6] features added by Brad King,[clarification needed] and GE Corporate R&D for support of DART.[clarification needed] Additional features were created when VTK transitioned to CMake for its build environment and for supporting ParaView.
Version 3.0 was released in June 2014.[7] It has been described as the beginning of 'Modern CMake'.[8] Experts now advise to avoid variables in favor of targets and properties.[9] The commands
add_compile_options
, include_directories
, link_directories
, link_libraries
that were at the core of CMake 2 should now be replaced by target-specific commands.Features[edit]
A key feature is the ability to (optionally) place compiler outputs (such as object files) outside the source tree. This enables multiple builds from the same source tree and cross-compilation. It also keeps the source tree clean and ensures that removing a build directory will not remove the source files.
Flexible project structure[edit]
CMake can locate system-wide and user-specified executables, files, and libraries. These locations are stored in a cache, which can then be tailored before generating the target build files. The cache can be edited with a graphical editor, which is shipped with the CMake.
Complicated directory hierarchies and applications that rely on several libraries are well supported by CMake. For instance, CMake is able to accommodate a project that has multiple toolkits, or libraries that each have multiple directories. In addition, CMake can work with projects that require executables to be created before generating code to be compiled for the final application. Its open-source, extensible design allows CMake to be adapted as necessary for specific projects.[10]
IDEs configuration support[edit]
CMake can generate project files for several popular IDEs, such as Microsoft Visual Studio, Xcode, and Eclipse CDT. It can also produce build scripts for MSBuild or NMake on Windows; Unix Make on Unix-like platforms such as Linux, macOS, and Cygwin; and Ninja on both Windows and Unix-like platforms.
Build process[edit]
The build of a program or library with CMake is a two stage process. First, standard build files are created (generated) from configuration files (CMakeLists.txt) which are written in CMake language. Then the platform's native build tools (native toolchain) are used for actual building of programs.[10][11]
The build files are configured depending on used generator (e.g. Unix Makefiles for make). Advanced users can also create and incorporate additional makefile generators to support their specific compiler and OS needs. Generated files are typically placed (by using
cmake
flag) into a different from sources folder, e.g., build/
.Each build project in turn contains a
CMakeCache.txt
file and CMakeFiles
directory in every (sub-)directory of the projects (happened to be included by add_subdirectory(..)
command earlier) helping to avoid or speed up regeneration stage once it's run over again.Types of build targets[edit]
Depending on CMakeLists.txt configuration the build files may be either executables, libraries (e.g.
libxyz
, xyz.dll
etc), object file libraries or pseudo-targets (including aliases). Cmake can produce object files that can be linked against by executable binaries/libraries avoiding dynamic (run-time) linking and using static (compile-time) one instead. This enables flexibility in configuration of various optimizations.[12]Language[edit]
CMake has a relatively simple interpreted, functional, scripting language. It supports variables, string manipulation, arrays, function/macro declarations, and module inclusion (import). CMake Language commands (or directives) are read by
cmake
from a file named CMakeLists.txt
. This file specifies the source files and build parameters, which cmake will place in the project's build specification (such as a Makefile). Additionally, .cmake
-suffixed files can contain scripts used by cmake.[13]To generate a project's build files, one invokes
cmake
and specifies the directory which contains CMakeLists.txt
. This file contains one or more commands in the form COMMAND(argument ..)
. The arguments are whitespace-separated.The language includes commands to specify dependencies. For example, commands such as
add_executable(..)
and add_library(..)
introduce the target and dependencies for executables and libraries, respectively.[14][15] Some build dependencies can be determined automatically.![Cmake_check_build_system Cmake_check_build_system](https://www.programmersought.com/images/646/9e8c8b971f91eaa1d4ed8a29a7e369be.png)
The arguments can include keywords to separate groups of arguments. For example, in the command
SET_SOURCE_FILE_PROPERTIES(source_file..COMPILE_FLAGScompiler_option..)
. Here, the keyword COMPILE_FLAGS
terminates the list of source files and begins the list of compiler options.[16]Once the Makefile (or alternative) has been generated, build behavior can be fine-tuned via target properties (since version 3.1) or via
CMAKE_..
-prefixed global variables.The latter is discouraged for target-only configurations because variables are also used to configure CMake itself and to set up initial defaults.[9]JSON strings[edit]
Cmake supports extracting values into variables from the JSON-data strings (since version 3.19).[17]
Internals[edit]
The executable programs CMake, CPack, and CTest are written in the C++ programming language.
Much of CMake's functionality is implemented in modules that are written in the CMake language.[18]
Since release 3.0, CMake's documentation uses reStructuredText markup. HTML pages and man pages are generated by the Sphinx documentation generator.
Modules & Tools[edit]
CMake ships with numerous
.cmake
modules and tools. These facilitate work such as finding dependencies (FindXYZ
modules), testing the toolchain environment and executables, packaging releases (CPack
module and cpack
command), and managing dependencies on external projects (ExternalProject
module):[19][20]- ctest — is used for target testing commands specified by CMakeLists.txt
- ccmake and cmake-gui — tweaks and updates configuration variables intended for the native build system
- cpack — helps to package software
CPack[edit]
CPack is a packaging system for software distributions. It is tightly integrated with CMake but can function without it.[21][22]
It can be used to generate:
- Linux RPM, deb, and gzip packages (for both binaries and source code).
- NSIS files (for Microsoft Windows).
- macOS packages.
Examples[edit]
Hello World[edit]
The following source code files demonstrate how to build a simple hello world program written in C++ by using CMake. The source files are placed in a
src/
directory.bash script to run CMake on a Linux system. This example assumes that the script will be kept next to the
src/
folder: See also[edit]
- GYP (Generate Your Projects) - Google-made project building tool
References[edit]
- ^'CMake 3.20.2 available for download'.
- ^'The CMake Open Source Project on OpenHub'. OpenHub. Retrieved 2016-04-09.
- ^'CMake'.
- ^'Licenses · master · CMake / CMake'. GitLab. Retrieved 2020-11-13.
- ^'FLOSS Weekly 111: CMake'. podcast. TWiT Network. Retrieved 27 February 2011.
- ^'The CABLE'. Archived from the original on 2013-06-19. Retrieved 2010-11-10.
- ^Maynard, Robert (June 10, 2014). '[CMake] [ANNOUNCE] CMake 3.0.0 Released'.
- ^'Effective Modern CMake'. Gist.
- ^ abhttps://github.com/boostcon/cppnow_presentations_2017/blob/master/05-19-2017_friday/effective_cmake__daniel_pfeifer__cppnow_05-19-2017.pdf, https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
- ^ abNeundorf, Alexander (2006-06-21). 'Why the KDE project switched to CMake—and how'. LWN.net.
- ^'cmake-toolchains(7) — CMake 3.19.0-rc2 Documentation'. cmake.org. Retrieved 2020-10-29.
- ^'cmake-buildsystem(7) — CMake 3.19.0-rc3 Documentation'. cmake.org. Retrieved 2020-11-14.
- ^'cmake-language(7) — CMake 3.19.0-rc2 Documentation'. cmake.org. Retrieved 2020-10-29.
- ^'add_executable — CMake 3.19.0-rc1 Documentation'. cmake.org. Retrieved 2020-10-25.
- ^'add_library — CMake 3.19.0-rc1 Documentation'. cmake.org. Retrieved 2020-10-25.
- ^Andrej Cedilnik (2003-10-30). 'Cross-Platform Software Development Using CMake Software'. Linux Journal. Retrieved 2021-01-29.
- ^'CMake 3.19 Release Notes — CMake 3.19.7 Documentation'. cmake.org. Retrieved 2021-03-15.
- ^'cmake-language(7) — CMake 3.19.0-rc1 Documentation'. cmake.org. Retrieved 2020-10-25.
- ^'cmake-modules(7) — CMake 3.14.7 Documentation'. cmake.org. Retrieved 2020-10-24.
- ^'ExternalProject — CMake 3.14.7 Documentation'. cmake.org. Retrieved 2020-10-24.
- ^'Packaging With CPack'. CMake Community Wiki.
- ^
cpack(1)
– Linux General Commands Manual
External links[edit]
- Official website
- CMake on GitHub
- C++Now 2017: Daniel Pfeifer “Effective CMake' on YouTube
Retrieved from 'https://en.wikipedia.org/w/index.php?title=CMake&oldid=1016553366'
I’m trying to build my ROS catkin space but I’m having trouble building the cv_bridge package, getting this error:
nvidiaagx-desktop:~/catkin_ws$ catkin_make
Base path: /home/nvidiaagx/catkin_ws
Source space: /home/nvidiaagx/catkin_ws/src
Build space: /home/nvidiaagx/catkin_ws/build
Devel space: /home/nvidiaagx/catkin_ws/devel
Install space: /home/nvidiaagx/catkin_ws/install
Base path: /home/nvidiaagx/catkin_ws
Source space: /home/nvidiaagx/catkin_ws/src
Build space: /home/nvidiaagx/catkin_ws/build
Devel space: /home/nvidiaagx/catkin_ws/devel
Install space: /home/nvidiaagx/catkin_ws/install
Running command: “make cmake_check_build_system” in “/home/nvidiaagx/catkin_ws/build”
– Using CATKIN_DEVEL_PREFIX: /home/nvidiaagx/catkin_ws/devel
– Using CMAKE_PREFIX_PATH: /opt/ros/melodic
– This workspace overlays: /opt/ros/melodic
– Found PythonInterp: /usr/bin/python2 (found suitable version “2.7.17”, minimum required is “2”)
– Using PYTHON_EXECUTABLE: /usr/bin/python2
– Using Debian Python package layout
– Using empy: /usr/bin/empy
– Using CATKIN_ENABLE_TESTING: ON
– Call enable_testing()
– Using CATKIN_TEST_RESULTS_DIR: /home/nvidiaagx/catkin_ws/build/test_results
– Found gtest sources under ‘/usr/src/googletest’: gtests will be built
– Found gmock sources under ‘/usr/src/googletest’: gmock will be built
– Found PythonInterp: /usr/bin/python2 (found version “2.7.17”)
– Using Python nosetests: /usr/bin/nosetests-2.7
– catkin 0.7.29
– BUILD_SHARED_LIBS is on
– BUILD_SHARED_LIBS is on
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– ~~ traversing 9 packages in topological order:
– ~~ - image_transport_plugins (metapackage)
– ~~ - opencv_tests
– ~~ - vision_opencv (metapackage)
– ~~ - cv_bridge
– ~~ - image_geometry
– ~~ - compressed_depth_image_transport
– ~~ - compressed_image_transport
– ~~ - theora_image_transport
– ~~ - rtabmap_ros
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– +++ processing catkin metapackage: ‘image_transport_plugins’
– > add_subdirectory(image_transport_plugins/image_transport_plugins)
– +++ processing catkin package: ‘opencv_tests’
– > add_subdirectory(vision_opencv/opencv_tests)
– +++ processing catkin metapackage: ‘vision_opencv’
– > add_subdirectory(vision_opencv/vision_opencv)
– +++ processing catkin package: ‘cv_bridge’
– > add_subdirectory(vision_opencv/cv_bridge)
– Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython2.7.so (found version “2.7.17”)
CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1626 (message):
No header defined for python37; skipping header check
Call Stack (most recent call first):
vision_opencv/cv_bridge/CMakeLists.txt:11 (find_package)
– Using CMAKE_PREFIX_PATH: /opt/ros/melodic
– This workspace overlays: /opt/ros/melodic
– Found PythonInterp: /usr/bin/python2 (found suitable version “2.7.17”, minimum required is “2”)
– Using PYTHON_EXECUTABLE: /usr/bin/python2
– Using Debian Python package layout
– Using empy: /usr/bin/empy
– Using CATKIN_ENABLE_TESTING: ON
– Call enable_testing()
– Using CATKIN_TEST_RESULTS_DIR: /home/nvidiaagx/catkin_ws/build/test_results
– Found gtest sources under ‘/usr/src/googletest’: gtests will be built
– Found gmock sources under ‘/usr/src/googletest’: gmock will be built
– Found PythonInterp: /usr/bin/python2 (found version “2.7.17”)
– Using Python nosetests: /usr/bin/nosetests-2.7
– catkin 0.7.29
– BUILD_SHARED_LIBS is on
– BUILD_SHARED_LIBS is on
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– ~~ traversing 9 packages in topological order:
– ~~ - image_transport_plugins (metapackage)
– ~~ - opencv_tests
– ~~ - vision_opencv (metapackage)
– ~~ - cv_bridge
– ~~ - image_geometry
– ~~ - compressed_depth_image_transport
– ~~ - compressed_image_transport
– ~~ - theora_image_transport
– ~~ - rtabmap_ros
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– +++ processing catkin metapackage: ‘image_transport_plugins’
– > add_subdirectory(image_transport_plugins/image_transport_plugins)
– +++ processing catkin package: ‘opencv_tests’
– > add_subdirectory(vision_opencv/opencv_tests)
– +++ processing catkin metapackage: ‘vision_opencv’
– > add_subdirectory(vision_opencv/vision_opencv)
– +++ processing catkin package: ‘cv_bridge’
– > add_subdirectory(vision_opencv/cv_bridge)
– Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython2.7.so (found version “2.7.17”)
CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1626 (message):
No header defined for python37; skipping header check
Call Stack (most recent call first):
vision_opencv/cv_bridge/CMakeLists.txt:11 (find_package)
CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
Unable to find the requested Boost libraries.
Unable to find the requested Boost libraries.
Boost version: 1.65.1
Boost include path: /usr/include
Could not find the following Boost libraries:
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
vision_opencv/cv_bridge/CMakeLists.txt:11 (find_package)
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
vision_opencv/cv_bridge/CMakeLists.txt:11 (find_package)
– Found OpenCV: /usr (found suitable version “4.1.1”, minimum required is “4”) found components: opencv_core opencv_imgproc opencv_imgcodecs
– Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython2.7.so (found suitable version “2.7.17”, minimum required is “2.7”)
– +++ processing catkin package: ‘image_geometry’
– > add_subdirectory(vision_opencv/image_geometry)
– Found OpenCV: /usr (found version “4.1.1”)
– +++ processing catkin package: ‘compressed_depth_image_transport’
– > add_subdirectory(image_transport_plugins/compressed_depth_image_transport)
– +++ processing catkin package: ‘compressed_image_transport’
– > add_subdirectory(image_transport_plugins/compressed_image_transport)
– +++ processing catkin package: ‘theora_image_transport’
– > add_subdirectory(image_transport_plugins/theora_image_transport)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
– theora_image_transport: 1 messages, 0 services
– +++ processing catkin package: ‘rtabmap_ros’
– > add_subdirectory(rtabmap_ros)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Warning at rtabmap_ros/CMakeLists.txt:28 (find_package):
By not providing “Findapriltag_ros.cmake” in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
“apriltag_ros”, but CMake did not find one.
– Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython2.7.so (found suitable version “2.7.17”, minimum required is “2.7”)
– +++ processing catkin package: ‘image_geometry’
– > add_subdirectory(vision_opencv/image_geometry)
– Found OpenCV: /usr (found version “4.1.1”)
– +++ processing catkin package: ‘compressed_depth_image_transport’
– > add_subdirectory(image_transport_plugins/compressed_depth_image_transport)
– +++ processing catkin package: ‘compressed_image_transport’
– > add_subdirectory(image_transport_plugins/compressed_image_transport)
– +++ processing catkin package: ‘theora_image_transport’
– > add_subdirectory(image_transport_plugins/theora_image_transport)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
– theora_image_transport: 1 messages, 0 services
– +++ processing catkin package: ‘rtabmap_ros’
– > add_subdirectory(rtabmap_ros)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Warning at rtabmap_ros/CMakeLists.txt:28 (find_package):
By not providing “Findapriltag_ros.cmake” in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
“apriltag_ros”, but CMake did not find one.
Could not find a package configuration file provided by “apriltag_ros” with
any of the following names:
any of the following names:
Add the installation prefix of “apriltag_ros” to CMAKE_PREFIX_PATH or set
“apriltag_ros_DIR” to a directory containing one of the above files. If
“apriltag_ros” provides a separate development package or SDK, be sure it
has been installed.
“apriltag_ros_DIR” to a directory containing one of the above files. If
“apriltag_ros” provides a separate development package or SDK, be sure it
has been installed.
CMake Warning at rtabmap_ros/CMakeLists.txt:30 (find_package):
By not providing “Findfind_object_2d.cmake” in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
“find_object_2d”, but CMake did not find one.
By not providing “Findfind_object_2d.cmake” in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
“find_object_2d”, but CMake did not find one.
Could not find a package configuration file provided by “find_object_2d”
with any of the following names:
with any of the following names:
Add the installation prefix of “find_object_2d” to CMAKE_PREFIX_PATH or set
“find_object_2d_DIR” to a directory containing one of the above files. If
“find_object_2d” provides a separate development package or SDK, be sure it
has been installed.
“find_object_2d_DIR” to a directory containing one of the above files. If
“find_object_2d” provides a separate development package or SDK, be sure it
has been installed.
– The imported target “vtkRenderingPythonTkWidgets” references the file
“/usr/lib/aarch64-linux-gnu/libvtkRenderingPythonTkWidgets.so”
Plex roku. but this file does not exist. Possible reasons include:
“/usr/lib/aarch64-linux-gnu/libvtkRenderingPythonTkWidgets.so”
Plex roku. but this file does not exist. Possible reasons include:
- The file was deleted, renamed, or moved to another location.
- An install or uninstall procedure did not complete successfully.
- The installation package was faulty and contained
“/usr/lib/cmake/vtk-6.3/VTKTargets.cmake”
but not all the files it references.
– The imported target “vtk” references the file
“/usr/bin/vtk”
but this file does not exist. Possible reasons include:
“/usr/bin/vtk”
but this file does not exist. Possible reasons include:
Invoking Make Cmake Check Build System Failed
- The file was deleted, renamed, or moved to another location.
- An install or uninstall procedure did not complete successfully.
- The installation package was faulty and contained
“/usr/lib/cmake/vtk-6.3/VTKTargets.cmake”
but not all the files it references.
– RTABMAP_SYNC_MULTI_RGBD = OFF
– RTABMAP_SYNC_USER_DATA = OFF
– rtabmap_ros: 17 messages, 11 services
– WITH octomap_msgs
– WITH rviz
– WITH costmap_2d
– Configuring incomplete, errors occurred!
See also “/home/nvidiaagx/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/nvidiaagx/catkin_ws/build/CMakeFiles/CMakeError.log”.
Makefile:320: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed
– RTABMAP_SYNC_USER_DATA = OFF
– rtabmap_ros: 17 messages, 11 services
– WITH octomap_msgs
– WITH rviz
– WITH costmap_2d
– Configuring incomplete, errors occurred!
See also “/home/nvidiaagx/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/nvidiaagx/catkin_ws/build/CMakeFiles/CMakeError.log”.
Makefile:320: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed
I cannot seem to find this error online, which makes me think its related to the Jetpack version,
I’m running Jetpack 4.1.1 with ubuntu 18.04,
I’m running Jetpack 4.1.1 with ubuntu 18.04,
any idea whee to go from here?
Cmake_check_build_system Error 1
thanks