Giter VIP home page Giter VIP logo

wamr-app-framework's Introduction

WebAssembly Micro Runtime Application Framework

Guide  Website  Chat

Use WAMR-App-framework | Samples

WebAssembly Micro Runtime Application Framework (WAMR-App-framework) is a comprehensive framework for programming WebAssembly (Wasm) applications for device and IoT usages. The framework supports running multiple applications, that are based on the event driven programming model.

It includes a few parts as below:

  • App-framework: A framework for supporting APIs for the Wasm applications, and it include same app library:

  • App-manager: a framework for dynamical loading the Wasm module remotely

  • Useful components and tools for building real solutions with WAMR-App-framework

    • Component-test: A test suite to verify the basic components of WAMR work well in combination.
    • IoT-APP-Store-Demo: A demo of Wasm application management portal for WAMR
    • Assembly-script on WAMR: A project based on Wasm Micro Runtime (WAMR) and AssemblyScript. It implements some of the wamr app framework in assemblyscript, which allows you to write some applications in assemblyscript and dynamically installed on WAMR Runtime
    • WAMR-SDK: The WAMR SDK tools is helpful to integrate WAMR with your project and generate APP SDK for developing WASM apps. It supports menu configuration for selecting WAMR components and builds the WAMR to a SDK package that includes runtime SDK and APP SDK.

Getting started

  • Just try this sample: simple

License

WAMR-App-framework uses the same license as LLVM: the Apache 2.0 license with the LLVM exception. See the LICENSE file for details. This license allows you to freely use, modify, distribute and sell your own products based on WAMR. Any contributions you make will be under the same license.

More resources

wamr-app-framework's People

Contributors

wenyongh avatar fromliqg avatar tianlongliang avatar

Stargazers

 avatar Serg Alex avatar JUNSEO PARK avatar  avatar Elias Estrada avatar Chaturved Degloorkar avatar Wang Xin avatar  avatar Solomon Avraam avatar

Watchers

Till Schneidereit avatar Bobby Holley avatar Gordon Smith avatar Han Wu avatar Wang Xin avatar  avatar  avatar

wamr-app-framework's Issues

Encountered compilation errors while building app manager for Zephyr

Hello, I'm attempting to adapt the simple sample to function as a Zephyr app directly, without utilizing wasm-micro-runtime as a module. However, during this process, I encountered 2 issues:

wasm_runtime_lookup_function


Since this commit the wasm_runtime_lookup_function definition has changed:

wasm_runtime_lookup_function(WASMModuleInstanceCommon *const module_inst,
-                             const char *name, const char *signature)
+                             const char *name)

So it need to be fixed in app-mgr/app-manager/module_wasm_app.c

diff --git a/app-mgr/app-manager/module_wasm_app.c b/app-mgr/app-manager/module_wasm_app.c
index 6fd929b..979a3f3 100644
--- a/app-mgr/app-manager/module_wasm_app.c
+++ b/app-mgr/app-manager/module_wasm_app.c
@@ -193,9 +193,9 @@ app_manager_lookup_function(const wasm_module_inst_t module_inst,
 {
     wasm_function_inst_t func;

-    func = wasm_runtime_lookup_function(module_inst, name, signature);
+    func = wasm_runtime_lookup_function(module_inst, name);
     if (!func && name[0] == '_')
-        func = wasm_runtime_lookup_function(module_inst, name + 1, signature);
+        func = wasm_runtime_lookup_function(module_inst, name + 1);
     return func;
 }

📄: Notes: May be removing the const char *signature argument need to be done for app_manager_lookup_function, but I didn't go that far.

The host-tool build Policy


In the CMakeList.txt, it's hardcoded in a way that we need to clone the repo with submodules. I also saw that a PR is open to address this issue but it's a month old.

22 set (IWASM_DIR  ${REPO_ROOT_DIR}/deps/wasm-micro-runtime/core/iwasm)
24 set (SHARED_DIR ${REPO_ROOT_DIR}/deps/wasm-micro-runtime/core/shared)

But In my case I have a fork of wasm-micro-runtime and I want to use this environment. So this cause this kind of errors when I build:

CMake Error at CMakeLists.txt:49 (include):
  include could not find requested file:

    /home/user/wamr-app-framework/test-tools/host-tool/../../deps/wasm-micro-runtime/core/shared/platform/linux/shared_platform.cmake


CMake Error at CMakeLists.txt:50 (include):
  include could not find requested file:

    /home/user/wamr-app-framework/test-tools/host-tool/../../deps/wasm-micro-runtime/core/shared/utils/shared_utils.cmake


CMake Error at CMakeLists.txt:51 (include):
  include could not find requested file:

    /home/user/wamr-app-framework/test-tools/host-tool/../../deps/wasm-micro-runtime/core/shared/mem-alloc/mem_alloc.cmake


CMake Error at CMakeLists.txt:53 (include):
  include could not find requested file:

    /home/user/wamr-app-framework/test-tools/host-tool/../../deps/wasm-micro-runtime/core/shared/coap/lib_coap.cmake

📄: Notes: I commented my implementation, that why the lines correspond to nothing, but the errors come from:

31 include (${SHARED_DIR}/platform/${WAMR_BUILD_PLATFORM}/shared_platform.cmake)
32 include (${SHARED_DIR}/utils/shared_utils.cmake)
33 include (${SHARED_DIR}/mem-alloc/mem_alloc.cmake)
35 include (${SHARED_DIR}/coap/lib_coap.cmake)

So I propose to change the build policy to something like that:

# Treatment for SHARED_DIR and IWASM_DIR 
# if:
#     1. WAMR_ROOT_DIR or WAMR_DIR are set in the env 
#     2. The submodules exist. 
# else: 
#     Throw an error message
if(DEFINED ENV{WAMR_ROOT_DIR})
    set(CORE_DIR $ENV{WAMR_ROOT_DIR}/core)
elseif(DEFINED ENV{WAMR_DIR})
    set(CORE_DIR $ENV{WAMR_DIR/core})
elseif(IS_DIRECTORY ${REPO_ROOT_DIR}/deps/wasm-micro-runtime/core/)
    set(CORE_DIR ${REPO_ROOT_DIR}/deps/wasm-micro-runtime/core/)
else()
    message(FATAL_ERROR "'WAMR_ROOT_DIR' or 'WAMR_DIR' environment variables are not set and\
                         the directory '${REPO_ROOT_DIR}/deps/wasm-micro-runtime/core/' does not exist.\
                         Please set one of these environment variables or clone the git repository with submodules.")
endif()

set(IWASM_DIR  ${CORE_DIR}/iwasm)
set(SHARED_DIR ${CORE_DIR}/shared)

📄: Notes: The WAMR_ROOT_DIR or WAMR_DIR could be set in an other CMakeList.txt file, exported in a .sh, or passed as command line parameters.

I'm also quite interested in the setup used for the app-manager demo on Zephyr, because I'm able to make it compile but it doesn't work as expected, and the readme doesn't really detail this aspect. Should I open an issue on wasm-micro-runtime or pass by another mean of communication ?

running error in ARM-JIT

Hello,

I am trying to run an ARM-JIT runtime targeting Littlevgl.

Hello, I want to run Littlevgl with AARCH64 JIT. After cross-compiling from x86 to AARCH64, I encountered the following error when executing the program.

image

Is there a way to resolve this issue?

thank you

@wenyongh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.