Skip to content

Windows Compilation

Daniel J. H edited this page Jan 13, 2016 · 22 revisions

To start compiling we need following software installed:

  1. Microsoft compiler and libraries:
  1. Git for Windows:
  • http://msysgit.github.io/ (also includes msys linux-like command prompt) (check "use Git from the Windows command prompt" when installing)
  1. CMake
  1. Far Manager may simplify things with the Windows command prompt

All command-line compilation should be done from VS2013 64 bit command prompt (in Start menu)


Choose a folder for compiled dependencies (no standard paths for that in Windows), i.e. "d:\libs" and place the needed sources somehere else.

  1. Unpack somewhere zlib, bz2 and libxml sources (no stable repositories),
  1. Compile Boost.
  • Download and & unpack Boost 1.55: http://sourceforge.net/projects/boost/files/boost/1.55.0/
  • Use build_boost.bat or run the following from the command prompt:
  • Run bootstrap.bat from SDK command prompt.
  • bjam toolset=msvc-12.0 variant=release address-model=64 threading=multi link=static runtime-link=shared --prefix=d:\libs\boost -sBZIP2_SOURCE="d:\build\bzip2-1.0.6" -sZLIB_SOURCE="d:\build\zlib-1.2.8" install (for 64-bit static release boost, to compile all variants just omit variant=release link=static threading=multi, for VS2012 use msvc-11.0)
  • On VS2013 you may need to fix incompatibility https://svn.boost.org/trac/boost/ticket/9332 , replace file has_member_function_callable_with.hpp with the given one.
  1. Compile protobuf, osm-binary and Lua+LuaBind (did not try LuaJit)
  • Run build_other.bat (or follow thesame procedure as its contents - clone, cmake with flags, nmake install)
  1. Build stxxl
  • Run build_stxxl.bat
  • some errors may follow, in that case patch cmakelists.txt to exclude problematic .cpp (recursive template typedefs- error), see stxxl_win.patch (seem to work without it on VS2013 and latest stxxl)
  1. Compile OSRM :)
  • See build_osrm.bat (change the paths to actual ones).
  • Boost-finding errors are often, be sure to compile boost with the same bitness thatnt OSRM and with the same verion of compiler

= Notes =

  • You can compile some of the cmake-based projects under Visual Studio, replacing generator -G "NMake Makefiles" with -G "Visual Studio 12 Win64" (VS2013) or -G "Visual Studio 11 Win64" (VS2012).
  • It is also convenient to use QtCreator IDE (it supports cmake), I was even able to debug running OSRM.
  • Necessary DLLs from libs\bin should be available in system PATH or current folder to run OSRM.
  • For testing you need to install Ruby:\ http://rubyinstaller.org/news/2013/11/24/rubyinstaller-1-9-3-p484-and-2-0-0-p353-released/ (then gem install bundle, bundle install)