• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    C++
  • Created over 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

How to build webassembly files with nothing other than standard Clang/llvm.

Webassemly with only Clang 8+ (tested with 11, 14)

I did not find instructions for this anywhere online, so here they are. We can now build small wasm files with nothing other than Clang (e.g. Emscripten is not needed).

  1. Install Clang 8 or later. Linux packages are here.
  2. make
  3. To try the built wasm file, run python3 server.py.

Optional: To disassemble the wasm file, you can install wabt and run make wat.

Docker (not required)

The following command builds an ubuntu:18.04 image containing the dependencies needed to build the working example.

$ docker build -t clang-wasm-ubuntu:18.04 .

Then, you can mount the source files in a container running the image and follow the instructions above.

docker run --rm -it -v`pwd`:/opt/src -w /opt/src -p4242:4242 clang-wasm-ubuntu:18.04

root@74a067d2c9e6:/opt/src# make
.... <snip> ...
root@74a067d2c9e6:/opt/src# python3 server.py
serving at port 4242

More Repositories

1

quickjs

Thin Python wrapper of https://bellard.org/quickjs/
Python
175
star
2

monte-carlo-tree-search

Monte Carlo Tree Search with UCT with a couple of example games.
C++
151
star
3

SuiteSparse

A shallow fork of SuiteSparse adding build files for Visual Studio and support for ACML
C
100
star
4

monolith

A C++ monorepo for discrete and continuous optimization. Batteries included!
Jupyter Notebook
98
star
5

patch-inpainting

Image inpainting using coherency senstitive hashing
MATLAB
52
star
6

spii

A library for unconstrained minimization of smooth functions using Newton's method or L-BFGS.
C++
35
star
7

submodular

Library for minimizing Pseudo-Boolean functions
C++
27
star
8

qepcad

Quantifier Elimination by Partial Cylindrical Algebraic Decomposition
C
24
star
9

realtimechess

In Real-time Chess (or Kung-Fu Chess, Ninja Chess), all pieces can be moved simultaneously!
Python
20
star
10

sexton

Hex editor written in Python
Python
16
star
11

opencv_srgb_gamma

sRGB gamma tranformations in C++ and Python
Jupyter Notebook
16
star
12

easy-IP

C++ modelling library for integer programming
C++
15
star
13

CXSparse

A shallow fork of CXSparse adding build files for Visual Studio
C
14
star
14

surfmex

Extremely simple wrapper around OpenCV for SURF
C++
13
star
15

curve_extraction

C++ shortest path with curvature and torsion taken into account
C++
12
star
16

rapidsvg

Renders SVG files containing lines very quickly.
C++
7
star
17

glpk

A shallow fork of GLPK made re-entrant with CMake build files. Tests pass with Visual Studio, Clang, and GCC.
C
7
star
18

hep-2

HEp-2 Cells Classification
C
6
star
19

reverb

Calculates the room RT60 reverberation time by sending out tones
Python
4
star
20

numpy_display

Formats numpy matrices in an IPython Notebook
Python
2
star
21

wikipedia

Scripts for automated processing of Wikipedia database dumps
Python
2
star
22

surfaces

Curvature regularization for surfaces
C++
1
star
23

emscripten_cmake

A simple example showing how to use Emscripten with CMake
C++
1
star
24

quickcd

Two-hour project: Quick directory switching with statistics and fuzzy matching.
Python
1
star