Question

I'm just trying to get the Python bindings to Mapnik 2.1 installed on a Red Hat Enterprise box and use them in Sage (sagemath.org). This is a company machine where I can't use yum, so it's tarballs all the way, baby.

I've already resolved any number of issues installing the dependencies and working out the syntax I need for each configure. Every time I solve one problem, there is another one. Currently I cannot get mapnik configure to see libboost_system.so, which is definitely in /usr/local/lib and has a symbolic link pointing to it from /usr/lib.

details:

Red Hat Enterprise system:
> more /proc/version
Linux version 2.6.18-92.el5PAE (brewbuilder@hs20-bc2-3.build.redhat.com) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-41)) 
used install directions at github.com/mapnik/mapnik/blob/master/INSTALL.md, github.com/mapnik/mapnik/wiki/Mapnik2 and elsewhere
installed proj 4.8 from tarball using several solutions provided on the web to fix install problems
installed icu4c-4_6 from tarball to /usr/local/...
installed boost 1.51 from tarball pointing to the newly installed icu:
download boost_1_51_0.tar.gz
tar ...
cd boost_1_51_0
./bootstrap.sh

(earlier I had done a straight ./b2 to install everything boost - went back using the above web page instructions to reinstall parts of boost this way:)

sudo ./b2 --with-thread --with-filesystem --with-iostreams --with-python --with-regex -sHAVE_ICU=1 -sICU_PATH=/usr/local/lib --with-program_options --with-system link=shared toolset=gcc stage
sudo ./b2 --with-thread --with-filesystem --with-iostreams --with-python --with-regex -sHAVE_ICU=1 -sICU_PATH=/usr/local/lib --with-program_options --with-system link=shared toolset=gcc install
sudo /sbin/ldconfig

Now try to install mapnik:

download mapnik-v2.1.0.tar.bz2
tar ...
cd ...
./configure PYTHON=/opt/sage-5.2/local/bin/python ICU_LIBS=/usr/local/lib ICU_INCLUDES=/usr/local/include BOOST_INCLUDES=/usr/local/include/boost BOOST_LIBS=/usr/local/lib

or

./configure PYTHON=/opt/sage-5.2/local/bin/python ICU_LIBS=/usr/local/lib ICU_INCLUDES=/usr/local/include

or

./configure PYTHON=/opt/sage-5.2/local/bin/python

(same results)

"scons: Reading SConscript files ...
Welcome to Mapnik...
Configuring build environment...
SCons CONFIG found: 'config.py', variables will be inherited...
Configuring on Linux in *release mode*...
Checking for freetype-config... yes
Checking for xml2-config... yes
Sorting lib and inc compiler paths...(cached) yes
Checking for C library m... yes
Checking for C library ltdl... yes
Checking for C library png... yes
Checking for C library tiff... yes
Checking for C library z... yes
Checking for C library proj... yes
Checking for C++ library icuuc... yes
Checking for C library jpeg... yes
Checking for ICU version >= 4.2... found: icu 4.6
(cached) Searching for boost libs and headers... (cached)
  *libs found: /usr/local/lib
  *headers found: /usr/local/include
  *no lib naming extension found
Checking for Boost version >= 1.47... yes
Found boost lib version... 1_51
Checking for C++ library boost_system... yes
Checking for C++ library boost_filesystem... yes
Checking for C++ library boost_regex... yes
Checking for C++ library boost_program_options... yes
Checking for C++ library boost_thread... yes
.sconf_temp/conftest_18: error while loading shared libraries: libboost_system.so.1.51.0: 
cannot open shared object file: No such file or directory
Checking if boost_regex was built with ICU unicode support... (cached) no
Checking for requested plugins dependencies...
Checking for gdal-config --libs... yes
Checking for gdal-config --cflags... yes
Checking for name of gdal library... gdal
Checking if gdal is ogr enabled... yes
Checking for name of ogr library... gdal
Checking for C library curl... no
Checking for pg_config... error: no result no
Checking for C library sqlite3... no
Checking if SQLite supports RTREE... (cached) no
Checking for pkg-config... yes
Checking for cairo... no
Checking for C++ header file boost/python/detail/config.hpp... yes
Checking for pkg-config... yes
Checking for pycairo... no
All Required dependencies found!
Overwriting and re-saving file 'config.py'...
Will hold custom path variables from commandline and python config file(s)...

