鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    如何在ros2中使用cuda

    已定时 已固定 已锁定 已移动 已解决
    综合问题
    cuda ros2 galactic cmake colcon build
    2
    3
    455
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 3748703613
      孤独的幸存者
      最后由 编辑

      各位大佬好,现在有个问题,我自己用cmake写了一个cuda的静态库,用来加速处理图像,但是我用cmake编译没有问题,但是使用colcon buildi编译/usr/bin/ld就会报错:找不到静态库里的符号,请问各位大佬有思路解决吗?

      ganyuanzhenG 1 条回复 最后回复 回复 引用 0
      • ganyuanzhenG
        Elysia 技术大佬
        最后由 编辑

        参考 colcon build 的使用帮助

        Arguments for 'cmake' packages:
          --cmake-args [* [* ...]]
                                Pass arguments to CMake projects. Arguments matching other options must be
                                prefixed by a space,
                                e.g. --cmake-args " --help" (stdout might not be shown by default, e.g.
                                add `--event-handlers console_cohesion+`)
          --cmake-target CMAKE_TARGET
                                Build a specific target instead of the default target
          --cmake-target-skip-unavailable
                                Skip building packages which don't have the target passed to --cmake-
                                target
          --cmake-clean-cache   Remove CMake cache before the build (implicitly forcing CMake configure
                                step)
          --cmake-clean-first   Build target 'clean' first, then build (to only clean use '--cmake-target
                                clean')
          --cmake-force-configure
                                Force CMake configure step
        
        Arguments for 'ros.ament_cmake' packages:
          --ament-cmake-args [* [* ...]]
                                Pass arguments to 'ament_cmake' packages. Arguments matching other options
                                must be prefixed by a space
        
        Arguments for 'ros.catkin' packages:
          --catkin-cmake-args [* [* ...]]
                                Pass arguments to 'catkin' packages. Arguments matching other options must
                                be prefixed by a space
          --catkin-skip-building-tests
                                By default the 'tests' target of 'catkin' packages is invoked. If running
                                'colcon test' later isn't intended this can be skipped
        

        比如:

        $ colcon build  --ament-cmake-args -DTEST_PARAM="Test"
        Starting >>> example_ros2_interfaces
        Starting >>> example_cpp
        --- stderr: example_cpp                                                                            
        CMake Error at CMakeLists.txt:9 (message):
          Test param detected! Aborting,
        

        使用了--ament-cmake-args 为cmake指定参数

        我难道就没有一段英勇,美好而又虚幻的过去……幸运地写在金叶片上?

        1 条回复 最后回复 回复 引用 0
        • ganyuanzhenG
          Elysia 技术大佬 @374870361
          最后由 编辑

          可以这样将参数传递给cmake

          我难道就没有一段英勇,美好而又虚幻的过去……幸运地写在金叶片上?

          1 条回复 最后回复 回复 引用 0
          • 3748703613 374870361 将这个主题标记为已解决,在
          • 第一个帖子
            最后一个帖子
          皖ICP备16016415号-7
          Powered by NodeBB | 鱼香ROS