CMake Error at python/bindings/CMakeLists.txt:3 (pybind11_add_module): Unknown CMake command “pybind

[Processing: moveit_task_constructor_core] --- stderr: moveit_task_constructor_core Missing content of submodule pybind11: Use 'git clone --recurse-submodule' in future. Checking out content automatically Submodule 'core/python/pybind11' (https://github.com/pybind/pybind11) registered for path 'pybind11' Submodule 'core/src/scope_guard' (https://github.com/ricab/scope_guard) registered for path '../src/scope_guard' Cloning into '/home/jzzz/ws_moveit/src/moveit_task_constructor/core/python/pybind11'... fatal: unable to access 'https://github.com/pybind/pybind11/': GnuTLS recv error (-110): The TLS connection was non-properly terminated. fatal: clone of 'https://github.com/pybind/pybind11' into submodule path '/home/jzzz/ws_moveit/src/moveit_task_constructor/core/python/pybind11' failed Failed to clone 'core/python/pybind11'. Retry scheduled Cloning into '/home/jzzz/ws_moveit/src/moveit_task_constructor/core/src/scope_guard'... fatal: unable to access 'https://github.com/ricab/scope_guard/': Failed to connect to github.com port 443 after 299411 ms: Connection timed out fatal: clone of 'https://github.com/ricab/scope_guard' into submodule path '/home/jzzz/ws_moveit/src/moveit_task_constructor/core/src/scope_guard' failed Failed to clone 'core/src/scope_guard'. Retry scheduled Cloning into '/home/jzzz/ws_moveit/src/moveit_task_constructor/core/python/pybind11'... fatal: unable to access 'https://github.com/pybind/pybind11/': GnuTLS recv error (-110): The TLS connection was non-properly terminated. fatal: clone of 'https://github.com/pybind/pybind11' into submodule path '/home/jzzz/ws_moveit/src/moveit_task_constructor/core/python/pybind11' failed Failed to clone 'core/python/pybind11' a second time, aborting CMake Error at python/CMakeLists.txt:24 (add_subdirectory): The source directory /home/jzzz/ws_moveit/src/moveit_task_constructor/core/python/pybind11 does not contain a CMakeLists.txt file. CMake Error at python/bindings/CMakeLists.txt:3 (pybind11_add_module): Unknown CMake command "pybind11_add_module".

问题的原因:构建系统在尝试自动下载所需的 Git 子模块 (submodules) 时失败了,因为网太差了不稳定。

办法:配置一下国内代理然后重新下这两个下载失败的包就行

打开WSL ,运行以下命令。这会告诉 Git,以后所有访问 https://github.com/ 的请求,都应该自动替换为 https://ghfast.top/https://github.com/

git config --global url."https://ghfast.top/https://github.com/".insteadOf https://github.com/

然后进入包含子模块的主仓库目录:

cd ~/ws_moveit/src/moveit_task_constructor
git submodule update --init --recursive

应该会看到成功下载了 pybind11 和 scope_guard

回到工作空间下然后清除一下之前失败的

rm -rf build/moveit_task_constructor_core install/moveit_task_constructor_core log/moveit_task_constructor_core

然后重新colcon build就行

### 解决Pangolin项目中CMake配置缺失CMakeLists.txt文件的方法 当遇到Pangolin项目的CMake配置缺少`CMakeLists.txt`文件时,可以按照以下方法排查并解决问题。 #### 1. 确认源码目录结构 确保下载的Pangolin源码包完整无误。通常情况下,Pangolin项目的根目录应包含一个名为`CMakeLists.txt`的文件[^2]。如果该文件不存在,则可能是由于以下几个原因: - 下载过程中发生错误,导致部分文件丢失。 - 使用的是不完整的分支或版本。 建议重新克隆官方仓库以获取最新代码: ```bash git clone https://github.com/stevenlovegrove/Pangolin.git cd Pangolin ls CMakeLists.txt ``` #### 2. 配置Eigen库路径 即使存在`CMakeLists.txt`文件,仍可能因依赖项未正确设置而报错。例如,在某些环境中,需手动指定第三方库(如Eigen)的位置。可以通过修改`CMakeLists.txt`来添加必要的头文件路径[^3]。 示例命令如下所示: ```cmake include_directories(/usr/local/include/eigen3) find_package(Eigen3 REQUIRED) if (EIGEN3_FOUND) message(STATUS "Found Eigen version ${EIGEN_VERSION}") endif() ``` 上述脚本片段尝试定位系统中的Eigen安装位置,并将其加入编译器搜索范围。注意替换实际路径至本地环境匹配值。 #### 3. 调整构建工具链参数 有时,默认生成器无法识别特定平台特性。此时可显式声明目标架构及其他选项以便兼容更多场景[^4]。 执行下面指令前先清理旧产物以防干扰新流程: ```bash rm -rf build/ mkdir build && cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DEIGEN3_INCLUDE_DIR=/path/to/eigen3 \ -DPANGOLIN_PYTHON bindings/python/setup.py install --user make -j$(nproc) sudo make install ``` 这里通过传递额外变量给CMake指定了Python绑定支持以及精确版Eigen地址。 --- ### 总结 综上所述,针对"Pangolin cmake configuration missing cmakelists.txt"这一情况可以从三个方面入手分析处理:一是验证资源完整性;二是完善外部组件关联定义;三是优化定制化装配策略。以上措施能够有效缓解乃至彻底消除此类异常现象的发生概率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值