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

Failed to build datrie #3579

Closed
CarlosBrys opened this issue Nov 8, 2024 · 4 comments
Closed

Failed to build datrie #3579

CarlosBrys opened this issue Nov 8, 2024 · 4 comments

Comments

@CarlosBrys
Copy link

Cannot complete manual installation on Ubuntu 24.10

Building wheels for collected packages: datrie
Building wheel for datrie (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for datrie (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [94 lines of output]
/tmp/pip-build-env-1vomqlx_/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
running bdist_wheel
running build
running build_clib
building 'datrie' library
creating build/temp.linux-x86_64-cpython-312/libdatrie/datrie
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -Ilibdatrie -c libdatrie/datrie/alpha-map.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/alpha-map.o
libdatrie/datrie/alpha-map.c: In function ‘alpha_map_char_to_trie’:
libdatrie/datrie/alpha-map.c:500:21: warning: comparison of integer expressions of different signedness: ‘TrieIndex’ {aka ‘int’} and ‘AlphaChar’ {aka ‘unsigned int’} [-Wsign-compare]
500 | if (alpha_begin <= ac && ac <= alpha_map->alpha_end)
| ^~
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -Ilibdatrie -c libdatrie/datrie/darray.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/darray.o
libdatrie/datrie/darray.c: In function ‘da_fread’:
libdatrie/datrie/darray.c:239:22: warning: comparison of integer expressions of different signedness: ‘TrieIndex’ {aka ‘int’} and ‘long unsigned int’ [-Wsign-compare]
239 | if (d->num_cells > SIZE_MAX / sizeof (DACell))
| ^
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -Ilibdatrie -c libdatrie/datrie/dstring.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/dstring.o
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -Ilibdatrie -c libdatrie/datrie/fileutils.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/fileutils.o
libdatrie/datrie/fileutils.c: In function ‘file_read_chars’:
libdatrie/datrie/fileutils.c:103:52: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
103 | return (fread (buff, sizeof (char), len, file) == len);
| ^~
libdatrie/datrie/fileutils.c: In function ‘file_write_chars’:
libdatrie/datrie/fileutils.c:109:53: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
109 | return (fwrite (buff, sizeof (char), len, file) == len);
| ^~
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -Ilibdatrie -c libdatrie/datrie/tail.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/tail.o
libdatrie/datrie/tail.c: In function ‘tail_fread’:
libdatrie/datrie/tail.c:144:22: warning: comparison of integer expressions of different signedness: ‘TrieIndex’ {aka ‘int’} and ‘long unsigned int’ [-Wsign-compare]
144 | if (t->num_tails > SIZE_MAX / sizeof (TailBlock))
| ^
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -Ilibdatrie -c libdatrie/datrie/trie-string.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/trie-string.o
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -Ilibdatrie -c libdatrie/datrie/trie.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/trie.o
x86_64-linux-gnu-gcc-ar rcs build/temp.linux-x86_64-cpython-312/libdatrie.a build/temp.linux-x86_64-cpython-312/libdatrie/datrie/alpha-map.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/darray.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/dstring.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/fileutils.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/tail.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/trie-string.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/trie.o
running build_ext
building 'datrie' extension
creating build/temp.linux-x86_64-cpython-312/src
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -Ilibdatrie -I/srv/nominatim/nominatim-venv/include -I/usr/include/python3.12 -c src/datrie.c -o build/temp.linux-x86_64-cpython-312/src/datrie.o
src/datrie.c: In function ‘pyx_pf_6datrie_8BaseTrie___init’:
src/datrie.c:5669:53: error: passing argument 1 of ‘trie_new’ from incompatible pointer type [-Wincompatible-pointer-types]
5669 | __pyx_v_self->_c_trie = trie_new(__pyx_v_alpha_map->_c_alpha_map);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
| |
| struct AlphaMap *
In file included from src/datrie.c:1248:
src/../libdatrie/datrie/trie.h:120:35: note: expected ‘const AlphaMap *’ {aka ‘const struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
120 | Trie * trie_new (const AlphaMap *alpha_map);
| ~~~~~~~~~~~~~~~~^~~~~~~~~
src/datrie.c: In function ‘__pyx_pf_6datrie_8BaseTrie_6clear’:
src/datrie.c:6347:47: error: passing argument 1 of ‘trie_new’ from incompatible pointer type [-Wincompatible-pointer-types]
6347 | __pyx_v__c_trie = trie_new(__pyx_v_alpha_map->_c_alpha_map);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
| |
| struct AlphaMap *
src/../libdatrie/datrie/trie.h:120:35: note: expected ‘const AlphaMap *’ {aka ‘const struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
120 | Trie * trie_new (const AlphaMap *alpha_map);
| ~~~~~~~~~~~~~~~~^~~~~~~~~
src/datrie.c: In function ‘pyx_pf_6datrie_8AlphaMap___cinit’:
src/datrie.c:27405:30: error: assignment to ‘struct AlphaMap *’ from incompatible pointer type ‘AlphaMap *’ {aka ‘struct _AlphaMap *’} [-Wincompatible-pointer-types]
27405 | __pyx_v_self->_c_alpha_map = alpha_map_new();
| ^
src/datrie.c: In function ‘pyx_pf_6datrie_8AlphaMap_2__dealloc’:
src/datrie.c:27461:32: error: passing argument 1 of ‘alpha_map_free’ from incompatible pointer type [-Wincompatible-pointer-types]
27461 | alpha_map_free(__pyx_v_self->_c_alpha_map);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~
| |
| struct AlphaMap *
In file included from src/datrie.c:1247:
src/../libdatrie/datrie/alpha-map.h:72:39: note: expected ‘AlphaMap *’ {aka ‘struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
72 | void alpha_map_free (AlphaMap *alpha_map);
| ~~~~~~~~~~^~~~~~~~~
src/datrie.c: In function ‘__pyx_f_6datrie_8AlphaMap_copy’:
src/datrie.c:27876:61: error: passing argument 1 of ‘alpha_map_clone’ from incompatible pointer type [-Wincompatible-pointer-types]
27876 | __pyx_v_clone->_c_alpha_map = alpha_map_clone(__pyx_v_self->_c_alpha_map);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~
| |
| struct AlphaMap *
src/../libdatrie/datrie/alpha-map.h:70:46: note: expected ‘const AlphaMap *’ {aka ‘const struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
70 | AlphaMap * alpha_map_clone (const AlphaMap *a_map);
| ~~~~~~~~~~~~~~~~^~~~~
src/datrie.c:27876:31: error: assignment to ‘struct AlphaMap *’ from incompatible pointer type ‘AlphaMap *’ {aka ‘struct _AlphaMap *’} [-Wincompatible-pointer-types]
27876 | __pyx_v_clone->_c_alpha_map = alpha_map_clone(__pyx_v_self->_c_alpha_map);
| ^
src/datrie.c: In function ‘__pyx_f_6datrie_8AlphaMap__add_range’:
src/datrie.c:28567:50: error: passing argument 1 of ‘alpha_map_add_range’ from incompatible pointer type [-Wincompatible-pointer-types]
28567 | __pyx_v_code = alpha_map_add_range(__pyx_v_self->_c_alpha_map, __pyx_v_begin, __pyx_v_end);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~
| |
| struct AlphaMap *
src/../libdatrie/datrie/alpha-map.h:74:45: note: expected ‘AlphaMap *’ {aka ‘struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
74 | int alpha_map_add_range (AlphaMap *alpha_map,
| ~~~~~~~~~~~^~~~~~~~~
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for datrie
Failed to build datrie
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (datrie)

@lonvia
Copy link
Member

lonvia commented Nov 8, 2024

Duplicate of #3534.

As a work-around, you can allow system packages in your virtualenv and use the python3-datrie package that ships with Ubuntu.

@lonvia lonvia closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2024
@lonvia
Copy link
Member

lonvia commented Nov 8, 2024

Or try the workaround from pytries/datrie#101 (comment)

@CarlosBrys
Copy link
Author

The problem appears here:
https://nominatim.org/release-docs/latest/admin/Install-on-Ubuntu-24/#building-and-configuration

Now you can install the lastest version of Nominatim using pip:
$USERHOME/nominatim-venv/bin/pip install nominatim-db

@lonvia
Copy link
Member

lonvia commented Nov 8, 2024

These instructions are for Ubuntu 24.04 LTS.

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

2 participants