wiki:DevWikiWinMingW64_21

Version 24 (modified by robe, 12 years ago) ( diff )

Compiling using Mingw64-w64, Mingw64-w32 for 64-bit/32-bit (work in Progress)

Back to Compiling in Windows

If you want to get to the last step fast to immediately start compiling PostGIS without having to compile the dependencies, you can download our prepared mingw64+msys build environment which you can download from http://www.bostongis.com/postgisstuff/ming64.zip and for 32-bit (for PostgreSQL 9.2+ (32-bit 9.1 and below have to use old msys chain) http://www.bostongis.com/postgisstuff/ming32.zip Then you just extract the zip so you have ming32 and or ming64 on your C:\ming32, C:\ming64 and launch the corresponding msys\msys.bat

Please note that the ming32.zip can be used in windows xp 32-bit - windows 7 32-bit/64-bittt Windows 7 64-bit can definitely build for both the 32-bit and 64-bit by downloading both the ming32 and ming64 and launching the corresponding msys.bat. We haven't ever tried trying to build 64-bit on 32-bit windows so not sure if that is possible. Our build setup is for building on windows, though in theory you can build for windows on Linux by using the mingw64- linux compiled, we have never tried that.

If you want to start with your own mingw64 install and then add additional items refer to DevWikiMingW64_Setup

variables used

For building we always have these variables defined in our sh scripts You can switch the 64 to 32 if you are building with our ming32 environment.

export OS_BUILD=64
export PROJECTS=/c/ming${OS_BUILD}/projects
if [ "$OS_BUILD" == "64" ] ; then
	export MINGHOST=x86_64-w64-mingw32
else
	export MINGHOST=i686-w64-mingw32
fi;

create project folders

The download files we have above already have these folders and we like to keep each set separate. The below we set to 64 for our ming64 folder

cd ${PROJECTS}
mkdir pgx${OS_BUILD}
mkdir postgresql
mkdir geos
mkdir proj
mkdir docbook

GDAL

export GDAL_VER=1.10.0
cd ${PROJECTS}/gdal
wget http://download.osgeo.org/gdal/${GDAL_VER}/gdal-${GDAL_VER}.tar.gz
tar xvfz gdal-${GDAL_VER}.tar.gz
cd gdal-${GDAL_VER}
./configure --host=${MINGHOST} --build=${MINGHOST} --with-curl=no --with-threads=no --prefix=${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD} 
make && make install
cd ${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}/bin
strip *.dll

DOWNLOAD DOCBOOK

cd ${PROJECTS}/docbook

Download the latest Docbook from http://sourceforge.net/projects/docbook/files/docbook-xsl/ into that folder and untar.

Extract somewhere. In this case I chose my projects folder. You'll need to set this folder for the —with-xsldir setting

You should have a folder now docbook/docbook-xsl-1.76.1 or something similar

4. Compiling GEOS

Download latest GEOS source from http://trac.osgeo.org/geos/ You can also use the trunk svn version https://svn.osgeo.org/geos/trunk which is what we use. NOTE: To take advantage of new functions like ST_DelaunayTriangles, you need GEOS 3.4dev which is trunk.

We've never used the tar balls for GEOS we always build from svn and extract into the geos/branches/whateverversion If you are using svn version, make sure to run:

sh autogen.sh
cd ${PROJECTS}/geos/branches/3.4
export GEOS_VER=3.4.0dev

sh autogen.sh
./configure --build=x86_64-w64-mingw32 --prefix=${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD} | tee /c/geos_configure_3.4w${OS_BUILD}.log 
make
make install
make check | tee /c/geos_check_3.4_w${OS_BUILD}.log
strip ${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}/bin/*.dll

—- TO BE CONTINUED —

Note: See TracWiki for help on using the wiki.