Note: will build without these OPTIONAL dependencies:

  • boost_regex_icu (libboost_regex built with optional ICU unicode support is needed for unicode regex support in mapnik.)

  • curl (libcurl is required for the "osm" plugin - more info: https://github.com/mapnik/mapnik/wiki//OsmPlugin)

  • pg_config (pg_config program | try setting PG_CONFIG SCons option)

  • sqlite3 (SQLite3 C Library | configure with SQLITE_LIBS & SQLITE_INCLUDES | more info: https://github.com/mapnik/mapnik/wiki//SQLite)

  • sqlite_rtree (The SQLite plugin requires libsqlite3 built with RTREE support (-DSQLITE_ENABLE_RTREE=1))

  • cairo (Cairo C library | configured using pkg-config | try setting PKG_CONFIG_PATH SCons option)

  • pycairo (Python bindings to Cairo library | configured using pkg-config | try setting PKG_CONFIG_PATH SCons option)

    .sconf_temp/conftest_33: error while loading shared libraries: libboost_system.so.1.51.0: cannot open shared object file: No such file or directory Problem encountered parsing mapnik version, falling back to 2.1.0 Checking for C header file Python.h... yes Bindings Python version... 2.7 Python 2.7 prefix... /opt/sage-5.2/local Python bindings will install in... /opt/sage-5.2/local/lib/python2.7/site-packages Configure completed: run make to build or make install" make "... /usr/bin/ld: cannot find -lsqlite3 collect2: error: ld returned 1 exit status scons: * [tests/cpp_tests/csv_parse_test-bin] Error 1 scons: building terminated because of errors. make: * [mapnik] Error 2"

But I thought sqlite3 was OPTIONAL ...

I think the sqlite3 issue might be a red herring. The earlier problem is that the configure stage did not find boost_thread. My system shows:

ls -l /usr/local/lib/libboost_system.so*
lrwxrwxrwx 1 root root    25 Sep 11 17:40 /usr/local/lib/libboost_system.so -> libboost_system.so.1.51.0
-rwxr-xr-x 1 root root 16898 Sep 11 17:40 /usr/local/lib/libboost_system.so.1.51.0
ldd /usr/local/lib/libboost_system.so.1.51.0
        linux-gate.so.1 =>  (0x005c1000)
        librt.so.1 => /lib/librt.so.1 (0x00cd9000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x002f4000)
        libm.so.6 => /lib/libm.so.6 (0x009e1000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00f82000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00a6a000)
        libc.so.6 => /lib/libc.so.6 (0x00110000)
        /lib/ld-linux.so.2 (0x0050d000)

so it's really there and valid.

And just to be safe (which did not help) added a symbolic link:

ls -l /usr/lib/libboost_system.so
lrwxrwxrwx 1 root root 33 Sep 14 10:16 /usr/lib/libboost_system.so -> /usr/local/lib/libboost_system.so

This is odd since other libraries are being found just fine in the same location. Also, the configure stage stated a few lines before the error that "Searching for boost libs and headers... libs found: /usr/local/lib"

At this point, I don't really trust scons. I had another issue where the mapnik configure stage could not find a library (libproj). Then it later stated that the version of boost was not at least 1.48. As soon as I added the correct symbolic link pointing to the proj .so file, the configure error about the version of boost disappeared. So I'm sticking with the general rule that you should focus on the first error found and solve that one.

Note that the nonstandard location of Python (PYTHON=/opt/sage-5.2/local/bin/python) seems to be OK.

Looking at the mapnik log file config.log, but no additional info that I can see. Checked the web and github.com/mapnik/mapnik/wiki/InstallationTroubleshooting but nothing relevant. Sorry for the long post, but details matter. Thanks for reading.

Another clue might be:

Checking if boost_regex was built with ICU unicode support... (cached) no

even though the above shows that this was done correctly (?).

Était-ce utile?

La solution

Burningbright,

The Mapnik users list would be a better place for this.

Anyway, I think the problem is that you have not configured your system to find libraries in /usr/local/lib. You need to either do export LD_LIBRARY_PATH=/usr/local/lib or you need to add /usr/local/lib into your /etc/ld.so.conf/ before running ldconfig.

Minor issues which may confound things: 1) your BOOST_INCLUDES option is wrong, it should be BOOST_INCLUDES=/usr/local/include/ not BOOST_INCLUDES=/usr/local/include/boost. 2) I really do not recommend symlinking into /usr/lib - that can break things is weird ways

Also, despite the linking errors during the configure, I think you are oka in general. The linking error with the test is not a big deal and likely something we need to make optional. I presume the only major problem during the build will be boost linking, which should be solvable as per above.

Autres conseils

I had the same problem as you, and I saw here that

export LD_LIBRARY_PATH=/XXX/lib 

would work.

I tried it and it worked for me, but I'm still not sure what the root cause is.

Building Mapnik on Centos 7 runs into the same problem. Scon gives misleading errors about missing libs which are actually there.

Issuing a simple

export LD_LIBRARY_PATH=/usr/local/lib

fixed all issues.

Should be a fix for lots of builds on Centos / RHEL , not only Mapnik.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top