Skip to content

Commit d856eeb

Browse files
committed
Revert "docs: update README"
This reverts commit 33f3806.
1 parent 234690c commit d856eeb

1 file changed

Lines changed: 34 additions & 75 deletions

File tree

README.md

Lines changed: 34 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,28 @@
22

33
The Ocre SDK provides a modular C-based API for building portable embedded applications that compile to WebAssembly. It includes both headers and source files, enabling flexible integration across platforms. This repository also contains a wide range of generic and board-specific examples that demonstrate real-world use cases.
44

5-
All examples are designed to be executed inside the [Ocre Runtime](https://github.com/project-ocre/ocre-runtime), a lightweight WASI-compatible runtime tailored for embedded-style workloads.
5+
All examples are designed to be built using [wasi-sdk](https://github.com/WebAssembly/wasi-sdk) and executed inside the [Ocre Runtime](https://github.com/project-ocre/ocre-runtime), a lightweight WASI-compatible runtime tailored for embedded-style workloads.
66

77
## Repository Structure
8-
98
```
109
├── ocre-api # Core SDK: headers + sources
1110
├── generic # Platform-independent examples
12-
│ ├── blinky, echo-server, filesystem, etc.
13-
│ └── build folders per sample
14-
├── board_specific # Hardware-targeted examples
15-
│ ├── arduino_portenta_h7
11+
│ ├── blinky, echo-server, filesystem, etc.
12+
│ └── build folders per sample
13+
├── board_specific # Hardware-targeted examples
14+
│ ├── arduino_portenta_h7
1615
│ └── b_u585i_iot02a
1716
├── testing # Testing and potentially faulty images.
18-
│ └── return0, return1, pthread, etc.
17+
│ └── return0, return1, pthread, etc.
1918
├── wasm-micro-runtime # External module
2019
```
2120

22-
## Getting Started
23-
24-
### System requirements
21+
Each sample includes:
22+
- CMakeLists.txt for build configuration
23+
- A build/ directory (created during compilation)
24+
- Optional subfolders like src/, fs/, or IMU/ depending on the sample
2525

26-
To build the samples, you need LLVM, LLD, Clang 12+, wasm32 runtime libraries. You also need cmake, make and **\***. Install all on an Ubuntu 22 with:
27-
28-
```sh
29-
sudo apt install \
30-
cmake \
31-
clang \
32-
libclang-rt-dev-wasm32 \
33-
lld \
34-
llvm
35-
```
36-
37-
Alternatively, you can use the Ocre devcontainer. Check Ocre documentation for more information.
26+
## Getting Started
3827

3928
### Clone the Repository
4029

@@ -50,65 +39,40 @@ Or add the SDK as a submodule to your own project:
5039
git submodule add https://github.com/project-ocre/ocre-sdk.git
5140
```
5241

53-
## Set up Sysroot
42+
Make sure the ocre-api folder is accessible to your build system.
5443

55-
The default sysroot can be set up automatically. From the root of this repository:
44+
## Building with wasi-sdk
45+
All examples are designed to compile to .wasm using [wasi-sdk](https://github.com/WebAssembly/wasi-sdk).
5646

57-
```sh
58-
mkdir build
59-
cd build
60-
cmake ..
61-
make sysroot
62-
```
47+
> **Note:** By default, we expect the WASI SDK toolchain file to be located at:
48+
>
49+
> `/opt/wasi-sdk/share/cmake/wasi-sdk.cmake`
50+
>
51+
> This is typically set in each sample's `CMakeLists.txt`. You can modify this path as needed for your environment.
6352
64-
The `sysroot` Make target will download the wasi-sysroot, then compile `lib_socket_ext` and `ocre_api`, and populate them into the `sysroot` directory on the root of this repository.
65-
66-
It is also possible to specify a different WAMR root, used for building `lib_socket_ext`, through the `WAMR_ROOT` CMake variable, if you do not want to use the included git submodule:
67-
68-
```sh
69-
cmake .. -DWAMR_ROOT=~/ocre/wasm-micro-runtime
70-
```
71-
72-
## Build Samples
73-
74-
### From the ocre-sdk build directory
75-
76-
Alternatively, the `all` Make target will build most of the generic samples and testing containers:
77-
78-
```sh
79-
make
80-
```
53+
### Build Instructions
54+
Each sample can be built independently. Here's a generic flow
8155

82-
You can also build a specific sample, for example:
83-
84-
```sh
85-
make hello-world
86-
```
87-
88-
The built files are stord in the `dist` directory inside the current build directory:
89-
90-
```sh
91-
ls dist
56+
```bash
57+
cd generic/blinky
58+
mkdir -p build && cd build
59+
cmake ..
60+
cmake --build .
9261
```
62+
This will generate a .wasm binary in the build/ directory.
9363

94-
### From each sample's directory
64+
Repeat the same process for any other sample—whether under generic/ or board_specific/
9565

96-
Assumming, you already have the sysroot installed into the `sysroot` directory, it is possible to build each sample from their own directory, for example:
66+
## Running with Ocre Runtime
67+
All compiled .wasm samples are compatible with the [Ocre Runtime](https://github.com/project-ocre/ocre-runtime), which provides a lightweight execution environment for WASI modules.
9768

98-
```sh
99-
cd generic/hello-world
100-
mkdir build
101-
cd build
102-
cmake ..
103-
make
69+
Example:
70+
```bash
71+
app build/hello-world.wasm
10472
```
10573

106-
The built file is stored in the current build directory.
107-
10874
## Example Categories
109-
11075
### Generic Samples
111-
11276
- blinky
11377
- hello-world
11478
- echo-server
@@ -117,20 +81,15 @@ The built file is stored in the current build directory.
11781
- messaging: publisher, subscriber, multipublisher-subscriber
11882
- modbus-client
11983
- sensor-rng
120-
12184
### Board-Specific Samples
122-
12385
- arduino_portenta_h7: blinky-h7
12486
- b_u585i_iot02a: sensor, sensor-IMU, modbus-server, blinky-xmas, blinky-u585, blinky-button
125-
These demonstrate hardware-specific integrations while still leveraging the common ocre-api.
126-
87+
These demonstrate hardware-specific integrations while still leveraging the common ocre-api.
12788
## SDK Highlights
128-
12989
- Header and source-based SDK (ocre-api)
13090
- Modular CMake-based build system
13191
- Runtime execution via Ocre Runtime
13292
- Extensible for new boards and applications
13393

13494
## Contributing
135-
13695
Want to add a new board or example? Fork the repo, create your sample under generic/ or board_specific/, and submit a pull request. Contributions are welcome

0 commit comments

Comments
 (0)