Qgis官网编译过程

4星(超过85%的资源)
所需积分/C币:43 2012-09-08 20:06:22 439KB PDF
39
收藏 收藏
举报

这是我学长分享给我,博客还有我的心得,大家可以看看,我经过了4天的编译才成功呀。
4.2.9 Configuration 24 4.2.10 Compilation and installation 24 4.2.11 Run qgis. exe from the directory where it's installed(CMAKE- INSTALL PREFIX)24 4.2.12 Crcatc thc installation package:(optional) 4.3 Creation of MSYS environment lor compilation of Quantun GIs 25 4.3.1 Initial setup 4.3.2 Installing dependencies 4.3.3 Cleanup 29 5 Building on MacOs X 30 5.1 Install Qt4 from disk image 5.2 Install development frameworks for QGis dependencies 31 5.2.1 Additional Dependencies: General compatibility note 32 5.2.2 Additional Dependencies: Expat 5.2.3 Additional Dependencies: Python ................. 32 5.2.4 Additional Dependencies: SIP 5.2.5 Additional Dependencies: PyQt 34 5.2.6 Additional Dependencies: Qwt/PyQwt 5.2.7 Additional Dependencies: Bison 5.3 Install cmakc for osX 5. 4 QGIS source 37 5.5 Configure the build 37 5.6 Building 6 Authors and Acknowledgments This document and the software provided by the Quantum GIS(QGIS) project is p"ovided under the Gnu Public License!GPL)v 2 or greater Pleasevisittheqtlshomepageathttp://qgis.orgformorenfcma:iorabcutourproject 1 Introduction This document is the original installation guide of the described software QuantuIll GIS. The software and hardware descriptions named in this document are in most cases registered trademarks and are therefore subject to the legal requirements. Quantum GIs is subject to the gnU General Public license. Find more information on the Quantum GisHomepage:http://www.qgis.org The details, that are given in this document have been written and verified to the best of knowledge and responsibility of the editors. Nevertheless, mistakes concerning the content are possible. Therelore, all dala are not liable lo any duties or guarantees. The editors and publishers do not take any responsibility or liability for failures and their consequences. You are always welcome for indicating possible mistakes You can download this document as part of the Quantum GIS User and Installation Guide'inHtmlandPdfFormalviahllp://www.ygis.orgAcurrentversionisalso availableatthewikiseehttp://www.qgis.org/wiki/installation_guidE Translations of this document can also be downloaded at the document ation area of thequAntumgiSprojectathttp://www.qgis.orgMoreinformationisavailablevia http://wiki.qgis.org/qgiswiki/documentationWritersCorner Pleasevisithttp://qgis.orgforinformationonjoiningourmailinglistsandgettingin- volved in the project further / Note to document writers: Plcasc usc this document as thc contral placc for describing build procedures. Please do not remove this notice / Note to document writers: This documented is generated from doc/INSTALL t2t if you need to edit this document be sure to edit that file rather than the generated INSTALL document found in the root of the sourcc directory This document and the software provided by the Quantum GIS(QGIS) project is p"ovided under the Gnu Public License!GPL)v 2 or greater PleasevisittheQtlshomepageathttp://qgis,orgformorenfcma:iorabcutourproject 2 Overview Qgis,likealumberofmajorprojects(eg.Kde4.0),usesCmakE(hllp://www.cmake.org) for building from source Following a summary of the required dependencies for building Required build tools Makc>=2.6.0 e Flex B Required build deps ·Qt>=44.0 ·Proj>=44.x ·GEOS>=3.0 Sqlite3>=3.0.0 GDAL OGR >=14x Qwt>-5.0 Optional dependencies for GRASS plugin -GrASS >=6.0.0 (libraries compiled with exceptions support on Linux 32bit for georeferencer-GSL >= 1.8 for poslgis support and sPit plugin-PostgreSQL>-8..x for gps plugin-expat >=1.95 and gpsbabel for mapserver export and PyQGIs-Python>=2.3(2.5+preferred) for python support -SIP>>=4.8, PyQt>- Illust alch Qt version for qgis mapserver-FastCGI This document and the software provided by the Quantum GIS(QGIS) project is p"ovided under the Gnu Public License!GPL)v 2 or greater PleasevisittheQtlshomepageathttp://qgis,orgformorenfcma:iorabcutourproject 3 Building on GNU/ Linux 3.1 Building QGIs with Qt 4.x Requires: Ubuntu/Debian derived distro Thesc notes arc for Ubuntu-other versions and Debian dcrivcd distros may rcquirc slight variations in package naines These notes are for if you want lo build QGis Iron source. One of the Major aills here is to show how this can be done using binary packages for *all dependencies-building only the core QGis stuff from source. I prefer this approach because it means we can leave the business of managing system packages to apt and only concern ourselves with coding QGis This document assumes you have made a fresh install and have a'clean'system. These instructions should work fine if this is a system that has already been in use for a while you nay need to just skip those steps which are irrelevant to you. / Note: Refer to the section Building Debian packages for building debian packages Unless you plan to develop on QGis, that is probably the easiest option to compile and install QGIs 3.2 Prepare apt The packages ggis depends on to build are available in the universe"conlponent of Ubuntu. This is not activated by default. so you need to activate it 1. Edit your/etc/apt/ sources list file. 2. Uncomment the all the lines starting with deb Also you will need to be running(k)Ubuntu ' or higher in order for all dependencies lo be imet Now update your local sources database Listing sudo apt-get update 3.3 Install build dependencies This document and the software provided by the Quantum GIS(QGIS) project is p"ovided under the Gnu Public License!GPL)v 2 or greater PleasevisittheQtlshomepageathttp://qgis,orgformorenfcma:iorabcutourproject Distribution install coillnand for packages I apt-got install bicon cmaktc doxygon flox graphviz grasB-dcy libcxpat1-dov libfcgi-dov libgdall-dcv libgcoe-dev libgcl0-dey libpq-dev libct4- apt-get install bison cmake doxygen flex graphviz grass-dev l1bexpatl-dev l1bIcgi-dev l1bgdall-dev 11bgeos-dev libgsl0-dev l1bpq-dev libpro maverick apt-gct install bicon cmake doxygon flo graphviz gracB-dev libexpat1-dov libfcgi-dov libgdal1-dcw libgcoe-dov libgel0-der libpq-dov libpro apeeet install hi on cmake doreen f er graphviz grass-dev li bexpatl-dav lihicgi-dev libgdall-dev libgeos-dev libgs10-dey lihpq-dey libero= get install bison cmake de oxygen flex grephviz grass-dey libexpat1-dev libfcgi-dev libgdal1-dev libgeoa-dey libgsl0-der libpq-dev libpro- apt-get install bison cmake doxygen flex graphviz grass-dev iibexpat1-dev libfcgi-dev libgdall-dev 1ibgeos-dev libgslo-de7 1ibpq-dev lispro (extracted Iron the respecTive control liles in debian/) / A Special Note: If you are following this set of instructions on a system where you already have Qt3 development tools installed, there will be a confict between Qt3 tools and Qt4 tools. For cxamplc, qmakc will point to the Qt3 vcrsion not thc Qt4. Ubuntu Qi4 and Qt3 packages are designed to live alongside each other. This Inleans thal lor example if you have them both installed you will have three qmake exe's Listin /usr/bin/qmake ->/etc/alternatives/gmake /usr/bin/qmake usr/bin/qmake-qt41 The sane applies lo all other Qt binaries. You will notice above thal the canonical qmake' is managed by apt alternatives, so before we start to build QGis, we need to makc Qt4 the default. To rcturn Qt3 to default latcr you can usc this samc proccss You can use apt alternatives to correct this so that the Qt4 version of applications is used in all case Listin sudo update-alternatives --config qmake sudo update-alternatives --config uic onfig desi sudo update-alternatives --config assistant sudo update-alternatives --config atconfig sudo update-alternatives --config moc config update sudo update-alternatives --config Release sudo update-alternatives --config linguist Use the simple command line dialog that appears after running each of the above com- mands to select the Qt4 version of the relevant applications /! Note: For python language bindings SIP > 4.5 and PyQt4 >=4.1 is required ome stable GNU/ Linux distributions(e. g. Debian or SuSE)only provide SIP<4.5 and PyQt4 <4.1. To include support for python language bindings you may need to build and install those packages from source. This document and the software provided by the Quantum GIS(QGIS) project is p"ovided under the Gnu Public License!GPL)v 2 or greater PleasevisittheQtlshomepageathttp://qgis,orgformorenfcma:iorabcutourproject 3. 4 Setup ccache(Optional) You should also setup ccache to speed up compile times L讠st cd /usr/local/bin sudo In -s /usr/bin/ccache gcc sudo ln -s /usr/bin/ccache g++ 3.5 Prepare your development environment As a convention I do all my development work in SIIOME/dev/<language>, so in this casc we will crcatc a work cnvironment for C l- devclopmcnt work like this Listing mkdir -p tHOMEJ/dev/cpp d StHOME/dev/cpp This directory path will be assumed for a ll instructions that follow 3.6 Check out the QGIS Source Code There are two ways the source can be checked out. Use the anonymous method if you do not have edit privaleges for the QGis source repository, or use the developer checkout if you have permissions to commit source code changes 1. Anonymous Checkout L讠stt d SHOME]/dev/cpp git clone git: //github. com/ggis/Quantum-GISgit 2. Developer checkout Listing itclonegit@github.com:ggis/Quantum-GISgit This document and the software provided by the Quantum GIS(QGIS) project is p"ovided under the Gnu Public License!GPL)v 2 or greater PleasevisittheQtlshomepageathttp://qgis,orgformorenfcma:iorabcutourproject 3.7 Starting the compile I compile my development version of QGIS into my/apps directory to avoid conflicts with Ubuntu packages that may bc undcr/usr. This way for cxamplc you can usc the binary packages of QGis on your systern along side with your development version. I suggest you do something similar Listing mkdir -p $tHOME/apps Now we create a build directory and run ccmake L讠 sting ntum-GIS mkdir build-master ca build-master crake When you run ccmake(note the . is required! ) a menu will appear where you can con figure various aspects of the build. If you do not have root access or do not want to overwrite existing QGIS installs(by your packagemanager for example), set the CMAKE INSTALL PREFIX to somewhere you have write access to(I usually use SIIOME) apps). Now press 'c' to configure, ' to dismiss any error messages that may appear. andg to generate the make files. Note that sometimes needs to be pressed several times before the 'g option becomes available. After the g generation is complete, press 'a' to exit the ccmake interactive dialog Now on with the build L讠St279 make make install It may take a little while to build depending on your platform After that you can try to run QGIS Lestin SHOME/apps/bin/qgis If all has worked properly the QGis application should start up and appear on your scree This document and the software provided by the Quantum GIS(QGIS) project is p"ovided under the Gnu Public License!GPL)v 2 or greater PleasevisittheQtlshomepageathttp://qgis,orgformorenfcma:iorabcutourproject 3.8 Building Debian packages Instead of creating a personal installation as in the previous step you can also create debian package. This is donc from the ggis root directory, where you'll find a debian directory. First you need to install the debian packaging tools once Listi apt-get install build-essential First you need to create an changelog entry for your distribution. For example for Ubuntu lucid Listing dch -1 lucid --force-distribution --distribut ion lucid lucid build't The QGis packages will be created with L讠st?g dpkg-buildpackage -us -uc-b / Note: If dpkg-buildpackage complains about unmet build dependencies you can install then using apt-get and re-run the conmnand /! Note: If you have libqgis1-dev installed, you need to remove it first using dpkg r libqgis1-dev. Otherwise dpkg-buildpackage will complain about a build conflict The packages are created in the parent directory(ie. one level up). Install them using dpkg. E Listin sudo debi 3.9 A practical case: Building QGIS and GRASS from source on Ubuntu with ECW and MrSiD formats support The following procedure has been tested on Ubuntu 8.04, 8.10 and 9.04 32bit. If yoU want to use different versions of the software(gdal, grass, qgis), just make the necessary adjusLments to the following code. This guide assumes thal you dont have installed any previous version of gdal, grass and qgis 10 This document and the software provided by the Quantum GIS(QGIS) project is p"ovided under the Gnu Public License!GPL)v 2 or greater PleasevisittheQtlshomepageathttp://qgis,orgformorenfcma:iorabcutourproject

