GithubHelp home page GithubHelp logo

mrt_cmake_modules's People

Contributors

autonomobil avatar christiankinzig avatar christophburger89 avatar filiperinaldi avatar florianwirth avatar janstrohbeck avatar johannesbeck avatar jquehl avatar keroe avatar koenigshof avatar kroeper avatar m-naumann avatar olesalscheider avatar omersahintas avatar poggenhans avatar shenyinzhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mrt_cmake_modules's Issues

This project can not be installed by `colcon build`

Windows 11 and Visual Studio.

steps:

  1. create an empty workspace: d:\ws
  2. put this project to d:\ws\src\mrt_cmake_modules
  3. in d:\ws, run colcon build

error:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\colcon_core\executor_init_.py", line 91, in call
rc = await self.task(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\colcon_core\task_init_.py", line 93, in call
return await task_method(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\colcon_ros\task\catkin\build.py", line 75, in build
rc = await extension.build(
File "C:\Program Files\Python310\lib\site-packages\colcon_cmake\task\cmake\build.py", line 103, in build
rc = await self._build(
File "C:\Program Files\Python310\lib\site-packages\colcon_cmake\task\cmake\build.py", line 236, in build
if not await has_target(args.build_base, target):
File "C:\Program Files\Python310\lib\site-packages\colcon_cmake\task\cmake_init
.py", line 62, in has_target
assert target == 'install'
AssertionError

for C:\Program Files\Python310\lib\site-packages\colcon_cmake\task\cmake\__init__.py

async def has_target(path, target):
    """
    Check if the CMake generated build system has a specific target.

    :param str path: The path of the directory contain the generated build
      system
    :param str target: The name of the target
    :rtype: bool
    """
    generator = get_generator(path)
    if 'Unix Makefiles' in generator:
        return target in await get_makefile_targets(path)
    if 'Ninja' in generator:
        return target in get_ninja_targets(path)
    if 'Visual Studio' in generator:
        print(target)
        assert target == 'install'                                             <-- error
        install_project_file = get_project_file(path, 'INSTALL')
        return install_project_file is not None
    assert False, \
        "'has_target' not implemented for CMake generator '{generator}'" \
        .format_map(locals())

print(target) is for debug and its output is

tests

so assert target == 'install' failed

ps:
if I do a normal cmake --build (not colcon), it compiles ok.

GLOG_INCLUDE_DIRS in FindGlog.cmake

Cmake fails to bind glog with:
mrt_cmake_modules/cmake/Modules/FindGlog.cmake:366 (list): list sub-command REMOVE_ITEM requires list to be present.

If lines
list(REMOVE_ITEM GLOG_INCLUDE_DIRS "/usr/include")
list(REMOVE_ITEM GLOG_INCLUDE_DIRS "/usr/local/include")
are deleted, it builds without any problem.

The list() commands are not present in other find scripts such as Ceres-solver. What is the reason behind to add these lines?

Finding libboost-python-dev in Ubuntu 20.04 (focal, Boost1.71)

Hello,
Judging from your FindBoostPython.cmake file, I can see that you are aware that it is quite troublesome to find the correct libboost-python-dev version depending on the Ubuntu/Python/Boost version combination. However, the current implementation is failing for default Ubuntu 20.04 systems (which are shipped with Boost 1.71). You can recreate the failure by running the mrt_cmake _modules generate_cmakelists.py script for a package.xml containing the following line:

  <depend>libboost-python-dev</depend>

Alternatively, directly invoking the following stripped CMake file:

cmake_minimum_required(VERSION 3.5.1)
project(testpackage)

find_package(mrt_cmake_modules REQUIRED)
include(UseMrtStdCompilerFlags)
include(GatherDeps)

find_package(AutoDeps REQUIRED COMPONENTS mrt_cmake_modules libboost-python-dev)

will cause the following CMake error:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
  Could not find a package configuration file provided by "boost_python3"
  (requested version 1.71.0) with any of the following names:

    boost_python3Config.cmake
    boost_python3-config.cmake

  Add the installation prefix of "boost_python3" to CMAKE_PREFIX_PATH or set
  "boost_python3_DIR" to a directory containing one of the above files.  If
  "boost_python3" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
  /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:261 (find_package)
  /home/patrick/mrt_cmake_modules/cmake/Modules/FindBoostPython.cmake:39 (find_package)
  /home/patrick/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:198 (find_package)
  /home/patrick/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:253 (_find_dep)
  CMakeLists.txt:8 (find_package)

Interestingly, I can help locate the package by adding

find_package(Boost COMPONENTS python)

right before the AutoDeps call. However, I'm trying to build the lanelet2_interface_ros package; therefore I don't want to touch its CMakeLists.txt and neither the mrt_cmake subrepo.

The following Boost Issue should explain the issue - the FindBoostPython.cmake script searches for the python3 component in line 39, which is not supported in Boost version 1.71 (and should be supported again in 1.73 according to this issue). Instead, a search for python without the suffix is preferable.

I understand that the problem should therefore be fixed by upgrading Boost to 1.73; however, Ubuntu focal ships with 1.71 and the fix has apparently not been backported for over a year now. So I would like to ask if you could address this on your side? This would help a lot by avoiding to upgrade Boost or patch either the lanelet2_interface_ros or this subrepo.

Best regards,

Patrick

Nodelet library name

Hi,
I think that nodelet library name in README and documentation is wrong.

It says that the nodelet library name will be: “libexample_package_nodelet”.

But depending on the folder structure I only get such names:
“libexample_package-example_name-nodelet”
“libexample_package-example_package-nodelet”

I created a simple example to show this problem: https://github.com/BaltashovIlia/example_package

Python3 Compatibility

Is there any plan to support Python3 with this package? Python2.7 updates end in January of 2020 and Autoware currently uses Python3 by default so building this package fails.

UseMrtStdCompilerFlags.cmake defaults the target to sandybridge (x86)

Arguably not an bug report, but a feature request...

UseMrtStdCompilerFlags.cmake restricts the use of these modules to amd64 machines by defaulting to "sandybridge":

# Select arch flag
if(MRT_ARCH)
  if(NOT MRT_ARCH STREQUAL "None" AND NOT MRT_ARCH STREQUAL "none")
    set(_arch "-march=${MRT_ARCH}")
  endif()
else()
  # sandybridge is the lowest common cpu arch for us
  set(_arch "-march=sandybridge")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_arch}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_arch}")

Trying to build a project using mrt_cmake_modules in an AArch64 (Arm) machine fails. The failure can be obvious (you will see compilation errors and with the mach=sandybridge flag being used, or some find_package() may fail with no reason (this is due the fact they use the CMake's try/run mechanism to build small C apps).

Note that this was the real problem why find_package(OpenMP) was failing for me on this issue: #6

Is there a good reason why sandybridge is being forced as the defaul mach? The compiler will already have default to a sane value for the target it is running from. If the "application" using mrt_cmake_modules has a minimum arch target requirement, then I suppose this is what MRT_ARCH is there for.

Link a library from other package

I am trying to link a library from other ros package to a ros package. I understand that the mrt_cmake_modules should make these entire dependency linkage process smooth and easy, but I am having some trouble linking a library to my package.

I am working on the LIMO SLAM package (link) which rely on the mrt_cmake_modules to generate the dependencies.

In the LIMO SLAM project, different ros packages from other git repos are used and linked.
With the dependencies auto-generated, the launch file can instantiate other package's module. However, what I need is more than this.

I need my main program (also auto-generated through mrt_cmake_modules) to include the headers from other packages. The main program is demo_keyframe_bundle_adjustment_meta/apps/main_program.cpp in my repo. I want it to be able to include the header from an external package called image_preprocessing_tool.

I organized the package structure of the image_preprocessing_tool to be compatible with mrt_cmake_modules guide. I was expecting the mrt_cmake_modules to auto-generate the linkage by putting this package name to my main package, but sadly it does not seem working.

I noticed that the cmake macro MRT_INCLUDE_DIR and the MRT_LIBRARIES seem to be empty which I suppose should contain the paths for the dependent packages. When I added hard coded paths into the cmakelist file, the code worked.

I don't know if I conveyed my problem clearly.

I wasn't sure how to use the mrt_cmake_modules properly for this task.

I would appreciate any help.
Thank you for your help in advance.

OpenMP dependency

cmake/Modules/UseMrtStdCompilerFlags.cmake seems to require OpenMP:

#add OpenMP
find_package(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")

If mrt_cmake_modules needs this package, then I assume this dependency should be expressed in its package.xml.

Can any one please clarify it?

Package qtbase5-dev was not found, when installing lanelet_rviz_plugin_ros

Installed mrt_cmake_modules as a dependency from ros-melodic-lanelet2. When installing lanelet_rviz_plugin_ros the following error occurs (after installing lanelet2_interface_ros and util_rviz):

Errors     << lanelet_rviz_plugin_ros:cmake /home/mo/catkin_ws/logs/lanelet_rviz_plugin_ros/build.cmake.003.log                                                                                                                                                                   
CMake Error at /opt/ros/melodic/share/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:176 (message):
  Package qtbase5-dev was not found.  If it is a catkin package: Make sure it
  is present.  If it is an external package: Make sure it is listed in
  mrt_cmake_modules/yaml/cmake.yaml!
Call Stack (most recent call first):
  /opt/ros/melodic/share/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:253 (_find_dep)
  CMakeLists.txt:23 (find_package)

cd /home/mo/catkin_ws/build/lanelet_rviz_plugin_ros; catkin build --get-env lanelet_rviz_plugin_ros | catkin env -si  /usr/bin/cmake /home/mo/catkin_ws/src/lanelet_rviz_plugin_ros --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/mo/catkin_ws/devel/.private/lanelet_rviz_plugin_ros -DCMAKE_INSTALL_PREFIX=/home/mo/catkin_ws/install; cd -
..................................................................................................................................................................................................................................................................................
Failed     << lanelet_rviz_plugin_ros:cmake          [ Exited with code 1 ]                                                                                                                                                                                                       
Failed    <<< lanelet_rviz_plugin_ros                [ 0.6 seconds ]    

I had to add

qtbase5-dev:
  components: [Core Gui Network]
  include_dirs: [QT_INCLUDES]
  libraries: [QT_LIBRARIES]
  name: MrtQt5

to /opt/ros/melodic/share/mrt_cmake_modules/yaml/cmake.yaml to make it work.

Open3d

Hello
I would like to use open3D in one of my robotics projects under ROS.
Unfortunately, then i add to yaml/cmake.yaml:

open3d:
  components: []
  name: Open3D
  include_dirs: [Open3D_INCLUDE_DIRS]
  libraries: [Open3D_LIBRARIES]
  library_dirs: [Open3D_LIBRARY_DIRS]

and generate cmake by mrt.

it is possible to build simple code:

#include "open3d/Open3D.h"

int main(int argc, char** argv)
{
    using namespace open3d;

    auto sphere = geometry::TriangleMesh::CreateSphere(1.0);
    sphere->ComputeVertexNormals();
    sphere->PaintUniformColor({ 0.0, 1.0, 0.0 });
    visualization::DrawGeometries({ sphere });

    return 0;
}

but then i try to add ROS:

#include <ros/ros.h>
#include "open3d/Open3D.h"

int main(int argc, char** argv)
{
    using namespace open3d;

    ros::init(argc, argv, "map_loader");

    auto sphere = geometry::TriangleMesh::CreateSphere(1.0);
    sphere->ComputeVertexNormals();
    sphere->PaintUniformColor({ 0.0, 1.0, 0.0 });
    visualization::DrawGeometries({ sphere });

    return 0;
}

i have:

undefined reference to ros::init(int&, char**, std::string const&, unsigned int)

is it possible to help me with such an issue?

ROS Build Farm Release

I've asked this about lanelet2 (see fzi-forschungszentrum-informatik/Lanelet2#53) but this package is a prerequisite. I would be happy to help release this package. lanelet2 is a requirement for the Autoware.ai (and will likely be for Autoware.Auto as well) and is taking a huge portion of our CI build time to build. Having binary packages distributed from the build farm would be a major boon.

Is python-argparse dependency still necessary?

According to https://github.com/ros/rosdistro/blob/master/rosdep/python.yaml#L471-L498, it seems it's only for older distributions.

I think in most of the distributions that are currently supported, we can use argparse without installing any packages.

$ docker run --rm -it ubuntu:18.04 /bin/bash # or 16.04
# apt update && apt install -y python
# python
Python 2.7.17 (default, Apr 15 2020, 17:20:14) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import argparse
>>> 

I'm asking this because it causes an error when using colcon-ros-bundle to mrt_cmake_modules.
When dependency.name is python-argparse, rule and package_name_list will be [], so an error happens.
https://github.com/colcon/colcon-ros-bundle/blob/master/colcon_ros_bundle/task/ros_bundle.py#L62-L66

Of course, I'll send an issue/PR to colcon-ros-bundle, but it would be helpful if you could remove this old dependency.

Rosdep Error

When I have this package under catkin_ws and run rosdep install, I get following error.

mrt_cmake_modules: Cannot locate rosdep definition for [coverage]

Is this key for installing lcov and gcovr as defined in base.yaml file?

If that's the case, then wouldn't it be better to use lconv and gcovr as a key for dependency?

FindAutoDeps doesn't work with boost 1.71

Hello, I caught an error when using mrt_cmake_modules and lanelet2.

I could build lanelet2_core if I manually remove boost from ${DEPENDEND_PACKAGES}, but when other packages (e.g. lanelet2_io) call AutoDeps with lanelet2_core, it causes the error again.

I'd appreciate it if you give me any information to solve this problem.

Environment

  • Ubuntu 20.04
  • ROS Noetic
  • Python 3.8.2
  • CMake 3.16.3

Problem

FindAutoDeps causes an error because of boost_signals which was deleted and replaced by boost_signals2 at v1.69.

https://www.boost.org/users/history/version_1_69_0.html

$ colcon build 
Starting >>> mrt_cmake_modules
Finished <<< mrt_cmake_modules [0.21s]                                
Starting >>> lanelet2_core
--- stderr: lanelet2_core                          
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
  Could not find a package configuration file provided by "boost_signals"
  (requested version 1.71.0) with any of the following names:

    boost_signalsConfig.cmake
    boost_signals-config.cmake

  Add the installation prefix of "boost_signals" to CMAKE_PREFIX_PATH or set
  "boost_signals_DIR" to a directory containing one of the above files.  If
  "boost_signals" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
  /usr/share/cmake-3.16/Modules/FindBoost.cmake:443 (find_package)
  /home/kenji/lanelet2_ws/install/mrt_cmake_modules/share/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:196 (find_package)
  /home/kenji/lanelet2_ws/install/mrt_cmake_modules/share/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:253 (_find_dep)
  CMakeLists.txt:21 (find_package)


make: *** [Makefile:1328: cmake_check_build_system] Error 1
---
Failed   <<< lanelet2_core	[ Exited with code 2 ]

Summary: 1 package finished [0.89s]
  1 package failed: lanelet2_core
  1 package had stderr output: lanelet2_core
  9 packages not processed

How to reproduce the problem

mkdir ~/lanelet2_ws/src
cd ~/lanelet2_ws/src
git clone [email protected]:odel4y/mrt_cmake_modules.git # https://github.com/KIT-MRT/mrt_cmake_modules/pull/13
git clone [email protected]:fzi-forschungszentrum-informatik/Lanelet2.git

cd ~/lanelet2_ws
colcon build --packages-up-to lanelet2_core
# Fail

cd src/lanelet2
patch -p1 < lanelet2_patch.txt # See attached

cd ~/lanelet2_ws
colcon build --packages-up-to lanelet2_core
# Success

colcon build --packages-up-to lanelet2_io
# Fail

lanelet2_patch.txt

python script not installed in ROS1

I have been using the lanelet2_interface_ros (available here) package which is using mrt_cmake_modules for building. I noticed that the python scripts are no longer being installed with the recent changes to this package. Specifically, the latest commit that worked for me is 604ef7a.

There has been no significant change in lanelet2_interface_ros to warrant this behaviour, so I think the source of the issue would be here. It would be great if you would let me know if there has now been a change to the behaviour of mrt_install(PROGRAMS scripts) such that I would need to do something else to install the python scripts or perhaps this is a bug.

I apologise if I have misunderstood something. Do let me know if you need further clarification of this issue. Thanks for the great package!

Error: "add_action_files() directory not found", but msg and srv building fine

The ros package has the following structure:

custom_msg_pkg
├── CMakeLists.txt  
├── package.xml                               
├── action
│   └── some_action.action                 # Action files
├── srv
│   └── some_service.srv                 # Service files
├── msg
│   └── some_message.msg                 # Messages files 

When building (catkin build custom_msg_pkg) I'm getting the following error:

Errors     << custom_msg_pkg:check /home/user/catkin_ws/logs/custom_msg_pkg/build.check.003.log                                                                                                                                                                   
CMake Error at /opt/ros/melodic/share/actionlib_msgs/cmake/actionlib_msgs-extras.cmake:20 (message):
  add_action_files() directory not found:
  /home/user/catkin_ws/src/project/custom_msg_pkg//home/user/catkin_ws/src/project/custom_msg_pkg/action
Call Stack (most recent call first):
  /opt/ros/melodic/share/mrt_cmake_modules/cmake/mrt_cmake_modules-macros.cmake:429 (add_action_files)
  CMakeLists.txt:46 (mrt_add_action_files)


make: *** [cmake_check_build_system] Error 1
cd /home/user/catkin_ws/build/custom_msg_pkg; catkin build --get-env custom_msg_pkg | catkin env -si  /usr/bin/make cmake_check_build_system; cd -
.......................................................................................................................................................................................................................................................
Failed     << custom_msg_pkg:check          [ Exited with code 2 ]                                                                                                                                                                                           
Failed    <<< custom_msg_pkg                [ 0.6 seconds ]                                                                                                                                                                                                  
[build] Summary: 0 of 1 packages succeeded.                                                                                                                                                                                                            
[build]   Ignored:   22 packages were skipped or are blacklisted.                                                                                                                                                                                      
[build]   Warnings:  None.                                                                                                                                                                                                                             
[build]   Abandoned: None.                                                                                                                                                                                                                             
[build]   Failed:    1 packages failed.                                                                                                                                                                                                                
[build] Runtime: 0.7 seconds total.  

If I comment out mrt_add_action_files(action) in CMakeLists.txt everything builds fine.

Does it have to do something with this difference:

if(_ROS_SERVICE_FILES)
add_service_files(FILES ${_ROS_SERVICE_FILES} DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/${folder_name}")

vs.

if(_ROS_ACTION_FILES)
add_action_files(FILES ${_ROS_ACTION_FILES} DIRECTORY "${folder_name}")

CMAKE_NO_SYSTEM_FROM_IMPORTED

The following line is creating problems in my project: https://github.com/KIT-MRT/mrt_cmake_modules/blob/master/cmake/mrt_cmake_modules-macros.cmake#L26

This tells CMake that all imported targets should have their INTERFACE_INCLUDE_DIRECTORIES not treated as SYSTEM-includes. This generates large amounts of warnings for me with other third-party software, e.g. Eigen or libtorch, when using stricter global compiler warning settings. I don't think a package like mrt_cmake_modules should set/override such global CMake settings. Maybe there is a better solution for this? My current workaround is to restore the default using set(CMAKE_NO_SYSTEM_FROM_IMPORTED NO) after importing mrt_cmake_modules (which is an implicit dependency of lanelet2 in my case).

AutoDeps would not work with ninja.

Hi,

I am trying to build lanelet2-traffic-rules in the yocto project and found AutoDeps could not find lanelet2_core even recipe declare already its dependency to the recipe. yocto use ninja for generating Makefile and use ament_cmake.

error message is

| CMake Error at /home/bchoi/nvidia-yocto-bsp/official_ros_humble_build/bchoi-build/tmp/work/armv8a-poky-linux/lanelet2-traffic-rules/1.2.1-1-r0/recipe-sysroot-native/usr/share/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:176 (message):
|   Package lanelet2_core was not found.  If it is a catkin package: Make sure
|   it is present.  If it is an external package: Make sure it is listed in
|   mrt_cmake_modules/yaml/cmake.yaml!
| Call Stack (most recent call first):
|   /home/bchoi/nvidia-yocto-bsp/official_ros_humble_build/bchoi-build/tmp/work/armv8a-poky-linux/lanelet2-traffic-rules/1.2.1-1-r0/recipe-sysroot-native/usr/share/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:253 (_find_dep)
|   CMakeLists.txt:22 (find_package)

I'd appreciate you if you give me information to resolve it.

BR,
Mark

Many libraries in one package

Hi,

Do I understand correctly that with default mrt CmakeList in one package there can be only either one library or a lot of nodes/nodeletes? And to create more than one library in the package, I need to modify Cmake? In general, I already did this, I just want to understand if I'm correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.