Changes between Version 1 and Version 2 of DevWikiWinMingWSys_20


Ignore:
Timestamp:
Oct 4, 2010, 8:51:38 AM (14 years ago)
Author:
robe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • DevWikiWinMingWSys_20

    v1 v2  
    109109{{{
    110110# cd /c/projects
     111# mkdir pg
     112# mkdir postgresql
     113# mkdir geos
     114# mkdir proj
    111115# ls
    112116}}}
     
    143147== 9. Compiling PostgreSQL ==
    144148
    145 Download latest [http://www.postgresql.org/ftp/source/ PostgreSQL source] and untar in C:\projects
    146 {{{
    147 # tar xvfz postgresql-8.4.3.tar.gz
    148 # cd postgresql-8.4.3
    149 # ./configure --prefix=/c/postgres
     149Download latest [http://www.postgresql.org/ftp/source/ PostgreSQL source] and untar in C:\projects\postgresql
     150{{{
     151# cd /c/projects/postgresql
     152# tar xvfz postgresql-9.0.0.tar.gz
     153# cd postgresql-9.0.0
     154# ./configure --prefix=/c/projects/pg/pg90
    150155# make
    151156# make install
     
    153158If you want to be able to do a full make check on PostGIS, [UsersWikiWinCompileInitdb Initialize the postgresql database cluster] first.
    154159   
    155 Note that we now have changed the install-directory from /c/MingW to /c/postgres.
    156 
    157 === PostgreSQL 8.3 ===
    158 
    159 If you are compiling PostgreSQL 8.3 and you get a compilation error like this:
    160 {{{
    161 e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sspi.h:60: error: syntax error before SECURITY_STRING
    162 In file included from e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/security.h:39,
    163 from libpq-int.h:57,
    164 from fe-auth.h:18,
    165 from fe-auth.c:48:
    166 e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ntsecpkg.h:123: error: syntax error before SECURITY_STRING
    167 }}}
    168 The solution is to edit two of the PostgreSQL source files, src/include/libpq/libpq-be.h and src/interfaces/libpq/libpq-int.h, and add a new line in them in the ENABLE_SSPI block:
    169 {{{
    170 #ifdef ENABLE_SSPI
    171 #define SECURITY_WIN32
    172 #include <ntsecapi.h> <- Add this include line
    173 #include <security.h>
    174 #undef SECURITY_WIN32
    175 }}}
    176 You can read about this issue [http://pgolub.wordpress.com/2008/12/15/building-postgresql-client-library-using-mingw-under-winxp-sp3/ here] and
    177 [http://postgresqlorg.blogspot.com/2008/09/hackers-83-4-vista-mingw-initdb.html here].
    178 
    179 === PostgreSQL 8.4 ===
    180 
    181 The above problem has been fixed in PostgreSQL 8.4.1.
    182160
    183161== 10. Compiling GEOS ==
    184162
    185 Download latest GEOS source from http://trac.osgeo.org/geos/ either the http://download.osgeo.org/geos/geos-3.2.1.tar.bz2 or http://download.osgeo.org/geos/geos-svn.tar.bz2 .
    186 {{{
    187 # bzip2 -d -c geos-3.2.1.tar.bz2 | tar xvf -
    188 # ./configure --prefix=/c/postgres
     163Download latest GEOS source from http://trac.osgeo.org/geos/ either the http://download.osgeo.org/geos/geos-3.3.0.tar.bz2 or http://download.osgeo.org/geos/geos-svn.tar.bz2 and copy to c:\projects\geos .
     164{{{
     165# cd /c/projects/geos
     166# bzip2 -d -c geos-svn.tar.bz2 | tar xvf -
     167# ./configure --prefix=/c/projects/geos/rel-3.3.0
    189168# make
    190169# make install
     
    192171To strip all the debug info weight from the libgeos DLL files, run
    193172{{{
    194 # strip /c/postgres/bin/libgeos-3-2-1.dll
    195 }}}
    196 
    197 === GEOS 3.2 ===
    198 
    199 If you are compiling the latest GEOS 3.2 (the SVN version), you may get an error because of a bug in MinGW. GEOS 3.2 is needed to take advantage of the new ST_Buffer enhancements in PostGIS 1.5+ and also some fixes for topology exceptions in intersects and intersection.
     173# strip /c/projects/bin/geos/rel-3.3.0/*.dll
     174}}}
     175
     176=== GEOS 3.3 ===
     177
     178If you are compiling the latest GEOS 3.2/3.3 (the SVN version), you may get an error because of a bug in MinGW. GEOS 3.2 is needed to take advantage of the new ST_Buffer enhancements in PostGIS 1.5+ and also some fixes for topology exceptions in intersects and intersection.
    200179
    201180I had to comment out the lines as seen below, lines 159 and 166 in C:\MinGW\include\c++\3.4.5\cwchar (the same issue still exists under gcc 4.4.0)
     
    224203 * http://download.osgeo.org/proj/proj-datumgrid-1.5.zip
    225204
     205and copy to c:\projects\proj
     206
    226207The datum grid file must be unzipped into the "nad" subdirectory of the Proj4 source tree.
    227208
    228209{{{
     210# cd /c/projects/proj
    229211# tar xvfz proj-4.6.1.tar.gz
    230212# cd proj-4.6.1
     
    254236== 13. Compiling LibXML2 ==
    255237
    256 LibXML2 is only needed for PostGIS 1.5+.
    257 
    258238 1. mkdir /c/projects/libxml
    259239 2. cd /c/projects/libxml
     
    280260== 15. Compiling PostGIS ==
    281261
    282 === PostGIS 1.4 ===
    283 
    284 Download http://postgis.refractions.net/download/postgis-1.4.1.tar.gz and put in C:/projects
    285 {{{
    286 # tar xvfz postgis-1.4.1.tar.gz
    287 # cd postgis-1.4.1
    288 # ./configure \
    289       --prefix=/c/postgres \
    290       --with-pgconfig=/c/postgres/bin/pg_config \
    291       --with-geosconfig=/c/postgres/bin/geos-config \
    292       --with-projdir=/c/postgres \
    293       --with-gui
    294 # export PATH=/c/postgres/bin:$PATH
    295 # make clean
    296 # make
    297 # make install
    298 # make check
    299 }}}
    300 For running "make check" there is few extra steps that might be needed. See [UsersWikiMakeCheckConsiderations]
    301 
    302 If you run into problems with your build, pipe the output into a file for further analysis. The GUI requires that pkg-config be on your PATH, check that it is there by running 'which pkg-config'.
    303 {{{
    304 # make 2>&1 | tee /c/build.log
    305 }}}
    306 
    307 === PostGIS 1.5 ===
     262=== PostGIS 2.0 ===
    308263{{{
    309264# tar xvfz postgis-1.5.0.tar.gz
     
    325280}}}
    326281
    327 Might just be me, but to get PostGIS 1.5 to work under PostgreSQL 9.0 beta, had to do these steps right
     282If you run into problems with your build, pipe the output into a file for further analysis. The GUI requires that pkg-config be on your PATH, check that it is there by running 'which pkg-config'.
     283{{{
     284# make 2>&1 | tee /c/build.log
     285}}}
     286
     287Might just be me, but to get PostGIS 2.0. to work under PostgreSQL 9.0, had to do these steps right
    328288after the ./configure  and then follow the rest of the steps above.  The PostgreSQL 9.0 mangled
    329289the ${PERL} global having it point at a strange place. The below hack assumes you already have Perl in search
     
    338298
    339299 1. Copy the following files into your Windows PostgreSQL lib folder
    340    * C:\postgres\lib\postgis-1.4.dll
     300   * C:\projects\pg90\lib\postgis-2.0.dll
    341301 2. Copy the following files into your Windows PostgreSQL bin folder.
    342    * C:\postgres\bin\libgeos-3-2-0.dll
    343    * C:\postgres\bin\libgeos_c-1.dll
    344    * C:\postgres\bin\libproj.dll,
     302   * C:\projects\geos\rel-3.3.0\bin\libgeos-3-3-0.dll
     303   * C:\projects\geos\rel-3.3.0\bin\libgeos_c-1.dll
     304   * C:\projects\proj\rel-4.4.6\bin\libproj.dll,
    345305   * C:\postgres\bin\libiconv-2.dll (from C:\MinGW\bin)
    346306   * C:\postgres\bin\libpq.dll (from C:\postgres\lib)
     
    355315 6. Open a new query-window to your new database
    356316 7. Add PL/PgSQL procedural language to the new database: createlang plpgsql
    357  8. Run postgis.sql and spatial_ref_sys.sql from C:\postgres\share\contrib\
     317 8. Run postgis.sql and spatial_ref_sys.sql from C:\projects\pg\share\contrib\
    358318
    359319Hopefully you now have a database running your recently compiled postgis.