在Red Hat Linux上mapnik安装失败

时间:2012-09-14 15:28:36

标签: boost makefile configure mapnik

我只是想在Red Hat Enterprise盒子上安装Python绑定到Mapnik 2.1并在Sage(sagemath.org)中使用它们。这是一台我不能使用yum的公司机器,所以它一直都是tarball,宝贝。

我已经解决了安装依赖项的任何问题并计算出每个配置所需的语法。每次我解决一个问题,还有另一个问题。目前我无法让mapnik configure看到libboost_system.so,它肯定在/ usr / local / lib中,并且有一个从/ usr / lib指向它的符号链接。

细节:

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

(早些时候我已经完成了直接的./b2来安装所有提升 - 回过头来使用上面的网页说明以这种方式重新安装部分提升:)

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

现在尝试安装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

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

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

(相同的结果)

"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)...

注意:将在没有这些可选依赖项的情况下构建:

  • boost_regex_icu(mapnik中的unicode正则表达式支持需要支持可选ICU unicode的libboost_regex。)

  • 卷曲(“osm”插件需要libcurl - 更多信息:https://github.com/mapnik/mapnik/wiki//OsmPlugin

  • pg_config(pg_config program |尝试设置PG_CONFIG SCons选项)

  • sqlite3(SQLite3 C库|配置SQLITE_LIBS& SQLITE_INCLUDES |更多信息:https://github.com/mapnik/mapnik/wiki//SQLite

  • sqlite_rtree(SQLite插件需要使用RTREE支持构建的libsqlite3(-DSQLITE_ENABLE_RTREE = 1))

  • cairo(使用pkg-config配置开罗C库|尝试设置PKG_CONFIG_PATH SCons选项)

  • pycairo(Python绑定到Cairo库|使用pkg-config配置|尝试设置PKG_CONFIG_PATH SCons选项)

    .sconf_temp / conftest_33:加载共享库时出错:libboost_system.so.1.51.0:无法打开共享对象文件:没有这样的文件或目录 解析mapnik版本遇到问题,回落到2.1.0 检查C头文件Python.h ...是的 绑定Python版本...... 2.7 Python 2.7前缀... /opt/sage-5.2/local Python绑定将安装在... /opt/sage-5.2/local/lib/python2.7/site-packages 配置已完成:运行make以构建或make install“ 使 ” ... / usr / bin / ld:找不到-lsqlite3 collect2:错误:ld返回1退出状态 scons: * [tests / cpp_tests / csv_parse_test-bin]错误1 scons:由于错误导致建筑物终止。 make:* [mapnik]错误2“

但我认为sqlite3是可选的......

我认为sqlite3问题可能是一个红色的鲱鱼。早期的问题是配置阶段没有找到boost_thread。我的系统显示:

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)

所以它真的存在且有效。

只是为了安全(没有帮助)添加了一个符号链接:

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

这很奇怪,因为其他库在同一位置被发现很好。此外,配置阶段在错误之前列出了几行“搜索升级库和头文件...找到库:/ usr / local / lib”

此时,我真的不相信scons。我有另一个问题,mapnik配置阶段找不到库(libproj)。然后它后来说升压版本至少不是1.48。一旦我添加了指向proj .so文件的正确符号链接,关于boost版本的配置错误就消失了。所以我坚持一般规则,你应该专注于发现的第一个错误并解决它。

请注意,Python的非标准位置(PYTHON = / opt / sage-5.2 / local / bin / python)似乎没问题。

查看mapnik日志文件config.log,但没有我能看到的其他信息。检查了网络和github.com/mapnik/mapnik/wiki/InstallationTroubleshooting但没有任何相关性。对不起,很长的帖子,但细节很重要。谢谢你的阅读。

另一条线索可能是:

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

即使上面显示这是正确完成的(?)。

3 个答案:

答案 0 :(得分:3)

Burningbright,

Mapnik用户列表将是一个更好的地方。

无论如何,我认为问题是您没有将系统配置为在/ usr / local / lib中查找库。您需要执行export LD_LIBRARY_PATH=/usr/local/lib,或者需要在/usr/local/lib中添加/etc/ld.so.conf/才能运行ldconfig

可能会造成混淆的小问题:1)您的BOOST_INCLUDES选项错误,应该是BOOST_INCLUDES=/usr/local/include/而不是BOOST_INCLUDES=/usr/local/include/boost。 2)我真的不建议将符号链接到/usr/lib - 这可能会破坏事物是奇怪的方式

另外,尽管配置过程中存在链接错误,但我认为你一般都是oka。与测试的链接错误并不是什么大问题,而且我们需要做出可选的选择。我认为在构建过程中唯一的主要问题是提升链接,这应该是可以解决的。

答案 1 :(得分:0)

我和你有同样的问题,我看到了here

export LD_LIBRARY_PATH=/XXX/lib 

会起作用。

我尝试了它并且对我有用,但我仍然不确定根本原因是什么。

答案 2 :(得分:0)

在Centos 7上构建Mapnik会遇到同样的问题。 Scon给出了关于实际存在的缺失库的误导性错误。

发布一个简单的

export LD_LIBRARY_PATH=/usr/local/lib

解决了所有问题。

应该修复Centos / RHEL上的大量构建,而不仅仅是Mapnik。

相关问题