Skip to content

Commit d1b926e

Browse files
author
timlinux
committedJun 25, 2007
Added notes from 0.8.1 release and notes from William
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7046 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4bb6a40 commit d1b926e

File tree

1 file changed

+661
-94
lines changed

1 file changed

+661
-94
lines changed
 

‎INSTALL.t2t

Lines changed: 661 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,46 @@
1-
Installation Notes for Quantum GIS (QGIS) on windows
2-
Tim Sutton
3-
%%mtime(%m/%d/%Y)
4-
1+
Compiling QGIS From Source
2+
Tim Sutton 2007
53
%!encoding: iso-8859-1
64

7-
= Introduction =
85

9-
%This document is in text2tags format. You can generate html, plain text and moinmoin
10-
%formatted documentation by running txt2tags on this document. See the txt2tags home
11-
%page for more details.
6+
% These are comments and will not be generated in any output
7+
% -------------------
128

13-
This document is for developers and describes the procedure required to compile this version of QGIS.
9+
%This document is in text2tags format. You can generate html, plain text and
10+
%moinmoin formatted documentation by running txt2tags on this document. See the
11+
%txt2tags home page for more details. Please insert manual line breaks in this
12+
%document as it makes diffing for changes much easier. To do this in vim
13+
%automatically, select a section then issue (gq) command. Please dont
14+
%apply vim formatting to the whol document as it screws up some formatting
15+
%rather apply it selectively to paragraphs where needed.
1416

15-
= Procedure for building under windows build environment using msys =
16-
```
17-
Authors and contributors for this section:
18-
Tim Sutton, Godofredo Contreras 2006
19-
CMake additions Magnus Homann 2007
20-
Python additions Martin Dobias 2007
21-
With thanks to Tisham Dhar for preparing the initial msys environment
22-
---------------------------------------------------------------------------------
23-
```
17+
% To generate teh text version of this document:
18+
% txt2tags -t txt --toc --enum-title -o INSTALL INSTALL.t2t
19+
% To generate the moinmoin version of this document
20+
% txt2tags -t moin --toc --enum-title -o INSTALL.moin INSTALL.t2t
21+
22+
% End of comments
23+
% -------------------
24+
25+
26+
= Introduction =
27+
28+
/!\ ***Note to document writers:*** Please use this document as the central
29+
place for describing build procefures. Please do not remove this notice.
30+
31+
/!\ ***Note:*** This is a 'cut and paste' tutorial - in most cases you can
32+
simply copy the commands listed in codeblocks that look like this:
33+
34+
``` somecommand to be pasted ```
35+
36+
37+
38+
= Building under windows using msys =
2439

2540
== MSYS: ==
2641

27-
MSYS provides a unix style build environment under windows. We have created a zip archive that contains just about all dependencies.
42+
MSYS provides a unix style build environment under windows. We have created a
43+
zip archive that contains just about all dependencies.
2844

2945
Get this:
3046

@@ -33,14 +49,15 @@ http://qgis.org/uploadfiles/msys/msys.tar.gz
3349
and unpack to c:\msys
3450

3551

36-
/!\ The file above is compressed as gzipped tarball - you can get a free windows application for creating and decompressing files here:
52+
/!\ The file above is compressed as gzipped tarball - you can get a free
53+
windows application for creating and decompressing files here:
3754

3855
http://www.7-zip.org/
3956

4057

4158
== Qt4.3 ==
4259

