Skip to content

Commit 1aba104

Browse files
author
timlinux
committedNov 17, 2009
Applied updates from John Tull to INSTALL documentation for Snow Leopard
git-svn-id: http://svn.osgeo.org/qgis/trunk@12166 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a4758ff commit 1aba104

File tree

2 files changed

+723
-106
lines changed

2 files changed

+723
-106
lines changed
 

‎INSTALL

Lines changed: 570 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,21 @@ Building QGIS from source - step by step
2929
4.1. Install XCODE
3030
4.2. Install Qt4 from .dmg
3131
4.3. Install development frameworks for QGIS dependencies
32-
4.3.1. Additional Dependencies : GSL
33-
4.3.2. Additional Dependencies : Expat
34-
4.3.3. Additional Dependencies : SIP
35-
4.3.4. Additional Dependencies : PyQt
36-
4.3.5. Additional Dependencies : Bison
32+
4.3.1. Additional Dependencies : General compatibility note
33+
4.3.2. Additional Dependencies : GSL
34+
4.3.3. Additional Dependencies : Expat
35+
4.3.4. Additional Dependencies : SIP
36+
4.3.5. Additional Dependencies : PyQt
37+
4.3.6. Additional Dependencies : Bison
3738
4.4. Install CMAKE for OSX
3839
4.5. Install subversion for OSX
3940
4.6. Check out QGIS from SVN
4041
4.7. Configure the build
42+
4.7.1. Configure the Cmake build
43+
4.7.2. Configure the Xcode build
4144
4.8. Building
45+
4.8.1. Building with Cmake
46+
4.8.2. Building with Xcode
4247
5. Building on GNU/Linux
4348
5.1. Building QGIS with Qt4.x
4449
5.2. Prepare apt
@@ -51,6 +56,14 @@ Building QGIS from source - step by step
5156
5.9. Starting the compile
5257
5.10. Building Debian packages
5358
5.11. Running QGIS
59+
5.12. A practical case: Building QGIS and GRASS from source on Ubuntu with ECW and MrSID formats support
60+
5.12.1. Step 1: install base packages
61+
5.12.2. Step 2: compile and install the ecw libraries
62+
5.12.3. Step 3: download the MrSID binaries
63+
5.12.4. Step 4: compile and install the gdal libraries
64+
5.12.5. Step 5: compile and install GRASS
65+
5.12.6. Step 6: compile and install the GDAL-GRASS libraries
66+
5.12.7. Step 6: compile and install QGIS
5467
6. Creation of MSYS environment for compilation of Quantum GIS
5568
6.1. Initial setup
5669
6.1.1. MSYS
@@ -453,14 +466,20 @@ on qgis.nsi and choose the option 'Compile NSIS Script'.
453466
In this approach I will try to avoid as much as possible building dependencies
454467
from source and rather use frameworks wherever possible.
455468

456-
Included are a few notes for building on Mac OS X 10.5 (Leopard).
469+
Included are a few notes for building on Mac OS X 10.5 (Leopard) and 10.6
470+
(Snow Leopard).
471+
472+
Snow Leopard note: A cmake/qt/sip bug currently exists where a 32-bit
473+
cmake build fails to provide python bindings. This means that python plugin support
474+
is currently lacking for 32-bit builds using cmake in Snow Leopard. See the Xcode
475+
build method to if you require python support.
457476

458477

459478
4.1. Install XCODE
460479
==================
461480

462481
I recommend to get the latest xcode dmg from the Apple XDC Web site. Install
463-
XCODE after the ~941mb download is complete.
482+
XCODE after the ~1gb download is complete.
464483

465484
/!\ Note: It may be that you need to create some symlinks after installing
466485
the XCODE SDK (in particular if you are using XCODE 2.5 on tiger):
@@ -475,29 +494,40 @@ the XCODE SDK (in particular if you are using XCODE 2.5 on tiger):
475494
4.2. Install Qt4 from .dmg
476495
==========================
477496

478-
You need a minimum of Qt4.3.0. I suggest getting the latest (at time of writing).
497+
You need a minimum of Qt-4.3.0. I suggest getting the latest (at time of writing).
498+
499+
Snow Leopard note: If you are building on Snow Leopard, you will need to
500+
decide between 32-bit support in the older, Qt Carbon branch, or 64-bit
501+
support in the Qt Cocoa branch. Appropriate installers are available for both
502+
as of Qt-4.6.0, but the beta version of Qt-4.6.0 has proven to introduce numerous
503+
bugs in Qgis. Unfortunately, the 32-bit branch of Qt currently does not build with
504+
python bindings (see notes below). You can achieve support for python in Qgis with
505+
the Xcode build method noted below.
506+
479507

508+
ftp://ftp.trolltech.com/qt/source/
480509

481-
ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.3.2.dmg
482510

511+
Mac versions are named as:
483512

484-
If you want debug libs, Qt also provide a dmg with these:
485513

514+
qt-mac-opensource-x.y.z.dmg
486515

487-
ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.3.2-debug-libs.dmg
488516

517+
x, y, z being the major, minor and revision version.
489518

490-
I am going to proceed using only release libs at this stage as the download for
491-
the debug dmg is substantially bigger. If you plan to do any debugging though
492-
you probably want to get the debug libs dmg. Once downloaded open the dmg and
493-
run the installer. Note you need admin access to install.
519+
If you want debug frameworks, Qt also provide a dmg with these. These are in
520+
addition to the non-debug frameworks.
521+
522+
Once downloaded open the dmg and run the installer. Note you need admin
523+
privileges to install.
494524

495525
After installing you need to make two small changes:
496526

