国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > CentOS > 正文

CentOS7下編譯安裝Mapnik Mapnik編譯教程

2020-06-21 12:51:29
字體:
來源:轉載
供稿:網友

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 

然后在編譯完成后,在恢復到之前的狀態(tài)

sudo swapoff /swapfile sudo rm /swapfile 

開始編譯

./configure make make install 

中間會出現錯誤如:

mapnik安裝,mapnik編譯教程

編譯一下harfbuzz 參照如下修改

Harfbuzz not found

$ brew install harfbuzz...$ ./configure...Checking for C++ library harfbuzz... noCould 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

然后保存退出,同時執(zhí)行一下

ldconfig 

如果沒有問題的話可以試一下渲染demo,會生成一些不同品質不同格式的圖片demo文件

python demo/python/rundemo.py

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 龙川县| 公安县| 孟村| 海淀区| 合山市| 永德县| 邯郸县| 武山县| 武城县| 上栗县| 临沂市| 磐石市| 开鲁县| 巩留县| 达州市| 浙江省| 神池县| 西华县| 甘泉县| 延寿县| 新兴县| 都安| 灵璧县| 南安市| 翁源县| 施甸县| 宝鸡市| 乐清市| 克拉玛依市| 永胜县| 临泽县| 凌云县| 鹤岗市| 永城市| 平度市| 平定县| 怀远县| 兴业县| 湛江市| 绥棱县| 卢湾区|