wiki:BuildingOnMINGW64CMake

Version 11 (modified by robe, 11 years ago) ( diff )

--

Building on Windows with CMake and mingw64 chain

## I was using the mingw64 pre-compiled build - http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-release/ ( x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z ) but should work with any mingw64 build.

Just for reference my preferred structure -- the way I have setup so I can build both 32-bit and 64-bit is like so

C:\ming64
     \projects
     \mingw64  (this is where I extract the binaries for mingw I download from mingw64 site)
     \msys  (this is where I put the msys posix environment details [here http://sourceforge.net/apps/trac/mingw-w64/wiki/MSYS] )

C:\ming32
   \projects
   \msys  (exact copy of the one in 64-bit but I like to keep separate since I set install environment to target the mingw32)
   \mingw32 (this is where I put the mingw64-w32 binaries I get from mingw-w64 (32-bit personal builds) )

You can use the regular CMake 32-bit binaries to build 64-bit and just extract somewhere e.g. to root of http://cmake.org/cmake/resources/software.html (

latest now is http://www.cmake.org/files/v2.8/cmake-2.8.11-win32-x86.zip which should work fine

and then extract anywhere you like for exampl all in C:\cmake so you have C:\cmake, C:\cmake\bin etc. and can reference from msys with /c/cmake)

Configure

Building from SVN development branch requires to generate the geos_svn_revision.h file with POSIX shell script. I do this under msys but any posix should work fine.

tools\svn_repo_revision.sh

## NOTE: for this I had to use some suggestions ## from http://osgeo-org.1560.x6.nabble.com/Compiling-geos-with-mingw64-td5034567.html which are not committed yet

I submitted a patch on ticket #630 which is now incorporated in 3.3 and 3.4

My shell script for building looks like this

export OS_BUILD=64
export PATH=".:/bin:/include:/mingw/bin:/mingw/include:/c/Windows/system32:/c/Windows:/usr/local/bin:/c/cmake/bin"
export PROJECTS=/c/ming${OS_BUILD}/projects
cd geos/trunk
export GEOS_VER=3.4.0dev
tools/svn_repo_revision.sh
cd ..
rm -rf build
mkdir -p build
cd build

## if building for windows 64-bit you need to add the -DHAVE_LONG_LONG_INT_64
##  because geos for some reason can't figure this out
##  (for 32-bit you should leave it out)
## without -DGEOS_ENABLE_INLINE=NO get linker failures of duplicate .inl
## geos in theory should be able to figure out that -DHAVE_STD_ISNAN too but can't for mingw64 (both 32-bit and 64-bit chains)

cmake -G "MSYS Makefiles" ../trunk -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD} -DHAVE_STD_ISNAN=1 -DHAVE_LONG_LONG_INT_64=1 -DGEOS_ENABLE_INLINE=NO  -DGEOS_ENABLE_TESTS=ON 
make
make test
make check
make install

strip ${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}/bin/*.dll

Output of tests should look something like

Running tests...
Test project C:/ming64/projects/geos/branches/geos-3.4/build/mingw
    Start 1: geos_unit
1/4 Test #1: geos_unit ........................   Passed    0.19 sec
    Start 2: xmltester
2/4 Test #2: xmltester ........................   Passed    6.72 sec
    Start 3: bug234
3/4 Test #3: bug234 ...........................   Passed    0.01 sec
    Start 4: TestSweepLineSpeed
4/4 Test #4: TestSweepLineSpeed ...............   Passed    1.79 sec

100% tests passed, 0 tests failed out of 4

Total Test time (real) =   8.73 sec
Scanning dependencies of target check
Test project C:/ming64/projects/geos/branches/geos-3.4/build/mingw
    Start 1: geos_unit
1/4 Test #1: geos_unit ........................   Passed    0.14 sec
    Start 2: xmltester
2/4 Test #2: xmltester ........................   Passed    6.69 sec
    Start 3: bug234
3/4 Test #3: bug234 ...........................   Passed    0.01 sec
    Start 4: TestSweepLineSpeed
4/4 Test #4: TestSweepLineSpeed ...............   Passed    1.78 sec

100% tests passed, 0 tests failed out of 4

Total Test time (real) =   8.63 sec
Built target check

Open Tickets

No results

Note: See TracWiki for help on using the wiki.