Open faddah opened 6 years ago
Looks like this might be related to: https://github.com/liblouis/liblouis/issues/544
Per the suggestion to downgrade automake
in the previously mentioned issue, I was able to get past this error. To downgrade automake:
curl -O -L http://ftpmirror.gnu.org/automake/automake-1.15.1.tar.gz
tar -xzf automake-1.15.1.tar.gz
cd automake-*
./configure
make
sudo make install
Then you need to rerun the build commands from the beginning:
./autogen.sh
emconfigure ./configure --disable-shared
emmake make
...
However, at this point, I found some other bugs / issues with the current docs. In the following command there are references to files within liblouis-js
which are not present based on the first 2 commands to clone liblouis
and cd into that folder:
emcc ./liblouis/.libs/liblouis.a -s RESERVED_FUNCTION_POINTERS=1 -s MODULARIZE=1\
-s EXPORT_NAME="'liblouisBuild'" -s EXTRA_EXPORTED_RUNTIME_METHODS="['FS',\
'Runtime', 'stringToUTF16', 'Pointer_Stringify']" --pre-js ./liblouis-js/inc/pre.js\
--post-js ./liblouis-js/inc/post.js -o build-no-tables.js
To fix this issue, you should add a the following right after the cd into liblouis
:
git clone https://github.com/liblouis/liblouis-js.git
The final line of the script (cat ./inc/append.js >> build-no-tables.js
) also has an error though, where there is a reference to the append.js
file inside liblouis-js
. The emcc
command references it's neighboring files correctly, while this one is missing the liblouis-js
folder at the beginning.
The final corrected build steps would be:
# obtain the latest version
git clone https://github.com/liblouis/liblouis.git
cd liblouis
git clone https://github.com/liblouis/liblouis-js.git
# build
./autogen.sh
emconfigure ./configure --disable-shared
emmake make
emcc ./liblouis/.libs/liblouis.a -s RESERVED_FUNCTION_POINTERS=1 -s MODULARIZE=1\
-s EXPORT_NAME="'liblouisBuild'" -s EXTRA_EXPORTED_RUNTIME_METHODS="['FS',\
'Runtime', 'stringToUTF16', 'Pointer_Stringify']" --pre-js ./liblouis-js/inc/pre.js\
--post-js ./liblouis-js/inc/post.js -o build-no-tables.js
cat ./liblouis-js/inc/append.js >> build-no-tables.js
After all that, I tried to run the compiled file (which I built with the addition of the --embed-file tables
flag to include all the tables files) and I got the following error:
abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") at Error
So, I did what it suggested and modified the emcc
command to the following:
emcc ./liblouis/.libs/liblouis.a -s RESERVED_FUNCTION_POINTERS=1 -s MODULARIZE=1\
-s EXPORT_NAME="'liblouisBuild'" -s EXTRA_EXPORTED_RUNTIME_METHODS="['FS',\
'Runtime', 'ccall', 'stringToUTF16', 'Pointer_Stringify']" --pre-js ./liblouis-js/inc/pre.js\
--post-js ./liblouis-js/inc/post.js -o build-no-tables.js --embed-file tables
but still, I'm getting another error:
abort("Assertion failed: you need to wait for the runtime to be ready (e.g. wait for main() to be called)") at Error
Any ideas? Did I do something wrong in there somewhere? Here is what my liblouis.js
file I'm trying to run looks like:
// ./liblouis.js
const capi = require('./build-all-tables');
var easyapi = require('liblouis/easy-api');
var liblouis = new easyapi.EasyApi(capi);
liblouis.disableOnDemandTableLoading();
liblouis.translateString(
'tables/unicode.dis,tables/en-us-comp8-ext.utb',
'abc'
)
Summary of this thread:
# obtain the latest version
git clone https://github.com/liblouis/liblouis.git
cd liblouis
git clone https://github.com/liblouis/liblouis-js.git
./autogen.sh emconfigure ./configure --disable-shared emmake make
emcc ./liblouis/.libs/liblouis.a -s RESERVED_FUNCTION_POINTERS=1 -s MODULARIZE=1\ -s EXPORT_NAME="'liblouisBuild'" -s EXTRA_EXPORTED_RUNTIME_METHODS="['FS',\ 'Runtime', 'stringToUTF16', 'Pointer_Stringify']" --pre-js ./liblouis-js/inc/pre.js\ --post-js ./liblouis-js/inc/post.js -o build-no-tables.js
cat ./liblouis-js/inc/append.js >> build-no-tables.js
- The unspecified version of emcc used here does not export "ccall" automatically. (since we haven't updated the emcc version used in the CI in years, probably a newer one)
- The last issue `Assertion failed: you need to wait for the runtime to be ready` can be found in the [emcc FAQ](https://kripken.github.io/emscripten-site/docs/getting_started/FAQ.html#how-can-i-tell-when-the-page-is-fully-loaded-and-it-is-safe-to-call-compiled-functions) and has to be ensured by the caller. Otherwise we have to deprecate the synchronous API.
**Actions to be taken:**
- correct custom build instructions
- Update the emscripten version use
Thanks for the update on this. We actually ended up finding another JS based solution without needing to compile our own version... and actually, over the past week or so, we've just decided to switch to using a docker container of the base C library with some custom python scripts integrated into it. Seems like that project gets updated much more frequently, so we thought it would be better to just work with that instead. You can close this issue if you like.
Hello @reiner-dolp ,
Like @evanhackett in his issue here #48, i also tried following the instructions to compile the tables — https://github.com/liblouis/liblouis-js#compiling-the-latest-version-of-liblouis — and the —
...both worked fine for me. However, when I tried to do —
... after that, it went through a whole bunch of make file stuff, several pages in my terminal, then failed with the following —
... so, @reiner-dolp , any suggestion here for getting beyond this error, please? We would rally like to get this working.
Please advise. Thank you in advance for a prompt response.
best,
— faddah portland, oregon, u.s.a.