CentOS 7: When building Mapnik, the configure step does not find optional dependencies like libpng-devel, libjpeg-devel, etc
0
votes
1
answer
1889
views
I am trying to build/install Mapnik (3.0.10) on a CentOS 7 system and I am having trouble getting all the dependencies in place and recognized.
I have installed gcc/g++ compiler from the gcc6 series to ensure c++14 support, which Mapnik needs. If I point directly to my new
gcc
and poll its version I get this:
[root@raven ~]# /usr/local/bin/gcc --version
gcc (GCC) 6.5.0
Copyright (C) 2017 Free Software Foundat/..snip..
Next I temporarily overrode the $CC
and $CXX
environment variables so the updated compiler would be used for subsequent builds, then I installed Boost 1.69.0 from source, like this. Note that this actually installs a second Boost, so the --prefix
parameter establishes where this alternative Boost will install to:
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
cd /root/downloads
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
tar -xzf boost_1_*
cd boost_1_*
./bootstrap.sh --prefix=/opt/boost
./b2 install --prefix=/opt/boost --with=all
Now, if I check /opt/boost
, I see what I expect..
[root@raven ~]# dir /opt/boost/
include lib
Finally I get to installing Mapnik itself. I'm basically using the approach noted here . However, I've already got several of the dependencies in place due to previously installing GDAL and PostGIS. But, when I run Mapnik's .configure
step, it fails to find my optional dependencies.
For example, I built proj
from source and know exactly where it is..
[root@raven ~]# dir /usr/proj49/
bin include lib share
And ldconfig
finds it too..
[root@raven mapnik-v3.0.10]# ldconfig -p | grep libproj
libproj.so.12 (libc6,x86-64) => /usr/proj49/lib/libproj.so.12
libproj.so.0 (libc6,x86-64) => /lib64/libproj.so.0
libproj.so (libc6,x86-64) => /usr/proj49/lib/libproj.so
libproj.so (libc6,x86-64) => /lib64/libproj.so
So I specify my alternative Boost location as well as PROJ_LIBS
and PROJ_INCLUDES
as .configure
parameters.....but it still fails to find proj
? Here's some abridged output. Note that it finds my Boost, as specified, but it fails to find proj
, in spite of the config params..
[root@raven ~]# cd /root/downloads/mapnik-v3.0.10
[root@raven mapnik-v3.0.10]# ./configure BOOST_LIBS=/opt/boost/lib BOOST_INCLUDES=/opt/boost/includes PROJ_LIBS=/usr/proj49/lib PROJ_INCLUDES=/usr/proj49/include
..snip..
Searching for boost libs and headers... (cached)
Found boost libs: /opt/boost/lib
Found boost headers: /opt/boost/include
Checking for C++ header file boost/version.hpp... yes
Checking for Boost version >= 1.47... yes
Found boost lib version... 1_69
..snip..
Checking for C library proj... no
Could not find optional header or shared library for proj
..snip..
Most of the optional dependencies seem to be similarly overlooked—libpng-devel
, libjpeg-devel
, sqlite3, the tiff stuff, proj, etc. And most of those are package installs, not source builds.
As we'll be using this server for quite some time I would like to have the latest Mapnik with its full complement of support (especially for proj, png, and jpeg). It's especially vexing that my proj
install isn't tying in, because I know exactly where it is and provided Mapnik those parameters.
I apologize for the long noisy read, but does anyone see what I am missing?
[**Update**: 4.24.19 5pm]
Ok, I may have figured it out. I was hoping it had something to do with environment/shell setup, rather than having to build all dependencies from source with the same compiler, and stumbled onto an old post where a "Dom Lehr" recommended modifying the LD_LIBRARY_PATH
environment variable to include specifically /usr/local/lib
. Well, I tried that, and it didn't solve the problem. However, I optimistically expanded the parameter values to include some additional locations, and now I can complete the .configure
step with all dependencies recognized. Here's how I did it..
vi /etc/profile.d/sh.local
# Add colon-separated paths to the LD_LIBRARY_PATH variable like this..
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib64:/usr/lib:/usr/lib64:
I added everything I could think of where I found seemingly related .so files. Save the file, then..
/sbin/ldconfig
ldconfig
Then I logged out of my terminal session and logged back in to refresh the shell. Then double-checked that it worked:
[root@raven mapnik-v3.0.10]# echo $LD_LIBRARY_PATH
/opt/remi/php70/root/usr/lib64::/usr/local/lib:/usr/local/lib64:/usr/lib:/usr/lib64:
It did. So I refreshed my temporary compiler arguments, went to the Mapnik source folder, and re-ran the .configure
instruction, and it worked without issue..
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
cd /root/downloads/mapnik-v3.0.10
./configure BOOST_LIBS=/opt/boost/lib BOOST_INCLUDES=/opt/boost/includes
And it worked. Now, whether it will build without issue is still a mystery, but this seems to have done the trick!
Well I spoke to soon. Now make
fails with..
> >&&’
scons: *** [src/json/mapnik_json_geometry_grammar.o] Error 1
scons: building terminated because of errors.
make: *** [src/json/libmapnik-json.a] Error 2
....which is in-line with a lot of others posts I've found where folks are having trouble with mismatched compiler/dependency issues. Back to the drawing board.
Asked by elrobis
(101 rep)
Apr 24, 2019, 03:44 PM
Last activity: Jun 5, 2025, 03:05 AM
Last activity: Jun 5, 2025, 03:05 AM