Help us shape the future of Go! Take the 2026 Go Developer Survey

WasmEdge-go

module
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2021 License: Apache-2.0

README

WasmEdge for Go Package

The WasmEdge (formerly SSVM) is a high performance WebAssembly runtime optimized for server side applications. This project provides a golang package for accessing to WasmEdge.

Getting Started

The WasmEdge-go requires golang version >= 1.15. Please check your golang version before installation. Developers can download golang here.

$ go version
go version go1.16.5 linux/amd64

By default, the WasmEdge-go only turns on the basic runtime, and the Installation of WasmEdge Shared Library is required.

Install the WasmEdge-go package and build in your Go project directory:

$ go get github.com/second-state/WasmEdge-go
$ go build

WasmEdge-go has the following extensions:

Users can also turn on the multiple extensions when building:

$ go build -tags image,tensorflow

For examples, please refer to the example repository.

WasmEdge shared library installation

For Ubuntu or Debian:

$ wget https://github.com/WasmEdge/WasmEdge/releases/download/0.8.2/WasmEdge-0.8.2.deb
$ sudo dpkg -i WasmEdge-0.8.2.deb

Or running the script:

$ wget https://github.com/second-state/WasmEdge-go/releases/download/v0.8.2/install_wasmedge.sh
$ sudo ./install_wasmedge.sh /usr/local

WasmEdge-tensorflow shared library installation

$ wget https://github.com/second-state/WasmEdge-go/releases/download/v0.8.2/install_wasmedge_tensorflow_deps.sh
$ wget https://github.com/second-state/WasmEdge-go/releases/download/v0.8.2/install_wasmedge_tensorflow.sh
$ sudo ./install_wasmedge_tensorflow_deps.sh /usr/local
$ sudo ./install_wasmedge_tensorflow.sh /usr/local

WasmEdge-image shared library installation

When linking with Wasmedge-image, libjpeg.so.8 and libpng16.so.16 are required.

For ubuntu 18.04 or later, the following commands can install these dependencies:

$ sudo apt-get update
$ sudo apt-get install -y libjpeg-dev libpng-dev

Or you can download and install the pre-built shared libraries for the manylinux1 platforms:

$ wget https://github.com/second-state/WasmEdge-go/releases/download/v0.8.2/install_wasmedge_image_deps.sh
$ sudo ./install_wasmedge_image_deps.sh /usr/local

Finally, install the WasmEdge-image:

$ wget https://github.com/second-state/WasmEdge-go/releases/download/v0.8.2/install_wasmedge_image.sh
$ sudo ./install_wasmedge_image.sh /usr/local

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL