Building Node.js with full-icu on Raspbian

401 views
Skip to first unread message

Koray

unread,
Feb 22, 2018, 10:01:50 AM2/22/18
to ICU support mailing list, nod...@googlegroups.com
Hello,

I need to provide support for ISO-8859-9 (win-1254) in my application.
So instead of default implementation of small-icu, I'm installing my
Node.js with full-icu on my Raspberry Pi which runs Raspbian. However,
when I try to build it, I get the following error:

/home/pi/node/out/Release/.deps//home/pi/node/out/Release/obj.target/icudata/gen/icudt60_dat.o.d.raw
-c -o /home/pi/node/out/Release/obj.target/icudata/gen/icudt60_dat.o
/home/pi/node/out/Release/obj/gen/icudt60_dat.c
virtual memory exhausted: Cannot allocate memory
tools/icu/icudata.target.mk:141: recipe for target
'/home/pi/node/out/Release/obj.target/icudata/gen/icudt60_dat.o'
failed
make[1]: *** [/home/pi/node/out/Release/obj.target/icudata/gen/icudt60_dat.o]
Error 1
rm 6ca5323700f3659317427b41feb126075d0969d9.intermediate
Makefile:90: recipe for target 'node' failed
make: *** [node] Error 2

I have decided to build ICU and then proceed with Node.js building by
providing system-icu as configure arguement. However, I seem to fail
at it as well. The last messages after sudo ./runConfigureICU
Linux/gcc:

make[0]: Making `all' in `test'
make[1]: Entering directory '/home/pi/icu/source/test'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/pi/icu/source/test'
make[1]: Entering directory '/home/pi/icu/source'
Note: rebuild with "make VERBOSE=1 all-local" to show all compiler parameters.
make[1]: Leaving directory '/home/pi/icu/source'

And the sudo make check gives the following error:

./../../bin/uconv: can not initialize ICU. status = U_FILE_ACCESS_ERROR
Makefile:125: recipe for target 'check-local' failed
make[2]: *** [check-local] Error 1
,make[2]: Leaving directory '/home/pi/icu/source/extra/uconv'
Makefile:49: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 2
make[1]: Leaving directory '/home/pi/icu/source/extra'
Makefile:149: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 2

Upon make install, running uconv gives the following error:

uconv: error while loading shared libraries: libicui18n.so.60: cannot
open shared object file: No such file or directory

In the first case of exhaustion of virtual memory, is it possible for
me to get rid of other languages and only build node.js with
ISO-8859-9? If not, how can I build the ICU by itself? My knowledge of
building software and ICU in general ends here, how can I diagnose the
issue?

Please let me know if any other information is needed.
Thank you

Steven R. Loomis

unread,
Feb 22, 2018, 10:22:32 AM2/22/18
to ICU support mailing list, nod...@googlegroups.com
Hello,

1. instead of rebuilding ICU, you can also just supply the full ICU data (you already have the full code) at runtime. See https://nodejs.org/api/intl.html#intl_providing_icu_data_at_runtime and the full-icu npm module.

2. You don't need to run ICU build or check as 'sudo' (in fact I would not recommend it).  Only 'make install' should be needed as sudo.  

3.  The node build of ICU (and possibly the separate build) seems to have failed due to lack of virtual memory. Building ICU data files is memory intensive.

4. The reason uconv failed is probably because the data files failed to build.


Here are my suggestions for you in order:

1. I would investigate the URL above and try using `npm install full-icu` and following the instructions given.

If you are planning to rebuild node,  you can use the system ICU with an ICU from your system - on raspbian, try 'apt-get install libicu-dev' and it will install a pre-built ICU.  configure with system-icu should pick up the system-installed libicu-dev.  (you will need to manually uninstall ICU, especially /usr/local/lib/pkgconfig/*icu*.pc and /usr/local/include/unicode and /usr/local/lib/libicu*

Hope this helps. Replying to both groups because this is relevant both to node and general ICU build.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
icu-support mailing list - icu-s...@lists.sourceforge.net
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support
Archives/Project
Info: http://site.icu-project.org/contacts

Koray

unread,
Mar 3, 2018, 11:55:00 PM3/3/18
to nod...@googlegroups.com
Hello Steven,

Thanks for your response, I have finally managed to solve it. Though
now I am unable to encode strings with encodings that came with ICU.
I'm really confused at this point. util.TextDecoder allows me to
decode strings from win-1254 buffers, however when I try to encode a
String to buffer, I get the error: TypeError: "encoding" must be a
valid string encoding

For the full explanation please see:
https://stackoverflow.com/questions/49086596/is-there-a-native-way-to-encode-strings-with-encodings-of-full-icu

So, do I have to use an external module in order to encode strings
with ICU? If so, what's the point of being able to decode but not
encode using same encodings?

Thank you
Koray
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+un...@googlegroups.com.
> To post to this group, send email to nod...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/CAFYQx%2BDy3TK6GSUUoM5yFao59939Jm8W0g-32U%2Ba04QmnTWrSg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
Reply all
Reply to author
Forward
0 new messages