Changes between Version 1 and Version 2 of DevWikiWinMingWSys_20
- Timestamp:
- 10/04/10 08:51:38 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevWikiWinMingWSys_20
v1 v2 109 109 {{{ 110 110 # cd /c/projects 111 # mkdir pg 112 # mkdir postgresql 113 # mkdir geos 114 # mkdir proj 111 115 # ls 112 116 }}} … … 143 147 == 9. Compiling PostgreSQL == 144 148 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 149 Download 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 150 155 # make 151 156 # make install … … 153 158 If you want to be able to do a full make check on PostGIS, [UsersWikiWinCompileInitdb Initialize the postgresql database cluster] first. 154 159 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_STRING162 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_STRING167 }}}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_SSPI171 #define SECURITY_WIN32172 #include <ntsecapi.h> <- Add this include line173 #include <security.h>174 #undef SECURITY_WIN32175 }}}176 You can read about this issue [http://pgolub.wordpress.com/2008/12/15/building-postgresql-client-library-using-mingw-under-winxp-sp3/ here] and177 [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.182 160 183 161 == 10. Compiling GEOS == 184 162 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 163 Download 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 189 168 # make 190 169 # make install … … 192 171 To strip all the debug info weight from the libgeos DLL files, run 193 172 {{{ 194 # strip /c/p ostgres/bin/libgeos-3-2-1.dll195 }}} 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 178 If 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. 200 179 201 180 I 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) … … 224 203 * http://download.osgeo.org/proj/proj-datumgrid-1.5.zip 225 204 205 and copy to c:\projects\proj 206 226 207 The datum grid file must be unzipped into the "nad" subdirectory of the Proj4 source tree. 227 208 228 209 {{{ 210 # cd /c/projects/proj 229 211 # tar xvfz proj-4.6.1.tar.gz 230 212 # cd proj-4.6.1 … … 254 236 == 13. Compiling LibXML2 == 255 237 256 LibXML2 is only needed for PostGIS 1.5+.257 258 238 1. mkdir /c/projects/libxml 259 239 2. cd /c/projects/libxml … … 280 260 == 15. Compiling PostGIS == 281 261 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 === 308 263 {{{ 309 264 # tar xvfz postgis-1.5.0.tar.gz … … 325 280 }}} 326 281 327 Might just be me, but to get PostGIS 1.5 to work under PostgreSQL 9.0 beta, had to do these steps right 282 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'. 283 {{{ 284 # make 2>&1 | tee /c/build.log 285 }}} 286 287 Might just be me, but to get PostGIS 2.0. to work under PostgreSQL 9.0, had to do these steps right 328 288 after the ./configure and then follow the rest of the steps above. The PostgreSQL 9.0 mangled 329 289 the ${PERL} global having it point at a strange place. The below hack assumes you already have Perl in search … … 338 298 339 299 1. Copy the following files into your Windows PostgreSQL lib folder 340 * C:\p ostgres\lib\postgis-1.4.dll300 * C:\projects\pg90\lib\postgis-2.0.dll 341 301 2. Copy the following files into your Windows PostgreSQL bin folder. 342 * C:\p ostgres\bin\libgeos-3-2-0.dll343 * C:\p ostgres\bin\libgeos_c-1.dll344 * C:\p ostgres\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, 345 305 * C:\postgres\bin\libiconv-2.dll (from C:\MinGW\bin) 346 306 * C:\postgres\bin\libpq.dll (from C:\postgres\lib) … … 355 315 6. Open a new query-window to your new database 356 316 7. Add PL/PgSQL procedural language to the new database: createlang plpgsql 357 8. Run postgis.sql and spatial_ref_sys.sql from C:\p ostgres\share\contrib\317 8. Run postgis.sql and spatial_ref_sys.sql from C:\projects\pg\share\contrib\ 358 318 359 319 Hopefully you now have a database running your recently compiled postgis.