Mininet: Cannot find required executable controller 问题解决方法

本文介绍了在使用Mininet过程中遇到的控制器配置问题及其解决方案。当尝试创建网络时,系统无法找到所需的控制器可执行文件。文章提供了一个简单的命令来解决这个问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题

当我运行mininet时,出现以下问题:

***Creating network
***Adding controller
***Adding hosts:
h1 h2 h3 h4 h5
***Adding switches:
s1
***Adding links:
(h1, s1) (h2, s1) (h3, s1) (h4, s1) (h5, s1)
***Configuring hosts
h1 h2 h3 h4 h5
***Starting controller
Cannot find required executable controller.
Please make sure that it is installed and available in your $PATH:
(/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)

解决

运行以下命令:

sudo ln /usr/bin/ovs-controller /usr/bin/controller

即可解决。

Make Error at oryxbot_cruise_ex/CMakeLists.txt:76 (add_executable): Cannot find source file: src/pid_controller.cpp Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx CMake Warning (dev) at oryxbot_description/CMakeLists.txt:62 (add_dependencies): Policy CMP0046 is not set: Error on non-existent dependency in add_dependencies. Run "cmake --help-policy CMP0046" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The dependency target "swiftpro_control_generate_messages_cpp" of target "pose_swiftpro" does not exist. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at oryxbot_description/CMakeLists.txt:63 (add_dependencies): Policy CMP0046 is not set: Error on non-existent dependency in add_dependencies. Run "cmake --help-policy CMP0046" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The dependency target "swiftpro_control_generate_messages_cpp" of target "pick_ar_gazebo" does not exist. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at oryxbot_description/CMakeLists.txt:61 (add_dependencies): Policy CMP0046 is not set: Error on non-existent dependency in add_dependencies. Run "cmake --help-policy CMP0046" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The dependency target "swiftpro_control_generate_messages_cpp" of target "simple_picker" does not exist. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at oryxbot_description/CMakeLists.txt:59 (add_dependencies): Policy CMP0046 is not set: Error on non-existent dependency in add_dependencies. Run "cmake --help-policy CMP0046" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The dependency target "swiftpro_control_generate_messages_cpp" of target "ik_swiftpro" does not exist. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at oryxbot_description/CMakeLists.txt:58 (add_dependencies): Policy CMP0046 is not set: Error on non-existent dependency in add_dependencies. Run "cmake --help-policy CMP0046" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The dependency target "swiftpro_control_generate_messages_cpp" of target "fk_swiftpro" does not exist. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at oryxbot_description/CMakeLists.txt:60 (add_dependencies): Policy CMP0046 is not set: Error on non-existent dependency in add_dependencies. Run "cmake --help-policy CMP0046" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The dependency target "swiftpro_control_generate_messages_cpp" of target "home_pose" does not exist. This warning is for project developers. Use -Wno-dev to suppress it. CMake Error: CMake can not determine linker language for target: oryxbot_cruise_ex_node CMake Error: Cannot determine link language for target "oryxbot_cruise_ex_node". -- Generating done -- Build files have been written to: /home/bobac3/ros_workspace/build Makefile:2896: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1 Invoking "make cmake_check_build_system" failed
最新发布
06-29
### 关于无法找到CMake可执行文件的解决方案 当出现 `RuntimeError: Cannot find CMake executable` 的错误时,通常是因为系统未能正确识别或定位到CMake的安装路径。以下是可能的原因以及对应的解决方法: #### 1. **未安装CMake** 如果尚未安装CMake,则需要通过官方渠道获取并完成安装过程。可以从[CMake官网](https://cmake.org/download/)下载适合操作系统的版本,并按照说明进行安装[^1]。 #### 2. **环境变量配置不正确** 即使已经安装了CMake,但如果其安装目录未被加入到系统的PATH环境变量中,也会导致此问题。可以通过以下方式验证和修复: - 验证命令:在终端输入 `cmake --version` 来确认是否能找到CMake。 - 如果返回提示“command not found”,则需手动将CMake的bin目录添加至PATH环境变量中。例如,在Linux/MacOS上可以编辑 `.bashrc` 或 `.zshrc` 文件,添加如下内容: ```bash export PATH=/path/to/cmake/bin:$PATH ``` 然后运行 `source ~/.bashrc` 更新设置。 #### 3. **多版本冲突** 存在多个不同版本的CMake可能导致优先级混乱,进而引发上述错误。建议清理掉不必要的旧版CMake残留文件后再重新部署新版本。 #### 4. **特定场景下的额外处理** 对于某些特殊开发框架(如Sharp库),除了基本的CMake配置外还需要关注其他关联因素。比如Python解释器缺失会间接影响到CMake调用链路正常运作的情况。此时应参照具体文档指引调整相关参数或者预置条件。例如针对Sharp安装失败案例提到的方法——借助Node.js工具集来全局安装必要的构建支持组件[^4]: ```javascript npm install --global --production windows-build-tools ``` 综上所述,通过逐一排查以上几个方面应该能够有效应对因找不到CMake而导致的各种异常状况。 ```python import os print(os.getenv('PATH')) # 查看当前PATH环境变量内容 ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值