|
| 1 | +--- |
| 2 | +title: Setting Up Zenoh on Arm Devices |
| 3 | +weight: 3 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +## Setting Up Zenoh on Arm Devices |
| 10 | + |
| 11 | +The following instructions are verified on both Raspberry Pi 4/5 and Arm Virtual Hardware, but you can implement them on any Cortex-A Linux device. |
| 12 | + |
| 13 | +Before building Zenoh, make sure your system has the necessary development tools and runtime libraries. |
| 14 | + |
| 15 | +### Install the Rust build environment |
| 16 | + |
| 17 | +First, we need to install the [Rust](https://www.rust-lang.org/) build environment, since the core of Zenoh is totally developed using Rust to keep it safe and efficient. |
| 18 | + |
| 19 | +Follow this [installation guide](https://learn.arm.com/install-guides/rust/) to install Rust and Cargo on Arm Linux, a build system for Rust. Or, simply use the following commands. |
| 20 | + |
| 21 | +```bash |
| 22 | +curl https://sh.rustup.rs -sSf | sh |
| 23 | +``` |
| 24 | + |
| 25 | +Follow the prompts to complete the installation. If successful, you’ll see: |
| 26 | + |
| 27 | +```output |
| 28 | +Rust is installed now. Great! |
| 29 | +``` |
| 30 | + |
| 31 | +For more details, refer to [Rust’s official install guide.](https://doc.rust-lang.org/cargo/getting-started/installation.html#install-rust-and-cargo) |
| 32 | + |
| 33 | +### Install ROS 2 |
| 34 | + |
| 35 | +[Robot Operating System](https://www.ros.org/) is a set of software libraries and tools that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it's all open source. |
| 36 | + |
| 37 | +Since ROS was started in 2007, a lot has changed in the robotics and ROS community. The goal of the [ROS 2](https://docs.ros.org/en/rolling/index.html) project is to adapt to these changes, leveraging what is great about ROS 1 and improving what isn’t. |
| 38 | + |
| 39 | +Here is the quick [installation guide](https://learn.arm.com/install-guides/ros2/) about how to install ROS 2 in Arm platform. |
| 40 | + |
| 41 | +### Download and build the Zenoh source |
| 42 | + |
| 43 | +Now, we can clone the Zenoh. |
| 44 | + |
| 45 | +```bash |
| 46 | +cd ~ |
| 47 | +git clone https://github.com/eclipse-zenoh/zenoh.git |
| 48 | +``` |
| 49 | + |
| 50 | +After that, simply use cargo to build the source. |
| 51 | + |
| 52 | +```bash |
| 53 | +cd zenoh |
| 54 | +cargo build --release --all-targets -j $(nproc) |
| 55 | +``` |
| 56 | + |
| 57 | +This will take several minutes depending on your device. Once the installation is complete, you should see: |
| 58 | + |
| 59 | +```output |
| 60 | +cargo build --release --all-targets -j $(nproc) |
| 61 | + Updating crates.io index |
| 62 | + Downloaded humantime v2.2.0 |
| 63 | + Downloaded spin v0.10.0 |
| 64 | + Downloaded crossbeam-channel v0.5.14 |
| 65 | + Downloaded uhlc v0.8.1 |
| 66 | + Downloaded 4 crates (182.5 KB) in 2.19s |
| 67 | +warning: output filename collision. |
| 68 | +The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`. |
| 69 | +Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so |
| 70 | +The targets should have unique names. |
| 71 | +Consider changing their names to be unique or compiling them separately. |
| 72 | +This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>. |
| 73 | +warning: output filename collision. |
| 74 | +The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`. |
| 75 | +Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so.dwp |
| 76 | +The targets should have unique names. |
| 77 | +Consider changing their names to be unique or compiling them separately. |
| 78 | +This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>. |
| 79 | +warning: output filename collision. |
| 80 | +The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`. |
| 81 | +Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.rlib |
| 82 | +The targets should have unique names. |
| 83 | +Consider changing their names to be unique or compiling them separately. |
| 84 | +This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>. |
| 85 | + Compiling proc-macro2 v1.0.86 |
| 86 | + Compiling unicode-ident v1.0.13 |
| 87 | + Compiling libc v0.2.158 |
| 88 | + Compiling version_check v0.9.5 |
| 89 | + Compiling autocfg v1.3.0 |
| 90 | +... |
| 91 | + Compiling zenoh-link-quic v1.4.0 (/home/ubuntu/zenoh/io/zenoh-links/zenoh-link-quic) |
| 92 | + Compiling zenoh_backend_traits v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-backend-traits) |
| 93 | + Compiling zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager) |
| 94 | + Compiling zenoh-ext v1.4.0 (/home/ubuntu/zenoh/zenoh-ext) |
| 95 | + Compiling zenoh-ext-examples v1.4.0 (/home/ubuntu/zenoh/zenoh-ext/examples) |
| 96 | + Compiling zenoh-plugin-example v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-example) |
| 97 | + Compiling zenoh-backend-example v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-backend-example) |
| 98 | + Finished `release` profile [optimized] target(s) in 6m 28s |
| 99 | +``` |
| 100 | + |
| 101 | +After the build process, the binary executables will be stored under the directory of `~/zenoh/target/release/examples/`. |
| 102 | + |
| 103 | +{{% notice Note %}} |
| 104 | +Installation time may vary depending on your device’s processing power. |
| 105 | +{{% /notice %}} |
| 106 | + |
| 107 | +With Zenoh successfully compiled, you’re ready to explore how nodes communicate using the Zenoh runtime. |
0 commit comments