Skip to content

Commit

Permalink
update mingw32/64 build instruction.
Browse files Browse the repository at this point in the history
  • Loading branch information
geosanak committed Mar 12, 2013
1 parent a21c7fb commit 2a66052
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 24 deletions.
28 changes: 17 additions & 11 deletions BUILD.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ MinGW/MSYS

CMake
-------------------------------------------------------------
Use latest version(2.8.8) (win32 binary package)
Use latest version(2.8.10) (win32 binary package)

http://www.cmake.org/files/v2.8/cmake-2.8.8-win32-x86.exe
http://www.cmake.org/files/v2.8/cmake-2.8.10-win32-x86.exe

Run the installer, and select 'Add CMake to the system PATH for xxx'.

Expand All @@ -54,17 +54,23 @@ Boost
$ wget http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.zip
$ unzip boost_1_46_1.zip
$ cd boost_1_46_1

Add "C:\MinGW\bin" to the system PATH.

$ start cmd

Execute from Command Prompt:

>bootstrap.bat mingw
>bootstrap.bat gcc
>exit

Then execute from MinGW Shell:

$ bjam toolset=gcc address-model=32 define=BOOST_USE_WINDOWS_H link=static threading=multi --with-thread --prefix=/usr/local install

* Above bjam build instruction is quoted from the following site.
[Unable to build Boost libraries with GCC - Stack Overflow]
http://stackoverflow.com/questions/5299468/unable-to-build-boost-libraries-with-gcc

CGAL
-------------------------------------------------------------
Expand Down Expand Up @@ -103,22 +109,22 @@ Gaul

PostgreSQL
-------------------------------------------------------------
Use latest version(9.1.4)
Use latest version(9.2.3)

http://www.enterprisedb.com/postgresql-914-installers-win32?ls=Crossover&type=Crossover
http://www.enterprisedb.com/postgresql-923-installers-win32?ls=Crossover&type=Crossover

Run the installer, and install PostGIS(1.x/2.x) from Stack Builder.

Next, build source for header include:

$ cd /c/build
$ wget http://ftp.postgresql.org/pub/source/v9.1.4/postgresql-9.1.4.tar.bz2
$ tar xvfj postgresql-9.1.4.tar.bz2
$ cd postgresql-9.1.4
$ ./configure --prefix=/usr/local/postgresql-9.1.4
$ wget http://ftp.postgresql.org/pub/source/v9.2.3/postgresql-9.2.3.tar.bz2
$ tar xvfj postgresql-9.2.3.tar.bz2
$ cd postgresql-9.2.3
$ ./configure --prefix=/usr/local/postgresql-9.2.3
$ make
$ make install
$ cd /usr/local/postgresql-9.1.4/lib
$ cd /usr/local/postgresql-9.2.3/lib
$ mv libpq.a libpq.a.mingw

Then export library file for link EnterpriseDB.
Expand All @@ -127,7 +133,7 @@ PostgreSQL
$ cd /c/PROGRA~2/PostgreSQL/9.1/lib
$ pexports libpq.dll > libpq.def
$ dlltool -U -d libpq.def -l libpq.a
$ cp libpq.a /usr/local/postgresql-9.1.4/lib/
$ cp libpq.a /usr/local/postgresql-9.2.3/lib/


pgRouting
Expand Down
32 changes: 19 additions & 13 deletions BUILD.mingw64
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ MinGW/MSYS

CMake
-------------------------------------------------------------
Use latest version(2.8.8) (win32 binary package)
Use latest version(2.8.10) (win32 binary package)

http://www.cmake.org/files/v2.8/cmake-2.8.8-win32-x86.exe
http://www.cmake.org/files/v2.8/cmake-2.8.10-win32-x86.exe

Run the installer, and select 'Add CMake to the system PATH for xxx'.

Expand All @@ -45,17 +45,23 @@ Boost
$ wget http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.zip
$ unzip boost_1_46_1.zip
$ cd boost_1_46_1

Add "C:\ming64\mingw64\bin" to the system PATH.

$ start cmd

Execute from Command Prompt:

>bootstrap.bat mingw
>bootstrap.bat gcc
>exit

Then execute from MinGW Shell:

$ bjam toolset=gcc address-model=64 define=BOOST_USE_WINDOWS_H link=static threading=multi --with-thread --prefix=/usr/local install

* Above bjam build instruction is quoted from the following site.
[Unable to build Boost libraries with GCC - Stack Overflow]
http://stackoverflow.com/questions/5299468/unable-to-build-boost-libraries-with-gcc

CGAL
-------------------------------------------------------------
Expand Down Expand Up @@ -105,40 +111,40 @@ Gaul

PostgreSQL
-------------------------------------------------------------
Use latest version(9.1.4)
Use latest version(9.2.3)