497527
First edit /Library/Frameworks/QtCore.framework/Headers/qconfig.h and
498528
change
499529

500-
/!\ Note this doesnt seem to be needed since version 4.2.3
530+
/!\ Note: this isn't needed since version 4.2.3
501531

502532
QT_EDITION_Unknown to QT_EDITION_OPENSOURCE
503533

@@ -509,116 +539,161 @@ Second change the default mkspec symlink so that it points to macx-g++:
509539
sudo ln -sf macx-g++ default
510540

511541

542+
/!\ Note: this doesn't seem to be needed since version 4.4.
543+
512544

513545
4.3. Install development frameworks for QGIS dependencies
514546
=========================================================
515547

516548
Download William Kyngesburye's excellent all in one framework that includes
517-
proj, gdal, sqlite3 etc
549+
proj, gdal, sqlite3, etc.
518550

519551

520552
http://www.kyngchaos.com/wiki/software:frameworks
521553

522554

523555
Once downloaded, open and install the frameworks.
524556

525-
William provides an additional installer package for Postgresql/PostGIS. Its
557+
William provides an additional installer package for Postgresql/PostGIS. It's
526558
available here:
527559

528560

529561
http://www.kyngchaos.com/wiki/software:postgres
530562

531563

532-
There are some additional dependencies that at the time of writing are not
533-
provided as frameworks so we will need to build these from source.
564+
Also available is a GRASS application:
565+
566+
567+
http://www.kyngchaos.com/wiki/software:grass
568+
569+
570+
4.3.1. Additional Dependencies : General compatibility note
571+
===========================================================
534572

573+
There are some additional dependencies that, at the time of writing, are not
574+
provided as frameworks or installers so we will need to build these from source.
575+
If you are wanting to build Qgis as a 64-bit application, you will need to
576+
provide the appropriate build commands to produce 64-bit support in dependencies.
577+
Likewise, for 32-bit support on Snow Leopard, you will need to override the
578+
default system architecture, which is 64-bit according to instructions for
579+
individual dependency packages.
535580

536-
4.3.1. Additional Dependencies : GSL
581+
582+
4.3.2. Additional Dependencies : GSL
537583
====================================
538584

539-
Retrieve the Gnu Scientific Library from
585+
Retrieve the current version of the Gnu Scientific Library from:
540586

541587

542-
curl -O ftp://ftp.gnu.org/gnu/gsl/gsl-1.8.tar.gz
588+
ftp://ftp.gnu.org/gnu/gsl/
543589

544590

545-
Then extract it and build it to a prefix of /usr/local:
591+
Then extract it and build it to a prefix of /usr/local. Double-click the source
592+
tarball to unpack it, then cd to the source folder and:
546593

547594

548-
tar xvfz gsl-1.8.tar.gz
549-
cd gsl-1.8
550-
./configure --prefix=/usr/local
595+
./configure
551596
make
552597
sudo make install
553-
cd ..
554598

555599

600+
Snow Leopard note: For explicit 32-bit support in gsl, substitute the standard
601+
configure line with:
602+
603+
604+
./configure --build=i386
605+
606+
607+
And for 64-bit gsl:
608+
609+
610+
./configure --build=x86_64
556611

557-
4.3.2. Additional Dependencies : Expat
612+
613+
614+
4.3.3. Additional Dependencies : Expat
558615
======================================
559616

617+
Snow Leopard note: Snow Leopard includes a usable expat, so this step is
618+
not necessary.
619+
560620
Get the expat sources:
561621

562622

563623
http://sourceforge.net/project/showfiles.php?group_id=10127
564624

565625

626+
Double-click the source tarball to unpack, then cd to the source folder and:
566627

567-
tar xvfz expat-2.0.0.tar.gz
568-
cd expat-2.0.0
569-
./configure --prefix=/usr/local
628+
629+
./configure
570630
make
571631
sudo make install
572-
cd ..
573632

574633

575634

576-
4.3.3. Additional Dependencies : SIP
635+
4.3.4. Additional Dependencies : SIP
577636
====================================
578637

579-
Make sure you have the latest Python fom
638+
Leopard and Snow Leopard note: Leopard and Snow Leopard include a usable Python
639+
2.5 or 2.6, respectively. You can install Python from python.org if preferred.
580640

641+
Make sure you have the latest Python 2.5 from
581642

582-
http://www.python.org/download/mac/
583643

644+
http://www.python.org/download/mac/
584645

585-
Leopard note: Leopard includes a usable Python 2.5. Though you can install Python from python.org if preferred.
586646

587647
Retrieve the python bindings toolkit SIP from
588648

589649

590650
http://www.riverbankcomputing.com/software/sip/download
591651

592652

593-
Then extract and build it (this installs by default into the Python framework):
653+
Double-click the source tarball to unpack it, then cd to the source folder
654+
and (this installs by default into the Python framework):
594655

595656

596-
tar xvfz sip-<version number>.tar.gz
597-
cd sip-<version number>
598657
python configure.py
599658
make
600659
sudo make install
601-
cd ..
602660

603661

604662
Leopard notes
605663

606-
If building on Leopard, using Leopard's bundled Python, SIP wants to install in the system path -- this is not a good idea. Use this configure command instead of the basic configure above:
664+
If building on Leopard, using Leopard's bundled Python, SIP wants to install in the
665+
system path -- this is not a good idea. Use this configure command instead of the
666+
basic configure above:
607667

608668

609669
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip
610670

611671

