Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imprecise Custom Build Instructions #49

Open
faddah opened this issue May 31, 2018 · 4 comments
Open

Imprecise Custom Build Instructions #49

faddah opened this issue May 31, 2018 · 4 comments

Comments

@faddah
Copy link

faddah commented May 31, 2018

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 —

$ ./autogen.sh
$ emconfigure ./configure --disable-shared

...both worked fine for me. However, when I tried to do —

$ emmake make

... after that, it went through a whole bunch of make file stuff, several pages in my terminal, then failed with the following —

...
...
libtool: link: /Users/faddah/Documents/thecyrkus-code/emsdk/emscripten/1.38.4/emar cru .libs/libgnutools.a  dirname-lgpl.o basename-lgpl.o stripslash.o getprogname.o progname.o unistd.o unistr/u16-mbtoucr.o unistr/u16-to-u8.o unistr/u32-to-u8.o unistr/u8-uctomb.o unistr/u8-uctomb-aux.o version-etc.o error.o getopt.o getopt1.o
libtool: link: /Users/faddah/Documents/thecyrkus-code/emsdk/emscripten/1.38.4/emranlib .libs/libgnutools.a
libtool: link: ( cd ".libs" && rm -f "libgnutools.la" && ln -s "../libgnutools.la" "libgnutools.la" )
Making all in lou_maketable.d
make[2]: Nothing to be done for `all'.
/Users/faddah/Documents/thecyrkus-code/emsdk/emscripten/1.38.4/emcc -DHAVE_CONFIG_H -I. -I../liblouis  -Wall -Wextra -Wno-override-init -I../liblouis -I../tools/gnulib -I../tools/gnulib    -MT lou_allround.o -MD -MP -MF .deps/lou_allround.Tpo -c -o lou_allround.o lou_allround.c
warning: unknown warning option '-Wno-override-init'; did you mean '-Wno-override-module'? [-Wunknown-warning-option]
In file included from lou_allround.c:29:
../liblouis/liblouis.h:230:11: warning: 'used' attribute ignored [-Wignored-attributes]
                char **(EXPORT_CALL *resolver)(const char *table, const char *base));
                        ^
../liblouis/liblouis.h:56:21: note: expanded from macro 'EXPORT_CALL'
#define EXPORT_CALL EMSCRIPTEN_KEEPALIVE
                    ^
/Users/faddah/Documents/thecyrkus-code/emsdk/emscripten/1.38.4/system/include/emscripten/emscripten.h:58:45: note: expanded from macro
      'EMSCRIPTEN_KEEPALIVE'
#define EMSCRIPTEN_KEEPALIVE __attribute__((used))
                                            ^
2 warnings generated.
mv -f .deps/lou_allround.Tpo .deps/lou_allround.Po
make[2]: *** No rule to make target `../tools/libbrlcheck.la', needed by `lou_allround'.  Stop.
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

... 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.

@andersryanc
Copy link

Looks like this might be related to: liblouis/liblouis#544

@andersryanc
Copy link

andersryanc commented Jun 14, 2018

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

screen shot 2018-06-14 at 3 38 49 pm

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

screen shot 2018-06-14 at 3 41 56 pm

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'
)

@reiner-dolp
Copy link
Collaborator

reiner-dolp commented Nov 26, 2018

Summary of this thread:

  • The custom build instructions are missing some paths and should 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
  • 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 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

@reiner-dolp reiner-dolp changed the title compiling latest liblouis tables, emmake fails: *** No rule to make target ../tools/libbrlcheck.la', needed by lou_allround'. Stop. Imprecise Custom Build Instructions Nov 26, 2018
@andersryanc
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants