[SOLVED] Compilation errors while trying to build PyICU in LFS 8.4
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Compilation errors while trying to build PyICU in LFS 8.4
I'm trying to install the genealogical program gramps, which isn't in the book. It's a python 3 program which uses python bindings to various libraries. Two of these, pygobject and pycairo, are in the book. bsddb3 isn't but I was able to build it successfully. pyicu I cannot build. I get these messages
Code:
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/python3.7m -c common.cpp -o build/temp.linux-x86_64-3.7/common.o -DPYICU_VER="1.9.5"
In file included from /usr/include/python3.7m/Python.h:89,
from common.h:33,
from common.cpp:24:
common.cpp: In function ‘PyObject* PyUnicode_FromUnicodeString(const UChar*, int)’:
/usr/include/python3.7m/unicodeobject.h:452:35: error: invalid conversion from Py_UCS2*’ {aka ‘short unsigned int*’} to ‘UChar*’ {aka ‘char16_t*’} [-fpermissiv]
#define PyUnicode_2BYTE_DATA(op) ((Py_UCS2*)PyUnicode_DATA(op))
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
common.cpp:226:22: note: in expansion of macro ‘PyUnicode_2BYTE_DATA’
u_memcpy(PyUnicode_2BYTE_DATA(result), utf16, len16);
^~~~~~~~~~~~~~~~~~~~
In file included from common.cpp:29:
/usr/include/unicode/ustring.h:748:17: note: initializing argument 1 of ‘UChar* u_memcpy_63(UChar*, const UChar*, int32_t)’
u_memcpy(UChar *dest, const UChar *src, int32_t count);
~~~~~~~^~~~
error: command 'gcc' failed with exit status 1
Clearly there are incompatibilities between the code and at least 2 system headers: python3.7m/unicodeobject.h (referenced in Python.h) and unicode/ustring.h. But it's impossible to see from this output which is actually an error. Or perhaps they both are! Usually gcc clearly distinguishes errors from warnings, but not in this case.
Googling suggested adding -std=c++11 to CFLAGS, but I have done the build with and without this and the errors are exactly the same.
In the end I compiled gramps without icu support, but it probably won't handle Polish names very well. I'd like to do it properly.
Gramps has been a python3 program for the last two major releases, so it should be possible to make python3 versions of all the required bindings. But I checked the gramps README again and it turns out that PyICU is optional, though recommended. It's used mainly for sorting in foreign languages and there are internal sorting mechanisms that can be used instead. Gramps gives me a warning about not finding it when I start it up but I can live with that.
I'll check on AntiX and see what apt says about the dependencies of gramps. The gramps slackbuild says you definitely need it.
Hm, interesting. The Debian repo that AntiX uses gives python3-icu as one of the dependencies of gramps. This has libicu57 (the only version of this library in the repository) as a dependency. But on LFS I'm using icu-63. So it seems that if there is an incompatibility, it crept in somewhere between those two icu releases.
I don't think it's worth backporting icu-57 to LFS just to prove a point, given that the icu module is apparently not essential for gramps to function. But would seem to be the solution, so I'll close the thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.