Bill Allombert on Mon, 24 Oct 2016 12:16:49 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Compiling PARI/GP for javascript with emscripten


Dear PARI developers,

PARI 2.8.1 has support for being compiled with emscripten to generate javascript,
as used on <http://pari.math.u-bordeaux.fr/gp.html>

You need the emcc compiler and the javascript interpreter node from node.js

Run Configure this way

RUNTEST=node CC=emcc ./Configure --host=javascript-emscripten --graphic=none --time=gettimeofday

To compile, use something like:

make -C Oemscripten-javascript "CC_FLAVOR= -s ALLOW_MEMORY_GROWTH=1 -s PRECISE_I64_MATH=1 -s EXPORTED_FUNCTIONS=[\'_main\',\'_gp_embedded\',\'_gp_embedded_init\']"

You will need both the file Oemscripten-javascript/gp-sta.js and
Oemscripten-javascript/gp-sta.js.mem

Experimental javascript build are available in 
http://pari.math.u-bordeaux.fr/pub/pari/javascript/snapshots

Cheers,
Bill.