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

InstallationTroubleshooting 編譯安裝遇到問題匯總
git clone https://github.com/mapnik/mapnik.git
安裝必要的依賴
yum install boost-devel postgresql-devel proj-devel proj-epsg
擴(kuò)展需要的依賴
yum install sqlite-devel libpng-devel libtiff-devel libjpeg-devel libicu-devel
編譯的時(shí)候,官方需求最少要有5GB(for g++)的內(nèi)存,對(duì)于小內(nèi)存的用戶(我當(dāng)時(shí)只有2G)可能會(huì)出現(xiàn)內(nèi)存不夠而異常退出的情況,如果出現(xiàn)以下狀況而退出的話:
g++: internal compiler error: Killed (program cc1plus)
我們可以臨時(shí)增加磁盤交換空間來臨時(shí)解決該問題
sudo dd if=/dev/zero of=/swapfile bs=64M count=16 sudo mkswap /swapfile sudo swapon /swapfile
然后在編譯完成后,在恢復(fù)到之前的狀態(tài)
sudo swapoff /swapfile sudo rm /swapfile
開始編譯
./configure make make install
中間會(huì)出現(xiàn)錯(cuò)誤如:
編譯一下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
簡單測(cè)試
python import mapnik
如果出現(xiàn)類似的錯(cuò)誤
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
添加一行內(nèi)容: /usr/local/lib
然后保存退出,同時(shí)執(zhí)行一下
ldconfig
如果沒有問題的話可以試一下渲染demo,會(huì)生成一些不同品質(zhì)不同格式的圖片demo文件
python demo/python/rundemo.py
相關(guān)文章
手動(dòng)編譯安裝Linux網(wǎng)卡驅(qū)動(dòng)
以D-Link530的網(wǎng)卡進(jìn)行模塊的編譯. 由于Linux的默認(rèn)內(nèi)核已經(jīng)建立很多網(wǎng)卡驅(qū)動(dòng)程序模塊,所以在編譯網(wǎng)卡模塊之前就要確認(rèn)網(wǎng)卡芯片是否被支持,如果被支持,就不需要編譯模塊.2008-09-08Linux系統(tǒng)下編譯安裝支持NTFS的內(nèi)核模塊
當(dāng)你安裝完Linux系統(tǒng),并且已經(jīng)啟動(dòng),恭喜你!如果你的硬盤上還安裝了WinNT/2000系統(tǒng),你試圖去訪問另一個(gè)NTFS分區(qū)時(shí)卻遇到了麻煩。因?yàn)槟闼玫腖inux系統(tǒng)沒有已編譯的支持2008-09-08CentOS 6.4下編譯安裝MySQL 5.6.14詳細(xì)步驟
CentOS 6.4下通過yum安裝的MySQL是5.1版的,比較老,那我們就通過源代碼安裝高版本的MySQL5.6.14。2013-10-24RHEL 7.0 編譯安裝Nginx1.6.0+MySQL5.6.19+PHP5.5.14運(yùn)行環(huán)境
這篇文章主要介紹了RHEL 7.0 編譯安裝Nginx1.6.0+MySQL5.6.19+PHP5.5.14運(yùn)行環(huán)境,需要的朋友可以參考下2014-07-20在CentOS系統(tǒng)中編譯安裝Hiawatha服務(wù)器的教程
這篇文章主要介紹了在CentOS系統(tǒng)中編譯安裝Hiawatha服務(wù)器的教程,包括相關(guān)的PHP連接設(shè)置,需要的朋友可以參考下2015-06-29- iptables是Linux上常用的防火墻軟件,下面說一下iptables的安裝、清除iptables規(guī)則、iptables只開放指定端口、iptables屏蔽指定ip、ip段及解封、刪除已添加的iptables規(guī)則2012-12-24
CentOS安裝rpm包時(shí)遇到Header V3 DSA signature: NOKEY時(shí)解決辦法
linux/centos Header V3 DSA signature: NOKEY, key ID 錯(cuò)誤解決方法,需要的朋友可以參考下。2010-10-17解決linux系統(tǒng)CentOS下調(diào)整home和根分區(qū)大小的方法
在使用linux的過程中, 有時(shí)會(huì)出現(xiàn)因?yàn)榘惭b系統(tǒng)時(shí)分區(qū)不當(dāng)導(dǎo)致有的分區(qū)空間不足,而有的分區(qū)空間過剩的情況.下面本文將講述解決linux系統(tǒng)CentOS下調(diào)整home和根分區(qū)大小的方法2014-10-14linux系統(tǒng)中批量查找文件與文件內(nèi)容的方法
在linux中查看與修改文件權(quán)限我們都必須使用命令來操作,不能像windows一樣點(diǎn)幾下就好了,下面我們簡單的介紹一下linux中的相關(guān)命令2012-12-24