43-
Download qt4.3 opensource precompiled edition exe and install (including the
60+
Download qt4.3 opensource precompiled edition exe and install (including the
4461
download and install of mingw) from here:
4562

4663
http://www.trolltech.com/developer/downloads/qt/windows
@@ -52,52 +69,69 @@ When Qt installation is complete:
5269

5370
Edit C:\Qt\4.3.0\bin\qtvars.bat and add the following lines:
5471

55-
set PATH=%PATH%;C:\msys\local\bin;c:\msys\local\lib
56-
set PATH=%PATH%;"C:\Program Files\Subversion\bin"
72+
```
73+
set PATH=%PATH%;C:\msys\local\bin;c:\msys\local\lib
74+
set PATH=%PATH%;"C:\Program Files\Subversion\bin"
75+
```
5776

58-
I suggest you also add C:\Qt\4.3.0\bin\ to your Environment Variables Path in the windows system preferences.
77+
I suggest you also add C:\Qt\4.3.0\bin\ to your Environment Variables Path in
78+
the windows system preferences.
5979

6080
If you plan to do some debugging, you'll need to compile debug version of Qt:
6181
C:\Qt\4.3.0\bin\qtvars.bat compile_debug
6282

6383
== Flex and Bison ==
6484

65-
Get Flex http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16424 (the zip bin) and extract it into c:\msys\mingw\bin
85+
*** Note I think this section can be removed as it should be installed int the
86+
msys image already. TS
87+
88+
Get Flex
89+
http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16424
90+
(the zip bin) and extract it into c:\msys\mingw\bin
6691

6792
== Python stuff: (optional) ==
6893

6994

70-
Follow this section in case you would like to use Python bindings for QGIS.
71-
To be able to compile bindings, you need to compile SIP and PyQt4 from sources
72-
as their installer doesn't include some development files which are necessary.
95+
Follow this section in case you would like to use Python bindings for QGIS. To
96+
be able to compile bindings, you need to compile SIP and PyQt4 from sources as
97+
their installer doesn't include some development files which are necessary.
7398

74-
*) Download and install Python - use Windows installer
75-
(It doesn't matter to what folder you'll install it)
99+
=== Download and install Python - use Windows installer ===
76100

77-
http://python.org/download/
101+
(It doesn't matter to what folder you'll install it)
78102

79-
*) Download SIP and PyQt4 sources
103+
http://python.org/download/
80104

81-
http://www.riverbankcomputing.com/Downloads/sip4/sip-4.6.zip
82-
http://www.riverbankcomputing.com/Downloads/PyQt4/GPL/PyQt-win-gpl-4.2.zip
105+
=== Download SIP and PyQt4 sources ===
83106

84-
*) Unpack SIP to a temporary directory, open console (cmd.exe) and compile:
107+
http://www.riverbankcomputing.com/Downloads/sip4/sip-4.6.zip
108+
http://www.riverbankcomputing.com/Downloads/PyQt4/GPL/PyQt-win-gpl-4.2.zip
85109

86-
> c:\Qt\4.3.0\bin\qtvars.bat
87-
> python configure.py -p win32-g++
88-
> make
89-
> make install
110+
Extract each of the above zip files in a temporary directory.
90111

91-
*) Unpack PyQt to a temporary directory, open console (cmd.exe) and compile:
112+
=== Compile SIP ===
92113

93-
> c:\Qt\4.3.0\bin\qtvars.bat
94-
> python configure.py
95-
> make
96-
> make install
114+
```
115+
c:\Qt\4.3.0\bin\qtvars.bat
116+
python configure.py -p win32-g++
117+
make
118+
make install
119+
```
97120

98-
*) You can delete the directories with unpacked SIP and PyQt4 sources
99-
after a successfull install, they're not needed anymore.
121+
=== Compile PyQt ===
100122

123+
```
124+
c:\Qt\4.3.0\bin\qtvars.bat
125+
python configure.py
126+
make
127+
make install
128+
```
129+
130+
131+
=== Final python notes ===
132+
133+
/!\ You can delete the directories with unpacked SIP and PyQt4 sources after a
134+
successfull install, they're not needed anymore.
101135

102136
== Subversion: ==
103137

@@ -116,90 +150,623 @@ http://www.cmake.org/files/v2.4/cmake-2.4.6-win32-x86.exe
116150

117151
== QGIS: ==
118152

119-
* Start a cmd.exe window ( Start -> Run -> cmd.exe )
120-
* Create development directory and move into it
153+
Start a cmd.exe window ( Start -> Run -> cmd.exe ) Create development
154+
directory and move into it
121155

