Open vaaaaanquish opened 3 years ago
emsdk version
seems to be the cause.
In the docker container, I ran the following. So it worked.
$ git clone https://github.com/emscripten-core/emsdk.git
$ cd emsdk
$ ./emsdk install 1.39.12
$ ./emsdk activate 1.39.12
$ source "/src/emsdk/emsdk_env.sh"
$ em++ --version
cache:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/src/emsdk/upstream/emscripten/cache/is_vanilla.txt" for subsequent builds)
cache:INFO: - ok
emcc (Emscripten gcc/clang-like replacement) 1.39.12
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ git clone https://github.com/facebookresearch/fastText.git
$ cd fastText
$ make wasm
...
$ ls webassembly/
README.md doc fasttext.js fasttext_wasm.cc fasttext_wasm.js fasttext_wasm.wasm
I'm trying to figure out which specific feature updates are causing the problem...
We explored. Does not work emsdk>=2.0.4
It looks like the following.
- Stop including
malloc
andfree
by default. If you need access to them from JS, you must export them manually using-s EXPORTED_FUNCTIONS=['_malloc', ..]
.
emsdk release note: https://emscripten.org/docs/introducing_emscripten/release_notes.html emsdk's Q&A: https://emscripten.org/docs/getting_started/FAQ.html#why-do-functions-in-my-c-c-source-code-vanish-when-i-compile-to-javascript-and-or-i-get-no-functions-to-process
We explored. Does not work
emsdk>=2.0.4
- emsdk=="2.0.3" : success
- emsdk=="2.0.4" : faild
I confirm that doing
./emsdk install 2.0.3
cd ..
cd fastText
make clean
make wasm
it works!
...
em++: warning: assuming object file output, based on output filename alone. Add an explict `-c`, `-r` or `-shared` to avoid this warning [-Wemcc]
em++ --bind --std=c++11 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['addOnPostRun', 'FS']" -s "DISABLE_EXCEPTION_CATCHING=0" -s "EXCEPTION_DEBUG=1" -s "FORCE_FILESYSTEM=1" -s "MODULARIZE=1" -s "EXPORT_ES6=1" -s 'EXPORT_NAME="FastTextModule"' -Isrc/ webassembly/fasttext_wasm.cc -o main.bc
em++: warning: assuming object file output, based on output filename alone. Add an explict `-c`, `-r` or `-shared` to avoid this warning [-Wemcc]
em++ --bind --std=c++11 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['addOnPostRun', 'FS']" -s "DISABLE_EXCEPTION_CATCHING=0" -s "EXCEPTION_DEBUG=1" -s "FORCE_FILESYSTEM=1" -s "MODULARIZE=1" -s "EXPORT_ES6=1" -s 'EXPORT_NAME="FastTextModule"' -Isrc/ args.bc autotune.bc matrix.bc dictionary.bc loss.bc productquantizer.bc densematrix.bc quantmatrix.bc vector.bc model.bc utils.bc meter.bc fasttext.bc main.bc -o webassembly/fasttext_wasm.js
mbploreto:fastText loretoparisi$ cd webassembly/
mbploreto:webassembly loretoparisi$ ls
README.md doc fasttext.js fasttext_wasm.cc fasttext_wasm.js fasttext_wasm.wasm
Does anyone know What would be the modification to the Makefile
in order to be able to use the latest version of emscripten
?
Perhaps, it need to add an -s EXPORTED_FUNCTION
Makefile
https://github.com/facebookresearch/fastText/blob/master/Makefile#L76
@searleser97 @loretoparisi @Celebio Thx for response. #1227 solved the problem.
@vaaaaanquish welcome, btw I put the pre-built WASM here in FastText.js
@loretoparisi Great works! It would be nice to have a link in the documentation
Hi. I couldn't get WASM to work.
In local OSX.
In Container.
output:
callapsible
Is there a docker image or something that guarantees that master can build?