5.5 KiB
Building OSRM for Windows
Dependencies
Get a decent Windows with decent Visual Studio (14 at least for C++11 support). The published binaries are build with VS2019 and Windows SDK8.1.
In case you are using prepacked Windows VM with VS2019, you have to install Windows SDK 8.1
Prepare directories for dependencies, build and target file location.Target directory ($target starting from that moment) should have /include and /lib subdirectories.
Bzip2
-
Download either from Wolt OSRM mirror or original distribution and unpack.
-
Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
-
Issue
nmake /f makefile.msc
-
Copy bzlib.h to $target\include and libbz2.lib to $target\lib
ZLib
-
Download either from Wolt OSRM mirror or original distribution and unpack.
-
Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
-
Switch to
contrib\vstudio\vc14
-
If needed, open
zlibvc.sln
with Visual Studio and retarget to your version of compiler and SDK. -
Issue
msbuild zlibvc.sln /p:BuildInParallel=true /p:Configuration=Release /p:Platform=x64 /m:<Number of cpu cores>
-
Copy x64\ZlibStatRelease\zlibstat.lib to $target\lib\libz.lib, copy zlib.h and zconf.h to $target\include
ICU
- Download either from Wolt OSRM mirror or original distribution and unpack.
- Do retarget if neededby openinig .\source\allinone\allinone.sln and editing projects
- Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
- Run build: msbuild .\source\allinone\allinone.sln /nologo /p:BuildInParallel=true /p:Configuration=Release /p:Platform=x64 /m:
- Copy lib64*.lib to $target\lib, copy include contents to $target\include
- Copy bin64*dll to any dir withing your $PATH. At the same time copy them to $target\lib
Boost
-
Download either from Wolt OSRM mirror or original distribution and unpack.
-
Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
-
Build b2: bootstrap.bat --with-toolset=msvc-14.2
-
Build boost: b2 -a -d release state --build-type=minimal toolset=msvc-14.2 -q runtime-link=shared link=static address-model=64 --with-iostreams --with-test --with-thread --with-filesystem --with-date_time --with-system --with-program_options --with-regex --disable-filesystem2 -sHAVE_ICU=1 include=\include library-path=\lib -sZLIB_SOURCE=/zlib -zBZIP2_BINARY=libbz2 -sBZIP2_INCLUDE=\include -sBZIP2_LIBPATH=\lib -sICU_ICUUC_NAME=icuuc -sICU_ICUDT_NAME=icudt -sICU_ICUIN_NAME=icuin -sBUILD=boost_unit_test_framework -j
-
Copy
boost
subdirectory to \include and contents ofstage
to \lib
Expat
- Download either from Wolt OSRM mirror or original distribution and unpack.
- Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
- Configure build my calling cmake: mkdir expat\build cd expat\build cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_SHARED_LIBS=OFF ..
- Build expat:
msbuild expat.sln /nologo /p:Configuration=Release /p:Platform=x64
- Copy
Release\libexpat.*
to /lib. Copyexpat/lib/expat.h
andexpat/lib/expat_external.h
to /include
LUA
- Download either from Wolt OSRM mirror or original distribution and unpack.
- Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
- Lua doesn't have native MSVC support, so you have to compile it by hand: cd src cl /MD /O2 /c /DLUA_COMPAT_5_2 *.c ren lua.obj lua.o ren luac.obj luac.o link /LIB /OUT:lua5.3.5.dll *.obj
- Copy
lua5.3.5.lib
to /lib. Copylua.h
,lauxlib,h
,lua.hpp
,lualib.h
,luaconf.h
to /include
TBB
- Download either from Wolt OSRM mirror or original distribution and unpack.
- Retarget by opening build\vs2013\makefile.sln
- Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
- Switch to build\vs2013 and build:
msbuild makefle.sln /nologo /p:Configuration=Release /p:Platform=x64
- Copy x64/Release/*.{dll,lib} files to /lib and copy contents of include directory to /include