122-
```
123-
> md c:\dev\cpp
124-
> cd c:\dev\cpp
156+
```
157+
md c:\dev\cpp
158+
cd c:\dev\cpp
125159
```
126160

127-
* Check out sources from SVN
128-
* For svn head:
129-
```
130-
svn co https://svn.qgis.org/repos/qgis/trunk/qgis
161+
Check out sources from SVN For svn head:
162+
```
163+
svn co https://svn.qgis.org/repos/qgis/trunk/qgis
131164
```
132-
* For svn 0.8 branch
165+
For svn 0.8 branch
133166
```
134-
* svn co https://svn.qgis.org/repos/qgis/branches/Release-0_8_0 qgis0.8
167+
svn co https://svn.qgis.org/repos/qgis/branches/Release-0_8_0 qgis0.8
135168
```
136169

137170

138171
== Compiling: ==
139172

140-
As a background read http://wiki.qgis.org/qgiswiki/Building_with_CMake
173+
As a background read the generic building with CMake notes at the end of
174+
this document.
141175

142-
* Start a cmd.exe window ( Start -> Run -> cmd.exe ) if you don't have one already.
143-
* Add paths to compiler and our MSYS environment:
176+
Start a cmd.exe window ( Start -> Run -> cmd.exe ) if you don't have one
177+
already. Add paths to compiler and our MSYS environment:
144178

145179
```
146-
c:\Qt\4.3.0\bin\qtvars.bat
180+
c:\Qt\4.3.0\bin\qtvars.bat
147181
```
148-
* For ease of use add c:\Qt\4.3.0\bin\ to your system path in system properties so you can just type qtvars.bat when you open the cmd console.
149-
* Create build directory and set it as current directory:
150182

