0.x/CreateWindowsBinary

Note: this manual page is a checklist of what is needed to build a Windows binary for pgRouting. It was used for an early version of pgRouting, so it might be outdated at some points.


Environment

Download prebuild-dll-2-7-0-release from  ftp://sources.redhat.com/pub/pthreads-win32/

cp /include/*.h /mingw/include
cp /lib/libpthreadGC2.a /mingw/lib/libpthread.a

Boost

Use latest version(1.33.1)

#bjam -sTOOLS=mingw "-sBUILD=release <runtime-link>static <threading>multi <native-wchar_t>on" --prefix=/c/msys/1.0/local install
#mv /usr/local/include/boost-1_33_1/boost /usr/local/include/boost
#rmdir /usr/local/include/boost-1_33_1

Gaul

Use latest version(0.1849-0)

#./configure --enable-slang=no
edit /util/Makefile
	DEFS = -DHAVE_CONFIG_H
	 -> DEFS = -DHAVE_CONFIG_H -DBUILDING_DLL
edit /src/Makefile
	DEFS = -DHAVE_CONFIG_H
	 -> DEFS = -DHAVE_CONFIG_H -DBUILDING_DLL
	INCLUDES = -I../util/ -I../../util/
	 -> INCLUDES = -I../util -I../../util
edit /tests/Makefile
	DEFS = -DHAVE_CONFIG_H
	 -> DEFS = -DHAVE_CONFIG_H -DBUILDING_DLL
	INCLUDES = -I../util/ -I../../util/ -I../src/ -I../../src/ -I/usr/include/slang/
	 -> INCLUDES = -I../util -I../../util -I../src -I../../src -I/usr/include/slang/
#make
#make install

CGAL

Use latest version(3.2.1)

#./install_cgal --prefix=/usr/local/cgal  --with-BOOST --BOOST_INCL_DIR=/usr/local/include --BOOST_LIB_DIR=/usr/local/lib --without-autofind -ni /mingw/bin/g++
#cp /usr/local/cgal/include/CGAL/config/i686_MINGW32NT-5.1_g++-3.4.2/CGAL/compiler_config.h /usr/local/cgal/include/CGAL/compiler_config.h
#cp /usr/local/cgal/lib/i686_MINGW32NT-5.1_g++-3.4.2/libCGAL.a /usr/local/cgal/lib/libCGAL.a
#cp /usr/local/cgal/lib/i686_MINGW32NT-5.1_g++-3.4.2/libCGAL.so /usr/local/cgal/lib/libCGAL.so

pgRouting

#./configure --with-boost=/usr/local --with-cgal=/usr/local/cgal --with-gaul=/usr/local

Edit sys/time.h

comment out timezone struct
comment out gettimeofday function

Edit Makefile

BOOST_PATH=/usr/local/include/boost/graph
-> BOOST_PATH=/usr/local/include
GAUL_PATH =/usr/local/include/gaul
-> GAUL_PATH =/usr/local/include
TSP_LIBS= -L$(GAUL_LIB) -lgaul_util -lgaul
-> TSP_LIBS= -L$(GAUL_LIB) -lgaul -lgaul_util -lm
$(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(GAUL_PATH) -c tsp_solver.cpp
-> $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(GAUL_PATH) -DBUILDING_DLL -c tsp_solver.cpp
$(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(CGAL_PATH) -c alpha_drivedist.cpp
-> $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(BOOST_PATH) -I$(CGAL_PATH) -c alpha_drivedist.cpp
#make
#make install