Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.43k stars 3.4k forks source link

Build manuals for windows server #7075

Open urosjarc opened 13 hours ago

urosjarc commented 13 hours ago

Prerequesits

Install vcpkg

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg integrate install

Install vcpkg libraries

You have to install all boost libraries otherwise you get compilation errors at the end missing header files.

vcpkg install lua:x64-windows
vcpkg install tbb:x64-windows
vcpkg install bzip2:x64-windows
vcpkg install libzip:x64-windows
vcpkg install boost:x64-windows

Get osrm backend

cd ..
git clone https://github.com/Project-OSRM/osrm-backend.git
cd osrm-backend

Create build and configure cmake

mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ^
    -G "Visual Studio 17 2022" -A x64 ^
    -DENABLE_CCACHE=OFF

If cmake reports some issue regarding libosrm.pc you have to comment out in CMakeLists.txt this lines and restart cmake build again...

file(GENERATE
     OUTPUT
     ${PROJECT_BINARY_DIR}/libosrm.pc
     INPUT
     ${PROJECT_BINARY_DIR}/pkgconfig.configured)

Compile osrm

cmake --build . --config Release

Run osrm

cd Release
osrm-extract.exe germany-latest.osm.pbf -p ../../profiles/car.lua
osrm-partition.exe germany-latest.osrm
osrm-customize.exe germany-latest.osrm
osrm-routed.exe --algorithm mld germany-latest.osrm