Build from source on MacOS

    • Model:
      • M1
    • Operating System
      • Big Sur
      • Catalina

    If you would like to develop WasmEdge on MacOS, please follow this guide to build and test from source code.

    Requirements and Dependencies

    WasmEdge will try to use the latest LLVM release to create our nightly build. If you want to build from source, you may need to install these dependencies by yourself.

    • LLVM 12.0.0 (>= 10.0.0), installed via brew, please don’t use the built-in one.
    • Because the default version of LLVM on the latest brew is 13. Please use to fix the LLVM version.

    If you don’t want to build Ahead-of-Time runtime/compiler

    WasmEdge provides various tools for enabling different runtime environments for optimal performance. After the build is finished, you can find there are several wasmedge related tools:

    1. wasmedge is for general wasm runtime.
      • wasmedge executes a WASM file in interpreter mode or a compiled WASM dyld file in ahead-of-time compilation mode.
      • To disable building all tools, you can set the CMake option WASMEDGE_BUILD_TOOLS to .
    2. is the WasmEdge C API shared library.
      • libwasmedge_c.dyld provides C API for the ahead-of-time compiler and the WASM runtime.
      • The APIs about the ahead-of-time compiler will always return failed if the CMake option WASMEDGE_BUILD_AOT_RUNTIME is set as OFF.
      • To disable building the shared library only, you can set the CMake option WASMEDGE_BUILD_SHARED_LIB to OFF.

    Run built-in tests

    The following built-in tests are only available when the build flag WASMEDGE_BUILD_TESTS sets to ON.

    Next, follow to run WebAssembly bytecode programs in .

    The following tests can not pass on macos, we are investigating these issues:

    • wasmedgeAPIVMCoreTests
    • wasmedgeAPIStepsCoreTests
    • wasmedgeAPIAOTCoreTests