672+
Snow Leopard notes
673+
674+
If building on Snow Leopard, you need to use one of the following configure lines
675+
based on your installed version of Qt. If you are using 32-bit Qt (Qt Carbon):
676+
677+
678+
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip --arch i386
679+
680+
681+
For 64-bit Qt (Qt Cocoa), use this configure line:
682+
683+
684+
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip --arch x86_64
685+
686+
612687

613-
4.3.4. Additional Dependencies : PyQt
688+
4.3.5. Additional Dependencies : PyQt
614689
=====================================
615690

616691
If you encounter problems compiling PyQt using the instructions
617692
below you can also try adding python from your frameworks dir
618693
explicitly to your path e.g.
619694

620695

621-
export PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:$PATH$
696+
export PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:$PATH
622697

623698

624699
Retrieve the python bindings toolkit for Qt from
@@ -627,17 +702,15 @@ Retrieve the python bindings toolkit for Qt from
627702
http://www.riverbankcomputing.com/software/pyqt/download
628703

629704

630-
Then extract and build it (this installs by default into the Python framework):
705+
Double-click the source tarball to unpack it, then cd to the source folder
706+
and (this installs by default into the Python framework):
631707

632708

633-
tar xvfz PyQt-mac<version number here>
634-
cd PyQt-mac<version number here>
635709
export QTDIR=/Developer/Applications/Qt
636710
python configure.py
637711
yes
638712
make
639713
sudo make install
640-
cd ..
641714

642715

643716
Leopard notes
@@ -648,55 +721,72 @@ If building on Leopard, using Leopard's bundled Python, PyQt wants to install in
648721
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin
649722

650723

651-
There may be a problem with undefined symbols in QtOpenGL on Leopard. Edit QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
724+
If there is a problem with undefined symbols in QtOpenGL on Leopard, edit
725+
QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
726+
Then make again.
652727

728+
Snow Leopard notes
653729

654-
4.3.5. Additional Dependencies : Bison
730+
If building on Snow Leopard, you need to use one of the following configure lines based on your installed version of Qt. If you are using 32-bit Qt (Qt Carbon):
731+
732+
733+
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch i386
734+
735+
736+
For 64-bit Qt (Qt Cocoa), use this configure line:
737+
738+
739+
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch x86_64
740+
741+
742+
743+
4.3.6. Additional Dependencies : Bison
655744
======================================
656745

657-
Leopard note: Leopard includes Bison 2.3, so this step can be skipped on Leopard.
746+
Leopard and Snow Leopard note: Leopard and Snow Leopard includes Bison 2.3, so this step can be skipped on Leopard and Snow Leopard.
658747

659-
The version of bison available by default on Mac OSX is too old so you need to
660-
get a more recent one on your system. Download if from:
748+
The version of bison available by default on Mac OS X 10.4 and older is too old so you need to
749+
get a more recent one on your system. Download at least version 2.3 from:
661750

662751

663-
curl -O http://ftp.gnu.org/gnu/bison/bison-2.3.tar.gz
752+
ftp.gnu.org/gnu/bison/
664753

665754

666-
Now build and install it to a prefix of /usr/local :
755+
Now build and install it to a prefix of /usr/local.� Double-click the source
756+
tarball to unpack it, then cd to the source folder and:
667757

668758

669-
tar xvfz bison-2.3.tar.gz
670-
cd bison-2.3
671759
./configure --prefix=/usr/local
672760
make
673761
sudo make install
674-
cd ..
675762

676763

677764

678765
4.4. Install CMAKE for OSX
679766
==========================
680767

681-
Get the latest release from here:
768+
Get the latest source release from here:
682769

683770

684-
http://www.cmake.org/HTML/Download.html
771+
http://www.cmake.org/cmake/resources/software.html
685772

686773

687-
At the time of writing the file I grabbed was:
774+
Binary installers are available for OS X, but they are not recommended
775+
(2.4 versions install in /usr instead of /usr/local, and 2.6 versions are a
776+
strange application). Instead, download the source, double-click the source tarball,
777+
then cd to the source folder and:
688778

689779

690-
curl -O http://www.cmake.org/files/v2.4/cmake-2.4.6-Darwin-universal.dmg
691-
780+
./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
781+
make
782+
sudo make install
692783

693-
Once downloaded open the dmg and run the installer
694784

695785

696786
4.5. Install subversion for OSX
697787
===============================
698788

699-
Leopard note: Leopard includes SVN, so this step can be skipped on Leopard.
789+
Leopard and Snow Leopard note: Leopard and Snow Leopard include SVN, so this step can be skipped on these Operating Systems.
700790

701791
The http://sourceforge.net/projects/macsvn/ (MacSVN) project has a downloadable
702792
build of svn. If you are a GUI inclined person you may want to grab their gui
@@ -756,16 +846,10 @@ Trunk:
756846
svn co https://svn.osgeo.org/qgis/trunk/qgis qgis
757847

758848

759-
For svn 0.8 branch
760-
849+
For a release branch version x.y.z:
761850

762-
svn co https://svn.osgeo.org/qgis/branches/Release-0_8_0 qgis0.8
763851

764-
765-
For svn 0.9 branch
766-
767-
768-
svn co https://svn.qgis.org/qgis/branches/Release-0_9_0 qgis0.9
852+
svn co https://svn.qgis.org/qgis/branches/Release-x_y_z qgis-x.y.z
769853

770854

771855
The first time you check out QGIS sources you will probably get a message like
@@ -788,6 +872,16 @@ I suggest you press 'p' to accept the key permanently.
788872
4.7. Configure the build
789873
========================
790874