http://www.enterprisedb.com/postgresql-914-installers-win64?ls=Crossover&type=Crossover
http://www.enterprisedb.com/postgresql-923-installers-win64?ls=Crossover&type=Crossover

Run the installer, and install PostGIS(1.x/2.x) from Stack Builder.

Next, build source for header include:

$ cd /c/build64
$ wget http://ftp.postgresql.org/pub/source/v9.1.4/postgresql-9.1.4.tar.bz2
$ tar xvfj postgresql-9.1.4.tar.bz2
$ cd postgresql-9.1.4
$ ./configure --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-float8-byval --without-zlib --prefix=/usr/local/postgresql-9.1.4
$ wget http://ftp.postgresql.org/pub/source/v9.2.3/postgresql-9.2.3.tar.bz2
$ tar xvfj postgresql-9.2.3.tar.bz2
$ cd postgresql-9.2.3
$ ./configure --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-float8-byval --without-zlib --prefix=/usr/local/postgresql-9.2.3
$ make
$ make install
$ cd /usr/local/postgresql-9.1.4/lib
$ cd /usr/local/postgresql-9.2.3/lib
$ mv libpq.a libpq.a.mingw

Then export library file for link EnterpriseDB.
(Run "c:\ming64\msys\msys.bat" as adminstrator):

$ cd /c/PROGRA~1/PostgreSQL/9.1/lib
$ cd /c/PROGRA~1/PostgreSQL/9.2/lib
$ pexports libpq.dll > libpq.def
*** If pexports not found, use "MinGW Shell"(32bit).
$ dlltool -U -d libpq.def -l libpq.a
$ cp libpq.a /usr/local/postgresql-9.1.4/lib/
$ cp libpq.a /usr/local/postgresql-9.2.3/lib/


pgRouting
-------------------------------------------------------------

$ mkdir -p build/mingw
$ cd build/mingw
$ cmake -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_SHARED_LINKER_FLAGS:STRING="-static-libgcc -static-libstdc++ -Wl,--enable-stdcall-fixup" -DPOSTGRESQL_INCLUDE_DIR:PATH=/usr/local/postgresql-9.1.4/include/server -DPOSTGRESQL_LIBRARIES:FILEPATH=/usr/local/postgresql-9.1.4/lib/libpostgres.a -DPOSTGRESQL_EXECUTABLE:PATH=/usr/local/postgresql-9.1.4/bin -DBoost_INCLUDE_DIR:PATH=/usr/local/include/boost-1_46_1 -DBOOST_THREAD_LIBRARIES:FILEPATH=/usr/local/lib/libboost_thread-mgw45-mt-1_46_1.a -DGAUL_INCLUDE_DIR:PATH=/usr/local/include -DGAUL_LIBRARIES:FILEPATH=/usr/local/lib/libgaul.a -DGAUL_UTIL_LIBRARIES:FILEPATH=/usr/local/lib/libgaul_util.a -DCGAL_INCLUDE_DIR:PATH=/usr/local/include -DCGAL_LIBRARIES:FILEPATH=/usr/local/lib/libCGAL.a -DGMP_LIBRARIES:FILEPATH=/usr/local/lib/libCGAL.a -DWITH_TSP=ON -DWITH_DD=ON ../../
$ cmake -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_SHARED_LINKER_FLAGS:STRING="-static-libgcc -static-libstdc++ -Wl,--enable-stdcall-fixup" -DPOSTGRESQL_INCLUDE_DIR:PATH=/usr/local/postgresql-9.2.3/include/server -DPOSTGRESQL_LIBRARIES:FILEPATH=/usr/local/postgresql-9.2.3/lib/libpostgres.a -DPOSTGRESQL_EXECUTABLE:PATH=/usr/local/postgresql-9.2.3/bin -DBoost_INCLUDE_DIR:PATH=/usr/local/include/boost-1_46_1 -DBOOST_THREAD_LIBRARIES:FILEPATH=/usr/local/lib/libboost_thread-mgw45-mt-1_46_1.a -DGAUL_INCLUDE_DIR:PATH=/usr/local/include -DGAUL_LIBRARIES:FILEPATH=/usr/local/lib/libgaul.a -DGAUL_UTIL_LIBRARIES:FILEPATH=/usr/local/lib/libgaul_util.a -DCGAL_INCLUDE_DIR:PATH=/usr/local/include -DCGAL_LIBRARIES:FILEPATH=/usr/local/lib/libCGAL.a -DGMP_LIBRARIES:FILEPATH=/usr/local/lib/libCGAL.a -DWITH_TSP=ON -DWITH_DD=ON ../../
$ make
$ make install
$ cd lib
Expand Down

0 comments on commit 2a66052

Please sign in to comment.