...展开详情
试读 40P Qgis官网编译过程
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
wangxk551 文档不是特别详细,从命令行启动cmake-gui添加库
2017-04-18
回复
miaomeng06 真心不粗,很有帮助,谢谢
2016-06-26
回复
ws800328 各种编译文档都看了,编译不成功,试试官网的吧
2016-03-21
回复
gisrootie 马马虎虎,不是很详细,要参考资料
2015-10-12
回复
wenwenxiong 以此文档为准,参照网上的一些博客可以成功编译Qgis
2014-07-07
回复
paladin1893 很早的文档,补充说明一下,从命令行启动cmake-gui是关键。
2013-11-28
回复
wudadadada 还是搞不出来啊,不过还是谢谢了
2013-09-13
回复
阳阳_ME 搞了一天,终于成功了
2013-07-26
回复
Hanford 很全面。英文的,阅读起来还是比较费劲。
2013-07-25
回复
祥龙九霄 搞了一天,虽然编译过了,但是没有生成工程文件。
2013-06-20
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
  • 分享精英

关注 私信
上传资源赚钱or赚积分
最新推荐
Qgis官网编译过程 43积分/C币 立即下载
1/40
Qgis官网编译过程第1页
Qgis官网编译过程第2页
Qgis官网编译过程第3页
Qgis官网编译过程第4页
Qgis官网编译过程第5页
Qgis官网编译过程第6页
Qgis官网编译过程第7页
Qgis官网编译过程第8页

试读结束, 可继续读4页

43积分/C币 立即下载 >