151-
```
152-
cd c:\dev\cpp\qgis
153-
md build
154-
cd build
183+
For ease of use add c:\Qt\4.3.0\bin\ to your system path in system
184+
properties so you can just type qtvars.bat when you open the cmd console.
185+
Create build directory and set it as current directory:
186+
187+
188+
```
189+
cd c:\dev\cpp\qgis
190+
md build
191+
cd build
155192
```
156193

157194
== Configuration ==
158195

159196
```
160-
cmakesetup ..
197+
cmakesetup ..
161198
```
162199

163-
/!\ NOTE: You must include the '..' above.
200+
/!\ NOTE: You must include the '..' above.
164201

165-
* Click 'Configure' button.
166-
* When asked, you should choose 'MinGW Makefiles' as generator.
167-
168-
There's a problem with MinGW Makefiles on Win2K. If you're compiling on this
169-
platform, use 'MSYS Makefiles' generator instead.
202+
Click 'Configure' button. When asked, you should choose 'MinGW Makefiles'
203+
as generator.
170204

171-
All dependencies should be picked up automatically, if you have set
172-
up the Paths correctly. The only thing you need to change is the
173-
installation destination (CMAKE_INSTALL_PREFIX) and/or set 'Debug'.
174-
175-
For compatibility with NSIS packaging cripts I recommend to leave the install
176-
prefix to its default c:\program files\
205+
There's a problem with MinGW Makefiles on Win2K. If you're compiling on this
206+
platform, use 'MSYS Makefiles' generator instead.
207+
208+
All dependencies should be picked up automatically, if you have set up the
209+
Paths correctly. The only thing you need to change is the installation
210+
destination (CMAKE_INSTALL_PREFIX) and/or set 'Debug'.
177211

178-
When configuration is done, click 'OK' to exit the setup utility.
212+
For compatibility with NSIS packaging cripts I recommend to leave the
213+
install prefix to its default c:\program files\
179214

180-
*) Compilation and installation
215+
When configuration is done, click 'OK' to exit the setup utility.
216+
217+
== Compilation and installation ==
218+
181219

182-
> make
183-
> make install
220+
```
221+
make make install
222+
```
184223

185-
*) Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX)
224+
== Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX) ==
186225

187-
Make sure to copy all .dll:s needed to the same directory as the
188-
qgis.exe binary is installed to, if not already done so, otherwise
189-
QGIS will complain about missing libraries when started.
226+
Make sure to copy all .dll:s needed to the same directory as the qgis.exe
227+
binary is installed to, if not already done so, otherwise QGIS will complain
228+
about missing libraries when started.
190229

191-
The best way to do this is to download both the QGIS current release installer package from http://qgis.org/uploadfiles/testbuilds/ and install it. Now copy the installation dir from C:\Program Files\Quantum GIS into c:\Program Files\qgis-0.8.1 (or whatever the current version is. The name should strictly match the version no. After making this copy you can uninstall the release version of QGIS from your c:\Program Files directory using the provided uninstaller. Double check that the Quantum GIS dir is completely gone under program files afterwards.
230+
The best way to do this is to download both the QGIS current release installer
231+
package from http://qgis.org/uploadfiles/testbuilds/ and install it. Now copy
232+
the installation dir from C:\Program Files\Quantum GIS into c:\Program
233+
Files\qgis-0.8.1 (or whatever the current version is. The name should strictly
234+
match the version no.) After making this copy you can uninstall the release
235+
version of QGIS from your c:\Program Files directory using the provided
236+
uninstaller. Double check that the Quantum GIS dir is completely gone under
237+
program files afterwards.
192238

193-
Another possibility is to run qgis.exe when your path contains
194-
c:\msys\local\bin and c:\msys\local\lib directories, so the DLLs
195-
will be used from that place.
239+
Another possibility is to run qgis.exe when your path contains
240+
c:\msys\local\bin and c:\msys\local\lib directories, so the DLLs will be
241+
used from that place.
196242

197243

198244
== Create the installation package: (optional) ==
199245

200246
Downlad and install NSIS from (http://nsis.sourceforge.net/Main_Page)
201247

202248

203-
Now using windows explorer, enter the win_build directory in your QGIS source tree. Read the READMEfile there and follow the instructions. Next right
204-
click on qgis.nsi and choose the option 'Compile NSIS Script'.
249+
Now using windows explorer, enter the win_build directory in your QGIS source
250+
tree. Read the READMEfile there and follow the instructions. Next right click
251+
on qgis.nsi and choose the option 'Compile NSIS Script'.
252+
253+
254+
255+
= Building on Mac OSX using frameworks and cmake (QGIS > 0.8) =
256+
257+
258+
In this approach I will try to avoid as much as possible building dependencies
259+
from source and rather use frameworks wherever possible.
260+
261+
== Install XCODE ==
262+
263+
I recommend to get the latest xcode dmg from the Apple XDC Web site. Install
264+
XCODE after the ~941mb download is complete.
265+
266+
== Install Qt4 from .dmg ==
267+
268+
```
269+
ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.2.3.dmg
270+
```
271+
272+
If you want debug libs, Qt also provide a dmg with these:
273+
274+
```
275+
ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.2.3-debug-libs.dmg
276+
```
277+
278+
I am going to proceed using only release libs at this stage as the download for
279+
the debug dmg is substantially bigger. If you plan to do any debugging though
280+
you probably want to get the debug libs dmg. Once downloaded open the dmg and
281+
run the installer. Note you need admin access to install.
282+
283+
After installing you need to make two small changes:
284+
285+
First edit ``/Library/Frameworks/QtCore.framework/Headers/qconfig.h`` and
286+
change
287+
288+
/!\ Note this doesnt seem to be needed since version 4.2.3
289+
290+
``QT_EDITION_UNKNOWN`` to ``QT_EDITION_OPENSOURCE``
291+
292+
Second change the default mkspec symlink so that it points to macx-g++:
293+
294+
```
295+
cd /usr/local/Qt4.2/mkspecs/ sudo rm default sudo ln -sf macx-g++ default
296+
```
297+
298+
299+
== Install development frameworks for QGIS dependencies ==
300+
301+
Download William Kyngesburye's excellent all in one framework that includes
302+
proj, gdal, sqlite3 etc
303+
304+
```
305+
http://www.kyngchaos.com/files/software/unixport/AllFrameworks.dmg
306+
```
307+
308+
Once downloaded, open and install the frameworks.
309+
310+
William provides an additional installer package for Postgresql/PostGIS. Its
311+
available here:
312+
313+
```
314+
http://www.kyngchaos.com/software/unixport/postgres
315+
```
316+
317+
There are some additional dependencies that at the time of writing are not
318+
provided as frameworks so we will need to build these from source.
319+
320+
=== Additional Dependencies : GSL ===
321+
322+
Retrieve the Gnu Scientific Library from
323+
324+
```
325+
curl -O ftp://ftp.gnu.org/gnu/gsl/gsl-1.8.tar.gz
326+
```
327+
328+
Then extract it and build it to a prefix of /usr/local:
329+
330+
```
331+
tar xvfz gsl-1.8.tar.gz
332+
cd gsl-1.8
333+
./configure --prefix=/usr/local
334+
make
335+
sudo make install cd ..
336+
```
337+
338+
=== Additional Dependencies : Expat ===
339+
340+
Get the expat sources:
341+
342+
```
343+
http://sourceforge.net/project/showfiles.php?group_id=10127
344+
```
345+
346+
```
347+
tar xvfz expat-2.0.0.tar.gz
348+
cd expat-2.0.0
349+
./configure --prefix=/usr/local
350+
make
351+
sudo make install
352+
cd ..
353+
```
354+
355+
=== Additional Dependencies : SIP ===
356+
357+
Retrieve the python bindings toolkit SIP from
358+
359+
```
360+
curl -O http://www.riverbankcomputing.com/Downloads/sip4/sip-4.5.2.tar.gz
361+
```
362+
363+
Then extract and build it to a prefix of /usr/local:
364+
365+
```
366+
tar xvfz sip-4.5.2.tar.gz
367+
cd sip-4.5.2
368+
python configure.py
369+
make
370+
sudo make install
371+
cd ..
372+
```
373+
374+
=== Additional Dependencies : PyQt ===
375+
376+
Retrieve the python bindings toolkit for Qt from
377+
378+
```
379+
curl -O http://www.riverbankcomputing.com/Downloads/PyQt4/GPL/PyQt-mac-gpl-4.1.1.tar.gz
380+
```
381+
382+
Then extract and build it to a prefix of /usr/local:
383+
384+
```
385+
tar xvfz PyQt-mac-gpl-4.1.1.tar.gz
386+
cd PyQt-mac-gpl-4.1.1
387+
python configure.py
388+
yes
389+
make
390+
sudo make install
391+
cd ..
392+
```
393+
394+
=== Additional Dependencies : Bison ===
395+
396+
The version of bison available by default on Mac OSX is too old so you need to
397+
get a more recent one on your system. Download if from:
398+
399+
```
400+
curl -O http://ftp.gnu.org/gnu/bison/bison-2.3.tar.gz
401+
```
402+
403+
Now build and install it to a prefix of /usr/local :
404+
405+
```
406+
tar xvfz bison-2.3.tar.gz
407+
cd bison-2.3
408+
./configure --prefix=/usr/local
409+
make
410+
sudo make install
411+
cd ..
412+
```
413+
414+
== Install CMAKE for OSX ==
415+
416+
Get the latest release from here:
417+
418+
```
419+
http://www.cmake.org/HTML/Download.html
420+
```
421+
422+
At the time of writing the file I grabbed was:
423+
424+
```
425+
curl -O http://www.cmake.org/files/v2.4/cmake-2.4.6-Darwin-universal.dmg
426+
```
427+
428+
Once downloaded open the dmg and run the installer
429+
430+
== Install subversion for OSX ==
431+
432+
The [http://sourceforge.net/projects/macsvn/ MacSVN] project has a downloadable
433+
build of svn. If you are a GUI inclined person you may want to grab their gui
434+
client too. Get the command line client here:
435+
436+
```
437+
curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Subversion_1.4.2.zip
438+
```
439+
440+
441+
Once downloaded open the zip file and run the installer.
442+
443+
You also need to install BerkleyDB available from the same
444+
[http://sourceforge.net/projects/macsvn/ website]. At the time of writing the
445+
file was here:
446+
447+
```
448+
curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Berkeley_DB_4.5.20.zip
449+
```
450+
451+
Once again unzip this and run the installer therein.
452+
453+
Lastly we need to ensure that the svn commandline executeable is in the path.
454+
Add the following line to the end of /etc/bashrc using sudo:
455+
456+
```
457+
sudo vim /etc/bashrc
458+
```
459+
460+
And add this line to the bottom before saving and quiting:
461+
462+
```
463+
export PATH=/usr/local/bin:$PATH:/usr/local/pgsql/bin
464+
```
465+
466+
/usr/local/bin needs to be first in the path so that the newer bison (that will
467+
be built from source further down) is found before the bison (which is very
468+
old) that is installed by MacOSX
469+
470+
471+
Now close and reopen your shell to get the updated vars.
472+
473+
== Check out QGIS from SVN ==
474+
475+
Now we are going to check out the sources for QGIS. First we will create a
476+
directory for working in:
477+
478+
```
479+
mkdir -p ~/dev/cpp cd ~/dev/cpp
480+
```
481+
482+
Now we check out the sources:
483+
484+
Trunk:
485+
```
486+
svn co https://svn.qgis.org/repos/qgis/trunk/qgis qgis
487+
```
488+
489+
For svn 0.8 branch
490+
```
491+
svn co https://svn.qgis.org/repos/qgis/branches/Release-0_8_0 qgis0.8
492+
```
493+
494+
495+
The first time you check out QGIS sources you will probably get a message like
496+
this:
497+
498+
```
499+
Error validating server certificate for 'https://svn.qgis.org:443':
500+
- The certificate is not issued by a trusted authority. Use the fingerprint to
501+
validate the certificate manually! Certificate information:
502+
- Hostname: svn.qgis.org
503+
- Valid: from Apr 1 00:30:47 2006 GMT until Mar 21 00:30:47 2008 GMT
504+
- Issuer: Developer Team, Quantum GIS, Anchorage, Alaska, US
505+
- Fingerprint: 2f:cd:f1:5a:c7:64:da:2b:d1:34:a5:20:c6:15:67:28:33:ea:7a:9b
506+
(R)eject, accept (t)emporarily or accept (p)ermanently?
507+
```
508+
509+
I suggest you press 'p' to accept the key permanently.
510+
511+
== Configure the build ==
512+
513+
CMake supports out of source build so we will create a 'build' dir for the
514+
build process
515+
516+
```
517+
cd qgis
518+
mkdir build
519+
cd build
520+
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ -D CMAKE_BUILD_TYPE=Release..
521+
```
522+
523+
To use a specific GRASS version, You can optionally use the following
524+
cmake invocation (with modifications to suite your system (thanks William
525+
Kyngesburye for this hint):
526+
527+
```
528+
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
529+
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.3.app/Contents/Resources/include \
530+
-D GRASS_PREFIX=/Applications/GRASS-6.3.app/Contents/Resources \
531+
-D CMAKE_BUILD_TYPE=Release \
532+
..
533+
```
534+
535+
== GEOS Issues ==
536+
537+
I had some issues with GEOS headers so I made the following edits:
538+
539+
In file /Library/Frameworks/GEOS.framework/Headers/io.h, comment out line 61
540+
541+
In file /Library/Frameworks/GEOS.framework/Headers/geom.h, comment out line 145
542+
543+
== Building ==
544+
545+
Now we can start the build process:
546+
547+
```
548+
make
549+
```
550+
551+
If all built without errors you can then install it:
552+
553+
```
554+
make install
555+
```
556+
557+
= Building on GNU/Linux =
558+
559+
== Building QGIS with Qt4.x ==
560+
561+
***Requires:*** Ubuntu Edgy
562+
563+
These notes are for if you want to build QGIS from source. One of the major
564+
aims here is to show how this can be done using binary packages for ***all***
565+
dependencies - building only the core QGIS stuff from source. I prefer this
566+
approach because it means we can leave the business of managing system packages
567+
to apt and only concern ourselves with coding QGIS!
568+
569+
This document assumes you have made a fresh install and have a 'clean' system.
570+
These instructions should work fine if this is a system that has already been
571+
in use for a while, you may need to just skip those steps which are irrelevant
572+
to you.
573+
574+
575+
576+
== Prepare apt ==
577+
578+
The packages qgis depends on to build are available in the "universe" component
579+
of Ubuntu. This is not activated by default, so you need to activate it:
580+
581+
1. Edit your /etc/apt/sources.list file.
582+
2. Uncomment the all the lines starting with "deb"
583+
584+
Also you will need to be running (K)Ubuntu 'edgy' or higher in order for
585+
all dependencies to be met.
586+
587+
Now update your local sources database:
588+
589+
```
590+
sudo apt-get update
591+
```
592+
593+
594+
== Install Qt4 ==
595+
596+
```
597+
sudo apt-get install libqt4-core libqt4-debug libqt4-debug-dev \
598+
libqt4-dev libqt4-gui libqt4-qt3support libqt4-sql lsb-qt4 qt4-designer \
599+
qt4-dev-tools qt4-doc qt4-qtconfig uim-qt gcc libapt-pkg-perl resolvconf
600+
```
601+
602+
/!\ ***A Special Note:*** If you are following this set of instructions on
603+
a system where you already have Qt3 development tools installed, there will
604+
be a conflict between Qt3 tools and Qt4 tools. For example, qmake will
605+
point to the Qt3 version not the Qt4. Ubuntu Qt4 and Qt3 packages are
606+
designed to live alongside each other. This means that for example if you
607+
have them both installed you will have three qmake exe's:
608+
609+
```
610+
/usr/bin/qmake -> /etc/alternatives/qmake
611+
/usr/bin/qmake-qt3
612+
/usr/bin/qmake-qt4
613+
```
614+
615+
The same applies to all other Qt binaries. You will notice above that the
616+
canonical 'qmake' is managed by apt alternatives, so before we start to
617+
build QGIS, we need to make Qt4 the default. To return Qt3 to default later
618+
you can use this same process.
619+
620+
You can use apt alternatives to correct this so that the Qt4 version of
621+
applications is used in all cases:
622+
623+
```
624+
sudo update-alternatives --config qmake
625+
sudo update-alternatives --config uic
626+
sudo update-alternatives --config designer
627+
sudo update-alternatives --config assistant
628+
sudo update-alternatives --config qtconfig
629+
sudo update-alternatives --config moc
630+
sudo update-alternatives --config lupdate
631+
sudo update-alternatives --config lrelease
632+
sudo update-alternatives --config linguist
633+
```
634+
635+
Use the simple command line dialog that appears after running each of the
636+
above commands to select the Qt4 version of the relevant applications.
637+
638+
== Install additional software dependencies required by QGIS ==
639+
640+
```
641+
sudo apt-get install gdal-bin libgdal1-dev libgeos-dev proj libtool \
642+
libgdal-doc libhdf4g-dev libhdf4g-run autoconf2.13 automake1.9 python-dev \
643+
swig libgsl0-dev g++ libjasper-1.701-dev libtiff4-dev subversion gsl-bin \
644+
libsqlite3-dev sqlite3 ccache make libpq-dev flex bison firefox
645+
```
646+
647+
648+
== GRASS Specific Steps ==
649+
650+
/!\ ***Note:*** If you don't need to build with GRASS support, you can
651+
skip this section.
652+
653+
Now you can install grass from dapper:
654+
655+
```
656+
sudo apt-get install grass libgrass-dev libgdal1-grass
657+
```
658+
659+
== Setup ccache (Optional) ==
660+
661+
You should also setup ccache to speed up compile times:
662+
663+
```
664+
cd /usr/local/bin
665+
sudo ln -s /usr/bin/ccache gcc
666+
sudo ln -s /usr/bin/ccache g++
667+
```
668+
669+
== Prepare your development environment ==
670+
671+
As a convention I do all my development work in $HOME/dev/<language>, so in
672+
this case we will create a work environment for C++ development work like
673+
this:
674+
675+
```
676+
mkdir -p ${HOME}/dev/cpp
677+
cd ${HOME}/dev/cpp
678+
```
679+
680+
This directory path will be assumed for all instructions that follow.
681+
682+
683+
== Check out the QGIS Source Code ==
684+
685+
There are two ways the source can be checked out. Use the anonymous method
686+
if you do not have edit privaleges for the QGIS source repository, or use
687+
the developer checkout if you have permissions to commit source code
688+
changes.
689+
690+
1. Anonymous Checkout
691+
692+
```
693+
cd ${HOME}/dev/cpp
694+
svn co https://svn.qgis.org/repos/qgis/trunk/qgis qgis
695+
```
696+
697+
2. Developer Checkout
698+
699+
```
700+
cd ${HOME}/dev/cpp
701+
svn co --username <yourusername> https://svn.qgis.org/repos/qgis/trunk/qgis qgis
702+
```
703+
704+
The first time you check out the source you will be prompted to accept the
705+
qgis.org certificate. Press 'p' to accept it permanently:
706+
707+
```
708+
Error validating server certificate for 'https://svn.qgis.org:443':
709+
- The certificate is not issued by a trusted authority. Use the
710+
fingerprint to validate the certificate manually! Certificate
711+
information:
712+
- Hostname: svn.qgis.org
713+
- Valid: from Apr 1 00:30:47 2006 GMT until Mar 21 00:30:47 2008 GMT
714+
- Issuer: Developer Team, Quantum GIS, Anchorage, Alaska, US
715+
- Fingerprint:
716+
2f:cd:f1:5a:c7:64:da:2b:d1:34:a5:20:c6:15:67:28:33:ea:7a:9b (R)eject,
717+
accept (t)emporarily or accept (p)ermanently?
718+
```
719+
720+
== Starting the compile ==
721+
722+
I compile my development version of QGIS into my ~/apps directory to avoid
723+
conflicts with Ubuntu packages that may be under /usr. This way for example
724+
you can use the binary packages of QGIS on your system along side with your
725+
development version. I suggest you do something similar:
726+
727+
```
728+
mkdir -p ${HOME}/apps
729+
```
730+
731+
The script will carry on to build QGIS - it may take a little while to go
732+
and have a cup of your favourite beverage while you wait...
733+
734+
== Running QGIS ==
735+
736+
Once the compile is complete it should pop up a page in firefox with unit
737+
test results. At the time of writing the unit tests are just stubs - we
738+
still need to create the test implementations - so dont worry to much about
739+
their output at the moment.
740+
741+
Now you can try to run QGIS:
742+
743+
```
744+
$HOME/apps/bin/qgis
745+
```
746+
747+
If all has worked properly the QGIS application should start up and appear
748+
on your screen.
749+
750+
751+
= Further help and information =
752+
753+
Please visit http://qgis.org for information on joining our mailing lists
754+
and getting involved in the project further.
755+
756+
757+
= Authors and Acknowledgments =
758+
759+
The follwing people have contributed to this document:
760+
761+
- Windows Section
762+
- Tim Sutton, Godofredo Contreras 2006
763+
- CMake additions Magnus Homann 2007
764+
- Python additions Martin Dobias 2007
765+
- With thanks to Tisham Dhar for preparing the initial msys environment
766+
767+
- OSX Section
768+
- Tim Sutton, 2007
769+
- With special thanks to Tom Elwertowski and William Kyngesburye
205770

771+
- GNU/Linux Section
772+
- Tim Sutton 2006

0 commit comments

Comments
 (0)
Please sign in to comment.