[Talk-de] Nominatim build fails

Sarah Hoffmann lonvia at denofr.de
Fr Sep 13 13:17:34 UTC 2024


On Fri, Sep 13, 2024 at 01:15:56PM +0200, Dieter Faulbaum wrote:
> 
> ich habe versucht Nominatim 4.5.0 (unter Debian sid) mittels pip zu
> installieren bekomme aber Fehler,
> die ich nicht recht verstehe (ich bin aber mit pip auch noch nicht so recht
> vertraut, die Methode mittels cmake funktioniert):
> 
> Gibt's Ideen, wie ich tun muss, damit es auch per pip funktioniert?

Sieht aus, als wenn das datrie-Paket unter sid nicht mehr compiliert.
Issue dazu: https://github.com/pytries/datrie/issues/101
Leider ist datrie mehr oder weniger unmaintained, so dass das nicht
ganz überraschend kommt. Ich habe mich schon gefragt, ob ich das
irgendwann übernehmen muss.

Du kannst die Pip-Installation zusammen mit dem datrie-Packet von Debian
nutzen:

1. virtualenv erstellen, die Systempakete erlaubt:

      virtualenv --system-site-packages /srv/nominatim-venv

2. datrie via Debian installieren:

      sudo apt-get install python3-datrie

3. Nominatim via pip installieren:

      /srv/nominatim-venv/bin/pip install nominatim-db nominatim-api

Gruss

Sarah


> 
> $ /srv/nominatim-venv/bin/pip install nominatim-db nominatim-api
> Collecting nominatim-db
>  Using cached nominatim_db-4.5.0-py3-none-any.whl.metadata (2.5  kB)
> Collecting nominatim-api
>  Using cached nominatim_api-4.5.0-py3-none-any.whl.metadata (2.1  kB)
> Collecting datrie (from nominatim-db)
>  Using cached datrie-0.8.2.tar.gz (63 kB)
>  Installing build dependencies ... done
>  Getting requirements to build wheel ... done
>  Installing backend dependencies ... done
>  Preparing metadata (pyproject.toml) ... done
> Collecting jinja2 (from nominatim-db)
>  Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
> Collecting psutil (from nominatim-db)
>  Using cached  psutil-6.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
> (21 kB)
> Collecting psycopg (from nominatim-db)
>  Using cached psycopg-3.2.1-py3-none-any.whl.metadata (4.2 kB)
> Collecting pyicu (from nominatim-db)
>  Using cached PyICU-2.13.1-cp312-cp312-linux_x86_64.whl
> Collecting python-dotenv (from nominatim-db)
>  Using cached python_dotenv-1.0.1-py3-none-any.whl.metadata (23  kB)
> Collecting pyyaml>=5.1 (from nominatim-db)
>  Using cached  PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
> (2.1 kB)
> Collecting sqlalchemy>=1.4.31 (from nominatim-api)
>  Using cached  SQLAlchemy-2.0.34-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
> (9.6 kB)
> Collecting typing-extensions>=4.6.0 (from sqlalchemy>=1.4.31->nominatim-api)
>  Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata  (3.0 kB)
> Collecting greenlet!=0.4.17 (from sqlalchemy>=1.4.31->nominatim-api)
>  Using cached  greenlet-3.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata
> (3.8 kB)
> Collecting MarkupSafe>=2.0 (from jinja2->nominatim-db)
>  Using cached  MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
> (3.0 kB)
> Using cached nominatim_db-4.5.0-py3-none-any.whl (15.3 MB)
> Using cached nominatim_api-4.5.0-py3-none-any.whl (501 kB)
> Using cached
> PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (767
> kB)
> Using cached
> SQLAlchemy-2.0.34-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
> (3.2 MB)
> Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
> Using cached psutil-6.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
> (290 kB)
> Using cached psycopg-3.2.1-py3-none-any.whl (197 kB)
> Using cached python_dotenv-1.0.1-py3-none-any.whl (19 kB)
> Using cached
> greenlet-3.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
> (626 kB)
> Using cached
> MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
> (28 kB)
> Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
> 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
>  ╰─> [97 lines of output]
>      /tmp/pip-build-env-0n92bbm0/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
>      creating build/temp.linux-x86_64-cpython-312
>      creating build/temp.linux-x86_64-cpython-312/libdatrie
>      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-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)
> 
> 
> _______________________________________________
> Talk-de mailing list
> Talk-de at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk-de



Mehr Informationen über die Mailingliste Talk-de