2012-09-14 108 views
3

我只是试图将Python绑定到安装在Red Hat Enterprise Box上的Mapnik 2.1中,并在Sage(sagemath.org)中使用它们。这是一台公司机器,我不能使用yum,所以它一路上都是tarball,宝贝。Red Hat Linux上的mapnik安装失败

我已经解决了许多安装依赖关系的问题,并解决了每个配置需要的语法。每次我解决一个问题时,都会有另一个问题。目前我无法将mapnik配置为查看libboost_system.so,它绝对位于/ usr/local/lib中,并且具有指向/ usr/lib的符号链接。

细节:

Red Hat Enterprise system: 
> more /proc/version 
Linux version 2.6.18-92.el5PAE ([email protected]) (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(libboost_regex可选ICU Unicode支持建在mapnik中支持unicode正则表达式支持。 )

  • 卷曲(libcurl中是必需的 “OSM” 插件 - 更多信息:https://github.com/mapnik/mapnik/wiki//OsmPlugin

  • pg_config(pg_config程序|尝试设置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) )

  • 开罗(开罗C库|尝试使用SCons PKG_CONFIG_PATH选项)

  • pycairo(Python绑定设置开罗库| |使用pkg配置配置CON通过使用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 /站点包 配置完成:运行make建立或make install “ 使 ” ...... 在/ usr /斌/劳工处:找不到-lsqlite3 collect2:错误:LD返回1个退出状态 scons的:* [tests/cpp_tests/csv_parse_test-bin]错误1 scons:建筑物由于错误而终止。 化妆:* [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) 

所以它真的存在和有效

而只是为了安全起见(没有不小时。 elp)添加了一个符号链接:

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 

这很奇怪,因为其他库在相同位置被发现很好。另外,配置阶段在“搜索boost库和头文件... libs找到:/ 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 

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

+0

为什么选择投票?这是一个有用的帖子。 –

回答

3

Burningbright,

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

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

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

此外,尽管在配置过程中的链接错误,我认为你一般是oka。与测试的链接错误并不是什么大问题,并且可能是我们需要做出选择的东西。我认为在构建过程中唯一的主要问题是增强联系,这应该可以按照上面的方法解决。

+0

请参阅https://gist.github.com/3427021的第64行,以便将“/ usr/local/lib”添加到系统的库搜索路径。 –

+0

欣赏帮助。我考虑修改/etc/ld.so.conf,但我不应该在这个盒子上碰它,因为我不是IT。添加符号链接只影响我的东西,没有其他人。但是,由于没有其他的工作,我可以验证添加/ usr/local/lib到ld.so.conf工作! (所以如果我失去了我的工作)。由于mapnik日志文件显示正在搜索/ usr/local/lib,并且其他需要位于同一位置的库的mapnik依赖项都可以,但是无论如何,我仍然不太清楚问题所在。 – burningbright

+0

不幸的是,运行make我仍然得到... g ++ -o测试/ cpp_tests/csv_parse_test-bin测试/ cpp_tests/csv_parse_test.o插件/输入/ csv/csv_datasource.o -Ldeps/agg -Lsrc -L/usr/local/lib -L ​​/ usr/lib -lagg -lfreetype -lltdl -lpng -ltiff -lz -lproj -licuuc -lboost_filesystem -lboost_system -lboost_regex -ljpeg -lxml2 -lboost_thread -lmapnik -lsqlite3 /usr/bin/ld:can not找到-lsqlite3 collect2:错误:ld返回1退出状态 scons:*** [tests/cpp_tests/csv_parse_test-bin]错误1 scons:建筑物由于错误而终止。 make:*** [mapnik]错误2 所以它恢复了工作。 – burningbright

0

我有同样的问题,因为你,我看到那个here

export LD_LIBRARY_PATH=/XXX/lib 

会工作。

我试过了,它适用于我,但我仍然不确定根本原因是什么。

0

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

发出一个简单的

export LD_LIBRARY_PATH=/usr/local/lib 

固定的所有问题。

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

相关问题