875+
There are 2 different methods to build QGIS: the traditional Cmake method,
876+
and the new Xcode project (starting with QGIS 1.1). The Xcode project has
877+
additional bundling steps, though some optional Qgis features must be explicitly
878+
stated in a user configuration file. The Cmake build handles optional features,
879+
and some bundling steps are available with scripts in the mac directory.
880+
881+
882+
4.7.1. Configure the Cmake build
883+
================================
884+
791885
CMake supports out of source build so we will create a 'build' dir for the
792886
build process. By convention I build my software into a dir called 'apps' in
793887
my home directory. If you have the correct permissions you may want to build
@@ -806,8 +900,10 @@ D SIP_BINARY_PATH=/usr/local/bin/sip"" to the cmake command above,
806900
before the .. at the end, ie:
807901

808902

809-
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ -D CMAKE_BUILD_TYPE=Release -
810-
D SIP_BINARY_PATH=/usr/local/bin/sip ..
903+
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
904+
-D CMAKE_BUILD_TYPE=Release \
905+
-D SIP_BINARY_PATH=/usr/local/bin/sip \
906+
..
811907

812908

813909
To use the application build of GRASS on OSX, you can optionally use the
@@ -816,9 +912,9 @@ version as required):
816912

817913

818914
cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
819-
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.3.app/Contents/MacOS/
915+
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/
820916
include \
821-
-D GRASS_PREFIX=/Applications/GRASS-6.3.app/Contents/MacOS \
917+
-D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
822918
-D CMAKE_BUILD_TYPE=Release \
823919
..
824920

@@ -829,16 +925,66 @@ path and version as required):
829925

830926

831927
cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
832-
-D GRASS_INCLUDE_DIR=/user/local/grass-6.3.0/include \
833-
-D GRASS_PREFIX=/user/local/grass-6.3.0 \
928+
-D GRASS_INCLUDE_DIR=/user/local/grass-6.4.0/include \
929+
-D GRASS_PREFIX=/user/local/grass-6.4.0 \
834930
-D CMAKE_BUILD_TYPE=Release \
835931
..
836932

837933

934+
Snow Leopard note: To handle the appropriate version of Qt (32-bit or 64-bit), you will need to invoke cmake based on which version of Qt you installed.
935+
936+
For 32-bit Qt (Carbon) with GRASS-6.4:
937+
938+
939+
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
940+
-D CMAKE_BUILD_TYPE=Release \
941+
-D SIP_BINARY_PATH=/usr/local/bin/sip
942+
-D CMAKE_C_FLAGS=-m32 \
943+
-D CMAKE_CXX_FLAGS=-m32
944+
-D CMAKE_OSX_ARCHITECTURES=i386
945+
-D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
946+
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include\
947+
..
948+
949+
950+
For 64-bit Qt (Cocoa) with GRASS-6.4:
951+
952+
953+
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
954+
-D CMAKE_BUILD_TYPE=Release \
955+
-D SIP_BINARY_PATH=/usr/local/bin/sip
956+
-D CMAKE_C_FLAGS=-m64 \
957+
-D CMAKE_CXX_FLAGS=-m64
958+
-D CMAKE_OSX_ARCHITECTURES=x86_64
959+
-D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
960+
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include\
961+
..
962+
963+
964+
965+
4.7.2. Configure the Xcode build
966+
================================
967+
968+
In the mac/xcode folder in the source, duplicate the 'qgis_user-template.xcconfig'
969+
file and name it 'qgis_user.xcconfig'. A default build will use the KyngChaos
970+
frameworks, Postgres, GRASS 6.4, the python.org Python 2.5 and extra dependencies
971+
as described above, and compile for the current OSX architecture and version, so no
972+
extra configuration is necessary. If building on Leopard or newer, you may want to
973+
use the system Python, which requires editing qgis_user.xcconfig.
974+
975+
See the mac/xcode/readme.rtf for details, if you need to customize the build.
976+
The default build will also bundle the Qt frameworks, Postgres library, and
977+
other dependency libraries to create a self-contained package. The KyngChaos
978+
frameworks and GRASS application are not bundled.
979+
838980

839981
4.8. Building
840982
=============
841983

984+
985+
4.8.1. Building with Cmake
986+
==========================
987+
842988
Now we can start the build process:
843989

844990

@@ -851,6 +997,38 @@ If all built without errors you can then install it:
851997
make install
852998

853999

1000+
or, for a Unix-style build
1001+
1002+
1003+
sudo make install
1004+
1005+
1006+
1007+
4.8.2. Building with Xcode
1008+
==========================
1009+
1010+
Open the Xcode project file in the mac/xcode directory. Select 'Release' build
1011+
configuration and select the 'Full Qgis' target, then build. If you use ccache,
1012+
there have been compilation problems reported, so it is suggested that you disable
1013+
ccache support.
1014+
1015+
Alternatively, from within the mac/xcode directory, build with the command:
1016+
1017+
1018+
xcodebuild
1019+
1020+
Snow Leopard note: You can also build Qgis using the new llvm compilers supplied
1021+
with Xcode 3.2.x. To do this, you first need to export the proper compiler settings:
1022+
1023+
1024+
export CC=/Developer/usr/bin/llvm-gcc
1025+
export CXX=/Developer/usr/bin/llvm-g++
1026+
xcodebuild
1027+
1028+
1029+
The Qgis application will be found in the 'build/$SYSTEM/Release' folder in the xcode folder.
1030+
Copy this to whereever you like.
1031+
8541032

8551033
5. Building on GNU/Linux
8561034
========================
@@ -1142,6 +1320,319 @@ If all has worked properly the QGIS application should start up and appear
11421320
on your screen.
11431321

11441322

