黑松山资源网 Design By www.paidiu.com
InstallationTroubleshooting 编译安装遇到问题汇总
git clone https://github.com/mapnik/mapnik.git
安装必要的依赖
yum install boost-devel postgresql-devel proj-devel proj-epsg
扩展需要的依赖
yum install sqlite-devel libpng-devel libtiff-devel libjpeg-devel libicu-devel
编译的时候,官方需求最少要有5GB(for g++)的内存,对于小内存的用户(我当时只有2G)可能会出现内存不够而异常退出的情况,如果出现以下状况而退出的话:
g++: internal compiler error: Killed (program cc1plus)
我们可以临时增加磁盘交换空间来临时解决该问题
sudo dd if=/dev/zero of=/swapfile bs=64M count=16 sudo mkswap /swapfile sudo swapon /swapfile
然后在编译完成后,在恢复到之前的状态
sudo swapoff /swapfile sudo rm /swapfile
开始编译
./configure make make install
中间会出现错误如:
编译一下harfbuzz 参照如下修改
Harfbuzz not found
$ brew install harfbuzz ... $ ./configure ... Checking for C++ library harfbuzz... no Could not find required header or shared library for harfbuzz ... Exiting... the following required dependencies were not found: - harfbuzz (HarfBuzz text shaping library | configure with HB_LIBS & HB_INCLUDES)
Solution: HB_LIBS and HB_INCLUDES are directories, not cflags/ldflags, and HB_INCLUDES needs not to include the “harfbuzz” directory itself. If pkg-config says:
$ pkg-config --libs --cflags harfbuzz -I/usr/local/Cellar/harfbuzz/0.9.35_1/include/harfbuzz -L/usr/local/Cellar/harfbuzz/0.9.35_1/lib -lharfbuzz
what you actually need is 修改配置文件为,直接指定HB_LIBS,HB_INCLUDES
$ ./configure HB_LIBS=/usr/local/Cellar/harfbuzz/0.9.35_1/lib HB_INCLUDES=/usr/local/Cellar/harfbuzz/0.9.35_1/include
简单测试
python import mapnik
如果出现类似的错误
ImportError: libmapnik.so.3.0: cannot open shared object file: No such file or directory
需要手工添加一下so的位置
vim /etc/ld.so.conf.d/mapnik-x86_64.conf
添加一行内容: /usr/local/lib
然后保存退出,同时执行一下
ldconfig
如果没有问题的话可以试一下渲染demo,会生成一些不同品质不同格式的图片demo文件
python demo/python/rundemo.py
黑松山资源网 Design By www.paidiu.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
黑松山资源网 Design By www.paidiu.com
暂无评论...
更新日志
2024年10月11日
2024年10月11日
- 邰肇玫.1981-雪歌(滚石25周年经典复刻系列)【滚石】【WAV+CUE】
- 《Duck Side of the Moon》特色玩法介绍
- 《刀郎 辉煌10年绝版珍藏 3CD》[WAV/分轨][1.6GB]
- 《张韶涵 全面沦陷》[WAV/分轨][370MB]
- 《极品汽车音乐 三十而立 一起走过的岁月 2CD》[WAV/分轨][990MB]
- 周冰倩1997-珍藏精选-真的好想你[WAV+CUE]
- 许廷铿2017《THEULTIMATECOLLECTION》2CD[星梦娱乐][WAV+CUE]
- 徐小明1983-再向虎山行(LP版)[文志][WAV+CUE]
- 《黑神话:悟空》石双双COS热潮持续升温 丝袜你喜欢么
- Qiddiya IRL游戏之旅在东京电玩展重磅登场
- 北京首家任天堂Switch体验店开业:国行机立减200元
- 张秀卿.1999-赢【神采】【WAV+CUE】
- 群星.1977-多多宝丽多(LP版)【宝丽金】【WAV+CUE】
- 刘德华.1989-永远...记得你(2012金碟复刻版)【EMI百代】【WAV+CUE】
- 《维纳斯璀璨假期死或生Xtreme》游戏特色玩法