> ( git clone https://github.com/jwasinger/ewasm-precompiles -b ecadd-benchmark && cd ewasm-precompiles && cargo build --target wasm32-unknown-unknown )
> git clone https://github.com/webassembly/wabt
> cd wabt/wasm2c && cp /path/to/ewasm-precompiles/target/wasm32-unknown-unknown/debug/ecadd_benchmark.wasm .
> ( build wabt )
> wasm2c ecadd_benchmark.wasm -o ecadd_benchmark.c
- In the same folder, create a file
main.c
:
#include "ecadd_benchmark.h"
int main(int argc, char** argv) {
init();
Z_ecadd_benchmarkZ_vv();
return 0;
}
Note Z_ecadd_benchmarkZ_vv
will have to be replaced with the mangled name of the exported function in ecadd_benchmark.h
.
- Compile:
gcc -o ecadd_benchmark wasm-rt-impl.c ecadd_benchmark.c main.c
if you don't want to go through most of the steps, you can compile these C files to create the benchmark.