lazyLoading, Module.FS_createPath not found (emscripten compilation without accoustic model)
Hello,
I have compiled my own pocketsphinx.js and pocketsphinx.wasm version without any accoustic model embedeed, using the following command :
cmake -DWASM=OFF -DEMSCRIPTEN=1 -DHMM_EMBED=OFF -DCMAKE_TOOLCHAIN_FILE=/Users/oscar/Documents/tmp/emsdk/fastcomp/emscripten/cmake/Modules/Platform/Emscripten.cmake ..
I have installed emscripten using this tutorial : https://emscripten.org/docs/getting_started/downloads.html
here is the output of emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.38.36
clang version 6.0.1 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-emscripten--core-emscripten--fastcomp--clang 98df4be387dde3e3918fa5bbb5fc43e1a0e1daac) (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-emscripten--core-emscripten--fastcomp 1b4148f39a69c7fc62edadd85e4122b68694dfb7) (emscripten 1.38.31 : 1.38.31)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Users/oscar/Documents/tmp/emsdk/fastcomp/fastcomp/bin
shared:INFO: (Emscripten: Running sanity checks)
here is my output of cmake --version :
cmake --version
cmake version 3.14.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
I've ended up with two files (note that -DWASM=OFF command line option still gives me a pocketsphinx.wasm) pocketsphinx.js and pocketsphinx.wasm
Next, I've updated the spawnWorker function, according to this doc part to set paths to pocketsphinx.js and pocketsphinx.wasm.
I have also updated my outdated version of recognizer.js with the one given in the webapp example of this repository.
Using breakpoints debugging, I am sure everything went fine, I loads my js files and webassembly with the server.py script at the root of the repository, I doesn't have anymore issues of MIME type or 404 missing ressources. The python simple server logs only successfull HTTP 1.1 GET/ ressources with an error code 200.
After setting my js and webassembly filepaths, I tried to store static files, using the lazyLoad command.
I notice that recognizer.js received well the folders and files data parameters, but wasn't able to create the directory on the webworker's virtual file system, because of the folllowing error :
At line 160 of recognizer.js.
I've opened two pocketsphinx.js different version, the one on the left is my custom without accoustic model embedeed and on the right is the one inside the webapp/js folder on the following screen capture :
As you can see, it seems that emscripten doesn't give me the FS facilities inside my pocketsphinx.js, this is why Recognizer.js isn't able to run it.
Is there a compile option I should use to obtain FS_ facilities inside my module ?
Hi, you can just add -s FORCE_FILESYSTEM=1 to the final linking command (in pocketsphinx.js it's the custom build step at the end) to get them.