1323+
5.12. A practical case: Building QGIS and GRASS from source on Ubuntu with ECW and MrSID formats support
1324+
========================================================================================================
1325+
1326+
The following procedure has been tested on Ubuntu 8.04, 8.10 and 9.04 32bit. If you want
1327+
to use different versions of the software (gdal, grass, qgis), just make the
1328+
necessary adjustments to the following code. This guide assumes that you don't have
1329+
installed any previous version of gdal, grass and qgis.
1330+
1331+
1332+
5.12.1. Step 1: install base packages
1333+
=====================================
1334+
1335+
First you need to install the necessary packages required to download the source
1336+
code and compile it. Open the terminal and issue the following command:
1337+
1338+
1339+
sudo apt-get install build-essential g++ subversion
1340+
1341+
1342+
1343+
5.12.2. Step 2: compile and install the ecw libraries
1344+
=====================================================
1345+
1346+
Go to the ERDAS web site http://www.erdas.com/ and follow the links
1347+
"'''products --> ECW JPEG2000 Codec SDK --> downloads'''"
1348+
then download the "'''Image Compression SDK Source Code 3.3'''" (you'll need to make a registration
1349+
and accept a license).
1350+
1351+
Uncompress the arquive in a proper location (this guide assumes
1352+
that all the downloaded source code will be placed in the user home)
1353+
and the enter the newly created folder
1354+
1355+
1356+
cd /libecwj2-3.3
1357+
1358+
1359+
Compile the code with the standard commands
1360+
1361+
1362+
./configure
1363+
1364+
1365+
then
1366+
1367+
1368+
make
1369+
1370+
1371+
then
1372+
1373+
1374+
sudo make install
1375+
1376+
1377+
leave the folder
1378+
1379+
1380+
cd ..
1381+
1382+
1383+
1384+
5.12.3. Step 3: download the MrSID binaries
1385+
===========================================
1386+
1387+
Go to the LIZARDTECH web site http://www.lizardtech.com/ and follow the links
1388+
"'''download --> Developer SDKs'''",
1389+
then download the "'''GeoExpress SDK for Linux (x86) - gcc 4.1 32-bit'''"
1390+
(you'll need to make a registration and accept a license).
1391+
1392+
Uncompress the downloaded file. The resulting directory name should be similar to "Geo_DSDK-7.0.0.2167"
1393+
1394+
1395+
5.12.4. Step 4: compile and install the gdal libraries
1396+
======================================================
1397+
1398+
Download the latest gdal source code
1399+
1400+
1401+
svn checkout https://svn.osgeo.org/gdal/trunk/gdal gdal
1402+
1403+
1404+
then copy a few files from the MrSID binaries folder to the folder with the gdal source code
1405+
('''replace "USERNAME" with your actual account username''')
1406+
1407+
1408+
cp /home/USERNAME/Geo_DSDK-7.0.0.2167/include/*.* /home/USERNAME/gdal/frmts/mrsid/
1409+
1410+
1411+
enter the gdal source code folder
1412+
1413+
1414+
cd /gdal
1415+
1416+
1417+
and run configure with a few specific parameters
1418+
1419+
1420+
./configure --without-grass --with-mrsid=../Geo_DSDK-7.0.0.2167 --without-jp2mrsid
1421+
1422+
1423+
at the end of the configuration process you should read something like
1424+
1425+
1426+
...
1427+
GRASS support: no
1428+
...
1429+
...
1430+
...
1431+
ECW support: yes
1432+
MrSID support yes
1433+
...
1434+
1435+
1436+
then compile normally
1437+
1438+
1439+
make
1440+
1441+
1442+
and
1443+
1444+
1445+
sudo make install
1446+
1447+
1448+
finish the process by creating the necessary links to the most recent shared libraries
1449+
1450+
1451+
sudo ldconfig
1452+
1453+
1454+
at this point you may want to check if gdal was compiled correctly with MrSID and ECW
1455+
support by issuing one (or both) of the following commands
1456+
1457+
1458+
gdalinfo --formats | grep 'ECW'
1459+
1460+
1461+
1462+
gdalinfo --formats | grep 'SID'
1463+
1464+
1465+
leave the folder
1466+
1467+
1468+
cd ..
1469+
1470+
1471+
1472+
5.12.5. Step 5: compile and install GRASS
1473+
=========================================
1474+
1475+
Before downloading and compile GRASS source code you need to install a few
1476+
other libraries and programs. We can do this trough apt
1477+
1478+
1479+
sudo apt-get install flex bison libreadline5-dev libncurses5-dev lesstif2-dev debhelper dpatch libtiff4-dev \
1480+
tcl8.4-dev tk8.4-dev fftw-dev xlibmesa-gl-dev libfreetype6-dev autoconf2.13 autotools-dev \
1481+
libgdal1-dev proj libjpeg62-dev libpng12-dev libpq-dev unixodbc-dev doxygen fakeroot cmake \
1482+
python-dev python-qt4-common python-qt4-dev python-sip4 python2.5-dev sip4 libglew1.5-dev libxmu6 \
1483+
libqt4-dev libgsl0-dev python-qt4 swig python-wxversion python-wxgtk2.8 libwxgtk2.8-0 libwxbase2.8-0 tcl8.4-dev \
1484+
tk8.4-dev tk8.4 libfftw3-dev libfftw3-3
1485+
1486+
1487+
At this point we can get the GRASS source code: you may want to download it
1488+
trough svn or maybe you want just to download the latest available source code arquive.
1489+
For example the GRASS 6.4rc4 is available at http://grass.itc.it/grass64/source/grass-6.4.0RC4.tar.gz
1490+
1491+
Uncompress the arquive, enter the newly created folder and run configure with a few specific parameters
1492+
1493+
1494+
./configure --with-tcltk-includes=/usr/include/tcl8.4 --with-proj-share=/usr/share/proj --with-gdal=/usr/local/bin/gdal-config --with-python=/usr/bin/python2.5-config
1495+
1496+
1497+
then as usual (it will take a while)
1498+
1499+
1500+
make
1501+
1502+
1503+
and
1504+
1505+
1506+
sudo make install
1507+
1508+
1509+
leave the folder
1510+
1511+
1512+
cd ..
1513+
1514+
1515+
you have now compiled and installed GRASS (also with the new wxpyhton interface) so you
1516+
may want to give it a try
1517+
1518+
1519+
grass64 -wxpython
1520+
1521+
1522+
1523+
5.12.6. Step 6: compile and install the GDAL-GRASS libraries
1524+
============================================================
1525+
1526+
Create a plain text file named "grass.conf" inside the folder "/etc/ld.so.conf.d"
1527+
1528+
1529+
sudo gedit /etc/ld.so.conf.d/grass.conf
1530+
1531+
1532+
and add the following line
1533+
1534+
1535+
/usr/local/grass-6.4.0RC4/lib/
1536+
1537+
1538+
save and exit.
1539+
1540+
Download the latest version of the gdal-grass library (gdal-grass-1.4.3.tar.gz) from
1541+
http://download.osgeo.org/gdal/
1542+
1543+
uncompress the arquive and enter the newly created folder
1544+
1545+
1546+
cd /gdal-grass-1.4.3
1547+
1548+
1549+
run configure
1550+
1551+
1552+
./configure --with-grass=/usr/local/grass-6.4.0RC4
1553+
1554+
1555+
then as usual
1556+
1557+
1558+
make
1559+
1560+
1561+
and
1562+
1563+
1564+
sudo make install
1565+
1566+
1567+
and finish the process by creating the necessary links to the most recent shared libraries
1568+
1569+
1570+
sudo ldconfig
1571+
1572+
1573+
leave the folder
1574+
1575+
1576+
cd ..
1577+
1578+
1579+
1580+
5.12.7. Step 6: compile and install QGIS
1581+
========================================
1582+
1583+
As for GRASS you can obtain the QGIS source code from different sources,
1584+
for instance from svn or just by downloading one of the source code arquives available
1585+
at http://www.qgis.org/download/sources.html
1586+
1587+
For example download the QGIS 1.1.0 source code here http://download.osgeo.org/qgis/src/qgis_1.1.0.tar.gz
1588+
1589+
uncompress the arquive and enter the newly created folder
1590+
1591+
1592+
cd /qgis_1.1.0
1593+
1594+
1595+
then run ccmake
1596+
1597+
1598+
ccmake .
1599+
1600+
1601+
press the "c" key, then when the option list will appear we need to manually
1602+
configure the "GRASS_PREFIX" parameter. Scroll down until the "GRASS_PREFIX" will appear,
1603+
press enter and manually set it to
1604+
1605+
1606+
/usr/local/grass-6.4.0RC4
1607+
1608+
1609+
then press enter again.
1610+
1611+
Press the "c" again and the option "Press [g] to generate and exit" will appear.
1612+
Press the "g" key to generate and exit.
1613+
1614+
then as usual (it will take a while)
1615+
1616+
1617+
make
1618+
1619+
1620+
and
1621+
1622+
1623+
sudo make install
1624+
1625+
1626+
At the end of the process you should have QGIS and GRASS working with MrSID and ECW
1627+
raster format support.
1628+
1629+
To run QGIS just use this command
1630+
1631+
1632+
qgis
1633+
1634+
1635+
11451636
6. Creation of MSYS environment for compilation of Quantum GIS
11461637
==============================================================
11471638

‎doc/INSTALL.t2t

Lines changed: 153 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,13 @@ on qgis.nsi and choose the option 'Compile NSIS Script'.
363363
In this approach I will try to avoid as much as possible building dependencies
364364
from source and rather use frameworks wherever possible.
365365

366-
Included are a few notes for building on Mac OS X 10.5 (__Leopard__).
366+
Included are a few notes for building on Mac OS X 10.5 (__Leopard__) and 10.6
367+
(__Snow Leopard__).
368+
369+
__Snow Leopard note:__ A cmake/qt/sip bug currently exists where a 32-bit
370+
cmake build fails to provide python bindings. This means that python plugin support
371+
is currently lacking for 32-bit builds using cmake in Snow Leopard. See the Xcode
372+
build method to if you require python support.
367373

368374
== Install XCODE ==
369375

@@ -381,7 +387,15 @@ sudo ln -s /usr/local/ local
381387

382388
== Install Qt4 from .dmg ==
383389

384-
You need a minimum of Qt4.3.0. I suggest getting the latest (at time of writing).
390+
You need a minimum of Qt-4.3.0. I suggest getting the latest (at time of writing).
391+
392+
__Snow Leopard note:__ If you are building on Snow Leopard, you will need to
393+
decide between 32-bit support in the older, Qt Carbon branch, or 64-bit
394+
support in the Qt Cocoa branch. Appropriate installers are available for both
395+
as of Qt-4.6.0, but the beta version of Qt-4.6.0 has proven to introduce numerous
396+
bugs in Qgis. Unfortunately, the 32-bit branch of Qt currently does not build with
397+
python bindings (see notes below). You can achieve support for python in Qgis with
398+
the Xcode build method noted below.
385399

386400
```
387401
ftp://ftp.trolltech.com/qt/source/
@@ -420,10 +434,11 @@ sudo ln -sf macx-g++ default
420434

421435
/!\ Note: this doesn't seem to be needed since version 4.4.
422436

437+
423438
== Install development frameworks for QGIS dependencies ==
424439

425440
Download William Kyngesburye's excellent all in one framework that includes
426-
proj, gdal, sqlite3 etc
441+
proj, gdal, sqlite3, etc.
427442

428443
```
429444
http://www.kyngchaos.com/wiki/software:frameworks
@@ -443,9 +458,15 @@ Also available is a GRASS application:
443458
```
444459
http://www.kyngchaos.com/wiki/software:grass
445460
```
461+
=== Additional Dependencies : General compatibility note ===
446462

447-
There are some additional dependencies that at the time of writing are not
463+
There are some additional dependencies that, at the time of writing, are not
448464
provided as frameworks or installers so we will need to build these from source.
465+
If you are wanting to build Qgis as a 64-bit application, you will need to
466+
provide the appropriate build commands to produce 64-bit support in dependencies.
467+
Likewise, for 32-bit support on Snow Leopard, you will need to override the
468+
default system architecture, which is 64-bit according to instructions for
469+
individual dependency packages.
449470

450471
=== Additional Dependencies : GSL ===
451472

@@ -464,8 +485,25 @@ make
464485
sudo make install
465486
```
466487

488+
__Snow Leopard note:__ For explicit 32-bit support in gsl, substitute the standard
489+
configure line with:
490+
491+
```
492+
./configure --build=i386
493+
```
494+
495+
And for 64-bit gsl:
496+
497+
```
498+
./configure --build=x86_64
499+
```
500+
501+
467502
=== Additional Dependencies : Expat ===
468503

504+
__Snow Leopard note:__ Snow Leopard includes a usable expat, so this step is
505+
not necessary.
506+
469507
Get the expat sources:
470508

471509
```
@@ -480,16 +518,18 @@ make
480518
sudo make install
481519
```
482520

521+
483522
=== Additional Dependencies : SIP ===
484523

485-
Make sure you have the latest Python 2.5 fom
524+
__Leopard and Snow Leopard note:__ Leopard and Snow Leopard include a usable Python
525+
2.5 or 2.6, respectively. You can install Python from python.org if preferred.
526+
527+
Make sure you have the latest Python 2.5 from
486528

487529
```
488530
http://www.python.org/download/mac/
489531
```
490532

491-
__Leopard note:__ Leopard includes a usable Python 2.5. Though you can install Python from python.org if preferred.
492-
493533
Retrieve the python bindings toolkit SIP from
494534

495535
```
@@ -507,12 +547,30 @@ sudo make install
507547

508548
__Leopard notes__
509549

510-
If building on Leopard, using Leopard's bundled Python, SIP wants to install in the system path -- this is not a good idea. Use this configure command instead of the basic configure above:
550+
If building on Leopard, using Leopard's bundled Python, SIP wants to install in the
551+
system path -- this is not a good idea. Use this configure command instead of the
552+
basic configure above:
511553

512554
```
513555
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip
514556
```
515557

558+
__Snow Leopard notes__
559+
560+
If building on Snow Leopard, you need to use one of the following configure lines
561+
based on your installed version of Qt. If you are using 32-bit Qt (Qt Carbon):
562+
563+
```
564+
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip --arch i386
565+
```
566+
567+
For 64-bit Qt (Qt Cocoa), use this configure line:
568+
569+
```
570+
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip --arch x86_64
571+
```
572+
573+
516574
=== Additional Dependencies : PyQt ===
517575

518576
If you encounter problems compiling PyQt using the instructions
@@ -552,11 +610,26 @@ If there is a problem with undefined symbols in QtOpenGL on Leopard, edit
552610
QtOpenGL/makefile and add ""-undefined dynamic_lookup"" to LFLAGS.
553611
Then make again.
554612

613+
__Snow Leopard notes__
614+
615+
If building on Snow Leopard, you need to use one of the following configure lines based on your installed version of Qt. If you are using 32-bit Qt (Qt Carbon):
616+
617+
```
618+
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch i386
619+
```
620+
621+
For 64-bit Qt (Qt Cocoa), use this configure line:
622+
623+
```
624+
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch x86_64
625+
```
626+
627+
555628
=== Additional Dependencies : Bison ===
556629

557-
__Leopard note:__ Leopard includes Bison 2.3, so this step can be skipped on Leopard.
630+
__Leopard and Snow Leopard note:__ Leopard and Snow Leopard includes Bison 2.3, so this step can be skipped on Leopard and Snow Leopard.
558631

559-
The version of bison available by default on Mac OSX is too old so you need to
632+
The version of bison available by default on Mac OS X 10.4 and older is too old so you need to
560633
get a more recent one on your system. Download at least version 2.3 from:
561634

562635
```
@@ -582,7 +655,7 @@ http://www.cmake.org/cmake/resources/software.html
582655

583656
Binary installers are available for OS X, but they are not recommended
584657
(2.4 versions install in /usr instead of /usr/local, and 2.6 versions are a
585-
strange application).� Download the source.� Double-click the source tarball,
658+
strange application). Instead, download the source, double-click the source tarball,
586659
then cd to the source folder and:
587660

588661
```
@@ -593,7 +666,7 @@ sudo make install
593666

594667
== Install subversion for OSX ==
595668

596-
__Leopard note:__ Leopard includes SVN, so this step can be skipped on Leopard.
669+
__Leopard and Snow Leopard note:__ Leopard and Snow Leopard include SVN, so this step can be skipped on these Operating Systems.
597670

598671
The [http://sourceforge.net/projects/macsvn/ MacSVN] project has a downloadable
599672
build of svn. If you are a GUI inclined person you may want to grab their gui
@@ -603,7 +676,6 @@ client too. Get the command line client here:
603676
curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Subversion_1.4.2.zip
604677
```
605678

606-
607679
Once downloaded open the zip file and run the installer.
608680

609681
You also need to install BerkleyDB available from the same
@@ -675,10 +747,10 @@ I suggest you press 'p' to accept the key permanently.
675747

676748
== Configure the build ==
677749

678-
There are 2 different methods to build QGIS.� The traditional Cmake method,
750+
There are 2 different methods to build QGIS: the traditional Cmake method,
679751
and the new Xcode project (starting with QGIS 1.1). The Xcode project has
680-
additional bundling steps, though some optional QGIS features are required due
681-
to limited conditional compilation.� The Cmake build handles optional features,
752+
additional bundling steps, though some optional Qgis features must be explicitly
753+
stated in a user configuration file. The Cmake build handles optional features,
682754
and some bundling steps are available with scripts in the mac directory.
683755

684756
=== Configure the Cmake build ===
@@ -701,8 +773,10 @@ D SIP_BINARY_PATH=/usr/local/bin/sip"" to the cmake command above,
701773
before the "".."" at the end, ie:
702774

703775
```
704-
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ -D CMAKE_BUILD_TYPE=Release -
705-
D SIP_BINARY_PATH=/usr/local/bin/sip ..
776+
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
777+
-D CMAKE_BUILD_TYPE=Release \
778+
-D SIP_BINARY_PATH=/usr/local/bin/sip \
779+
..
706780
```
707781

708782
To use the application build of GRASS on OSX, you can optionally use the
@@ -730,18 +804,48 @@ cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
730804
..
731805
```
732806

807+
__Snow Leopard note:__ To handle the appropriate version of Qt (32-bit or 64-bit), you will need to invoke cmake based on which version of Qt you installed.
808+
809+
For 32-bit Qt (Carbon) with GRASS-6.4:
810+
811+
```
812+
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
813+
-D CMAKE_BUILD_TYPE=Release \
814+
-D SIP_BINARY_PATH=/usr/local/bin/sip
815+
-D CMAKE_C_FLAGS=-m32 \
816+
-D CMAKE_CXX_FLAGS=-m32
817+
-D CMAKE_OSX_ARCHITECTURES=i386
818+
-D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
819+
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include\
820+
..
821+
```
822+
823+
For 64-bit Qt (Cocoa) with GRASS-6.4:
824+
825+
```
826+
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
827+
-D CMAKE_BUILD_TYPE=Release \
828+
-D SIP_BINARY_PATH=/usr/local/bin/sip
829+
-D CMAKE_C_FLAGS=-m64 \
830+
-D CMAKE_CXX_FLAGS=-m64
831+
-D CMAKE_OSX_ARCHITECTURES=x86_64
832+
-D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
833+
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include\
834+
..
835+
```
836+
733837
=== Configure the Xcode build ===
734838

735839
In the mac/xcode folder in the source, duplicate the 'qgis_user-template.xcconfig'
736-
file and name it 'qgis_user.xcconfig'. A default build will use the KyngChaos
840+
file and name it 'qgis_user.xcconfig'. A default build will use the KyngChaos
737841
frameworks, Postgres, GRASS 6.4, the python.org Python 2.5 and extra dependencies
738-
as described above, and compile for the build OSX version, so no extra configuration
739-
is necessary. If building on Leopard, you may want to use the system Python, which
740-
requires editing qgis_user.xcconfig.
842+
as described above, and compile for the current OSX architecture and version, so no
843+
extra configuration is necessary. If building on Leopard or newer, you may want to
844+
use the system Python, which requires editing qgis_user.xcconfig.
741845

742846
See the mac/xcode/readme.rtf for details, if you need to customize the build.
743847
The default build will also bundle the Qt frameworks, Postgres library, and
744-
other dependency libraries to create a self-contained package. The KyngChaos
848+
other dependency libraries to create a self-contained package. The KyngChaos
745849
frameworks and GRASS application are not bundled.
746850

747851
== Building ==
@@ -757,15 +861,37 @@ make
757861
If all built without errors you can then install it:
758862

759863
```
760-
sudo make install
864+
make install
865+
```
866+
867+
or, for a Unix-style build
868+
```
869+
sudo make install
761870
```
762871

763872
=== Building with Xcode ===
764873

765-
Open the xcode project file in Xcode.� Select 'Release' build configuration
766-
and select the 'Full Qgis' target, then build.
874+
Open the Xcode project file in the mac/xcode directory. Select 'Release' build
875+
configuration and select the 'Full Qgis' target, then build. If you use ccache,
876+
there have been compilation problems reported, so it is suggested that you disable
877+
ccache support.
878+
879+
880+
Alternatively, from within the mac/xcode directory, build with the command:
881+
882+
```
883+
xcodebuild
884+
```
885+
__Snow Leopard note:__ You can also build Qgis using the new llvm compilers supplied
886+
with Xcode 3.2.x. To do this, you first need to export the proper compiler settings:
887+
888+
```
889+
export CC=/Developer/usr/bin/llvm-gcc
890+
export CXX=/Developer/usr/bin/llvm-g++
891+
xcodebuild
892+
```
767893

768-
The Qgis application will be found in the 'build/Release' folder in the xcode folder.
894+
The Qgis application will be found in the 'build/$SYSTEM/Release' folder in the xcode folder.
769895
Copy this to whereever you like.
770896

771897
% -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.