1

Following the indications found here: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-ubuntu-22-04-lts/ I'm trying to install Tile Server in Ubuntu 22.04

but I'm getting this error:

raphy@pc:~$ sudo -u _renderd osm2pgsql -d gis --create --slim  -G --hstore --tag-transform-script ./OSM_src/openstreetmap-carto/openstreetmap-carto.lua -C 2500 --number-processes 1 -S ./OSM_src/openstreetmap-carto/openstreetmap-carto.style ./OSM_src/data/azerbaijan-latest.osm.pbf
osm2pgsql: error while loading shared libraries: libboost_filesystem.so.1.71.0: cannot open shared object file: No such file or directory

The libboost library present is 1.74.0:

raphy@pc:~$ sudo apt install libboost-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libboost-dev is already the newest version (1.74.0.3ubuntu7).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

raphy@pc:/usr/lib/x86_64-linux-gnu$ ls -lah | grep libboost_filesystem.so
lrwxrwxrwx   1 root root    29 mar 16  2022 libboost_filesystem.so -> libboost_filesystem.so.1.74.0
-rw-r--r--   1 root root  123K mar 16  2022 libboost_filesystem.so.1.74.0

Following the indications found here: https://askubuntu.com/questions/950313/how-to-set-ld-library-path-permanently I've set in .bashrc file:

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libboost_filesystem.so"

And, following the indications found here: https://serverfault.com/questions/201709/how-to-set-ld-library-path-in-ubuntu I've set /etc/ld.so.conf.d/libboost.conf as :

/usr/lib/x86_64-linux-gnu/libboost_filesystem.so

And then

sudo ldconfig

But still get the error:

osm2pgsql: error while loading shared libraries: libboost_filesystem.so.1.71.0: cannot open shared object file: No such file or directory

How to solve the problem?

Raphael10
  • 2,508
  • 7
  • 22
  • 50
  • As 1.74 != 1.71, you need to recompile with the version you have now, or at least install the 1.71 run-time (which `apt` may then remove later thinking no _declared_ package uses it). And more refined (but involved) solution is to create a package for `oms2pgsql` with a dependency on 1.71. – Dirk Eddelbuettel Oct 09 '22 at 14:31
  • @DirkEddelbuettel how to recompile with the present version 1.74, if I installed `osm2pgsql` with `sudo apt install` via Ubuntu repo, following the indications here: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-ubuntu-22-04-lts/ ? – Raphael10 Oct 09 '22 at 14:37
  • Hm, maybe something is then not quite right with that package because from what you write it seems to a) require 1.71 and b) not depend on it which would be wrong. Sadly I do not have the time to debug this for you now but maybe you can get in touch with the authors of that piece. But to illustrate, on my 22.04 I still have one boost sub-library of the 1.65 installed because something else must be requiring it. The rest is 1.74 here too and all official package are properly rebuilt for it. – Dirk Eddelbuettel Oct 09 '22 at 14:40
  • 1
    @DirkEddelbuettel I'm trying to understand if I could compile the `osm2pgsl` library with `libboost-1.74.0` version: https://github.com/openstreetmap/osm2pgsql – Raphael10 Oct 09 '22 at 14:51
  • Generally, yes. Just install the appropriate `-dev` package, or the catch-all `libboost-all-dev`, and follow the instructions. As time passed since that tutorial was written, you may "simply" end up with 1.74 dependencies where it wrote about 1.71. Boost is fairly stable at the interfaces so it should just work. – Dirk Eddelbuettel Oct 09 '22 at 15:03
  • @DirkEddelbuettel just tried to, but in the `make` phase: make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libboost_system.so.1.74.0', needed by 'osm2pgsql'. Stop. – Raphael10 Oct 09 '22 at 15:06
  • You don't have `libboost-system-dev` install. Maybe make it simpler and install `libboost-all-dev` to be covered. Then retry (make sure to remove temporaries and earlier config leftover from that build.) – Dirk Eddelbuettel Oct 09 '22 at 15:33
  • @DirkEddelbuettel raphy@pc:~$ sudo apt install libboost-all-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done libboost-all-dev is already the newest version (1.74.0.3ubuntu7). – Raphael10 Oct 09 '22 at 15:37
  • 1
    Then you need to debug the Makefile above. Write a five-liner in C that tries to instantiate an object from that Boost library. If that works outside of the osm project there may be a problem there. On normal systems all this tends to just work. Good luck. – Dirk Eddelbuettel Oct 09 '22 at 15:47
  • This is actually what I'm doing . Thank you very mych @DirkEddelbuettel for your kind support – Raphael10 Oct 09 '22 at 15:50
  • @DirkEddelbuettel with `set(Boost_INCLUDE_DIR,"/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.74.0")` in `CmakeLists.txt` it still says: `No rule to make target '/usr/lib/x86_64-linux-gnu/libboost_system.so.1.74.0', needed by 'osm2pgsql'. Stop` – Raphael10 Oct 09 '22 at 15:54

0 Answers0