[OSRM-talk] running on windows

Wilhelm Berg wb at bergwerk-gis.at
Thu Apr 28 13:22:46 UTC 2016


Thanks for your detailed answer.

Building OSRM yourself:
It won't work with VS2013 as OSRM makes heavy use of C++11 features - these
are not supported by VS2013.
You need VS2015 to compile successfully.

Building should be easy:

Open a default Command Prompt, NOT a VS one.

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

Change
https://github.com/Project-OSRM/osrm-backend/blob/master/appveyor-build.bat#L29
if VS2015 is not installed at the default location
Change
https://github.com/Project-OSRM/osrm-backend/blob/master/build-local.bat#L16
if 7zip is not installed at the default location

* build-local.bat

-----------

I tested
http://download.geofabrik.de/europe/british-isles-latest.osm.pbf
http://download.geofabrik.de/europe/ireland-and-northern-ireland-latest.osm.pbf

on W8.1 and 2008R2 with
http://build.project-osrm.org/latest/osrm_Release.zip

and it worked without problems.


As OSRM needs quite some resources to process data I suggest next thing you
try is to increase swap space (virtual memory) and stxxl to the highest
values possible on your system (aka free disk space).

1GB stxxl is certainly not enough.
The stxxl config file is called ".stxxl.txt" and comes along with
everything else.
Maybe you renamed it to something else? Mind the "." at the beginning of
the file name.

Let me know if increasing virtual memory/stxxl did help.



On Thu, Apr 28, 2016 at 12:51 PM, John Aherne <johnaherne at rocs.co.uk> wrote:

> Thanks for the reply.
>
> Nice to know it should work without problem.
>
> I can compile and build successfully on Ubuntu and have done so many times
> so I think I am following the instructions properly.
>
> There are 2 scenarios:
>
> 1. I download just the binaries for release and try to use them.
>
> All release files are in a single folder.
>
> I copy the pbf file into the same folder
>
> I copy car.lua into profile.lua in the same folder
>
> They require vs2015 dll.
>
> On the W10 Pc I have vs2015 installed
>
> I have an osm.pbf file downloaded from  geofabrik.de for
> british-isles-latest.osm.pbf. and a smaller one for
> ireland-northern-ireland.osm.pbf
>
> The W10 PC is slow but has 4 cores and has 4GB ram. But I'm not fussed
> since I can leave it running.
>
> The stxxl file that gets allocated is 1GB the default since it cannot find
> my ,stxxl config file which is in the same folder as everything else.
>
> The log output from w10 is as follows:
>
> D:\osrm_Release>osrm-extract ireland-and-northern-ireland.osm.pbf
> [info] Input file: ireland-and-northern-ireland.osm.pbf
> [info] Profile: profile.lua
> [info] Threads: 4
> [info] Using script profile.lua
> [STXXL-MSG] STXXL v1.4.99 (prerelease/Release) (git
> 1babe452214b4613a2a488d80073f4185c05a0b3) + gnu parallel(__GLIBCXX__)
> [STXXL-ERRMSG] Warning: no config file found.
> [STXXL-ERRMSG] Using default disk configuration.
> [STXXL-MSG] Disk 'C:\Users\johna\AppData\Local\Temp\stxxl.tmp' is
> allocated, space: 1000 MiB, I/O implementation: wincall delete_on_exit
> queue=0 devid=0
> [info] Parsing in progress..
> [info] input file generated by Osmium (
> http://wiki.openstreetmap.org/wiki/Osmium)
> [info] timestamp: 2013-01-12T19:52:00Z
> [info] Using turn restrictions
> [info] Found 3 exceptions to turn restrictions:
> [info]   motorcar
> [info]   motor_vehicle
> [info]   vehicle
>
> D:\osrm_Release>
>
>
> ---------------------------------------------------------------------------------------
> The W2008 server R2 system is on hyper-v and has 8gb ram and dual xeon 4
> core
>
> I had to install the 2105 C++ runtime to run the extract program since
> there is no vs2015 on this machine.
>
> The stxxl file that gets allocated is 10GB
>
> The log output for W2008 is as follows:
>
> I have no idea where the funny characters come from in the log
>
> D:\osrm_release>osrm-extract british-isles-latest.osm.pbf
> [info] Input file: british-isles-latest.osm.pbf?[0m
> [info] Profile: profile.lua?[0m
> [info] Threads: 8?[0m
> [info] Using script profile.lua?[0m
> [STXXL-MSG] STXXL v1.4.99 (prerelease/Release) (git
> 1babe452214b4613a2a488d80073
> f4185c05a0b3) + gnu parallel(__GLIBCXX__)
> [STXXL-MSG] Disk 'c:\temp\stxxl' is allocated, space: 10000 MiB, I/O
> implementation: wincall queue=0 devid=0
> [info] Parsing in progress..?[0m
> [info] input file generated by Osmium (
> http://wiki.openstreetmap.org/wiki/Osmium
> )?[0m
> [info] timestamp: 2015-10-28T22:22:02Z?[0m
> [info] Using turn restrictions?[0m
> [info] Found 3 exceptions to turn restrictions:?[0m
> [info]   motorcar?[0m
> [info]   motor_vehicle?[0m
> [info]   vehicle?[0m
>
> D:\osrm_release>
>
> -------------------------------------------------------------------------------------------------
>
> 2. Compile from sources
>
> This requires vs2013 which is installed on the W10 machine
>
> I am using the batch files that come with the instructions
>
> I download osrm4.9.1 and download all the other libraries needed for the
> compile.
>
> The only file that does not compile is stxxl.
>
> The compiler output is as follows:-
>
> D:\osrm_utils>build_stxxl.bat
>
> D:\osrm_utils>SET PREFIX="d:/libs18d"
>
> D:\osrm_utils>SET VARIANT=Release
>
> D:\osrm_utils>rem for older MSVC than VS 2013
>
> D:\osrm_utils>rem SET BOOST_ROOT="d:/libs18/boost"
>
> D:\osrm_utils>rem git clone https://github.com/DennisOSRM/stxxl.git
>
> D:\osrm_utils>git clone https://github.com/stxxl/stxxl.git
> fatal: destination path 'stxxl' already exists and is not an empty
> directory.
>
> D:\osrm_utils>cd stxxl
>
> D:\osrm_utils\stxxl>mkdir build
> A subdirectory or file build already exists.
>
> D:\osrm_utils\stxxl>cd build
>
> D:\osrm_utils\stxxl\build>cmake .. -G "NMake Makefiles"
> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="d:/libs18d"
> -- Detected git refspec 1.4.1-360-g5b9663e sha
> 5b9663e6b769748f3b3d3a9a779b4b89e24d7a27
> -- OpenMP found, enabling built-in parallel algorithms.
> -- Using std::thread and other C++11 library functions.
> -- Configuring done
> -- Generating done
> -- Build files have been written to: D:/osrm_utils/stxxl/build
>
> D:\osrm_utils\stxxl\build>rem for older MSVC than VS 2013
>
> D:\osrm_utils\stxxl\build>rem cmake .. -G "NMake Makefiles"
> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="d:/libs18d"
> -DBOOST_ROOT= -DBoost_USE_STATIC_LIBS=ON
>
> D:\osrm_utils\stxxl\build>nmake install
>
> Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> [  2%] Building CXX object lib/CMakeFiles/stxxl.dir/common/log.cpp.obj
> log.cpp
> D:\osrm_utils\stxxl\include\stxxl/bits/common/mutex.h(187) : error C2797:
> 'stxxl::spin_lock::lck': list initialization inside member initializer list
> or non-static data member initializer is not implemented
> NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\bin\X86_AM~1\cl.exe'
> : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
>
> D:\osrm_utils\stxxl\build>cd ..
>
> D:\osrm_utils\stxxl>cd ..
>
> D:\osrm_utils>
>
> ---------------------------------------------------------------------------------------------------------
>
> If I compile osrm ignoring the fact that stxxl failed I get the following
> log. It might be helpful.
>
>
> D:\osrm_utils>build_osrm.bat
>
> D:\osrm_utils>SET PREFIX="d:/libs18d"
>
> D:\osrm_utils>SET BOOST_ROOT="d:/libs/boost"
>
> D:\osrm_utils>SET VARIANT=Release
>
> D:\osrm_utils>set TBB_INSTALL_DIR=x:/tbb
>
> D:\osrm_utils>set TBB_ARCH_PLATFORM=intel64/vc12
>
> D:\osrm_utils>git clone https://github.com/alex85k/Project-OSRM.git
>  Project-OSRM
> fatal: destination path 'Project-OSRM' already exists and is not an empty
> directory.
>
> D:\osrm_utils>rem git clone https://github.com/DennisOSRM/Project-OSRM
>  Project-OSRM
>
> D:\osrm_utils>cd Project-OSRM
>
> D:\osrm_utils\Project-OSRM>rem MORE STABLE
>
> D:\osrm_utils\Project-OSRM>rem git checkout win-april14
>
> D:\osrm_utils\Project-OSRM>rem Most fresh
>
> D:\osrm_utils\Project-OSRM>git checkout win-038
> Already on 'win-038'
> Your branch is up-to-date with 'origin/win-038'.
>
> D:\osrm_utils\Project-OSRM>rem git checkout develop
>
> D:\osrm_utils\Project-OSRM>mkdir build
> A subdirectory or file build already exists.
>
> D:\osrm_utils\Project-OSRM>cd build
>
> D:\osrm_utils\Project-OSRM\build>cmake .. -G "NMake Makefiles"
> -DCMAKE_BUILD_TYPE=Release -DBZIP2_INCLUDE_DIR="d:/libs18d"/include
> -DBZIP2_LIBRARIES="d:/libs18d"/lib/libbz2.lib
> -DCMAKE_INSTALL_PREFIX="d:/libs18d" -DBOOST_ROOT="d:/libs/boost"
> -DBoost_USE_STATIC_LIBS=ON
> -- Building on a 64 bit system
> -- Configuring OSRM in release mode
> CMake Warning (dev) at CMakeLists.txt:112 (if):
>   Policy CMP0054 is not set: Only interpret if() arguments as variables or
>   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
>   details.  Use the cmake_policy command to set the policy and suppress
> this
>   warning.
>
>   Quoted variables like "MSVC" will no longer be dereferenced when the
> policy
>   is set to NEW.  Since the policy is not set the OLD behavior will be
> used.
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> CMake Warning (dev) at CMakeLists.txt:115 (elseif):
>   Policy CMP0054 is not set: Only interpret if() arguments as variables or
>   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
>   details.  Use the cmake_policy command to set the policy and suppress
> this
>   warning.
>
>   Quoted variables like "MSVC" will no longer be dereferenced when the
> policy
>   is set to NEW.  Since the policy is not set the OLD behavior will be
> used.
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> CMake Warning (dev) at CMakeLists.txt:118 (elseif):
>   Policy CMP0054 is not set: Only interpret if() arguments as variables or
>   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
>   details.  Use the cmake_policy command to set the policy and suppress
> this
>   warning.
>
>   Quoted variables like "MSVC" will no longer be dereferenced when the
> policy
>   is set to NEW.  Since the policy is not set the OLD behavior will be
> used.
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> CMake Warning (dev) at CMakeLists.txt:121 (elseif):
>   Policy CMP0054 is not set: Only interpret if() arguments as variables or
>   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
>   details.  Use the cmake_policy command to set the policy and suppress
> this
>   warning.
>
>   Quoted variables like "MSVC" will no longer be dereferenced when the
> policy
>   is set to NEW.  Since the policy is not set the OLD behavior will be
> used.
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> CMake Warning (dev) at CMakeLists.txt:143 (if):
>   Policy CMP0054 is not set: Only interpret if() arguments as variables or
>   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
>   details.  Use the cmake_policy command to set the policy and suppress
> this
>   warning.
>
>   Quoted variables like "MSVC" will no longer be dereferenced when the
> policy
>   is set to NEW.  Since the policy is not set the OLD behavior will be
> used.
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> -- Boost version: 1.55.0
> -- Found the following Boost libraries:
> --   date_time
> --   filesystem
> --   iostreams
> --   program_options
> --   regex
> --   system
> --   thread
> --   date_time
> --   chrono
> --   zlib
> --   atomic
> -- Found Intel TBB
> -- Looking for LuaJIT 5.2
> -- Could NOT find LUAJIT (missing:  LUAJIT_LIBRARIES)
> -- Looking for Luabind...
> -- Found Luabind: D:/libs18d/lib/luabind.lib
> -- Looking for STXXL...
> CMake Error at C:/Program Files
> (x86)/CMake/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148
> (message):
>   Could NOT find STXXL (missing: STXXL_LIBRARY STXXL_INCLUDE_DIR)
> Call Stack (most recent call first):
>   C:/Program Files
> (x86)/CMake/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388
> (_FPHSA_FAILURE_MESSAGE)
>   cmake/FindSTXXL.cmake:43 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
>   CMakeLists.txt:226 (find_package)
>
>
> -- Configuring incomplete, errors occurred!
> See also "D:/osrm_utils/Project-OSRM/build/CMakeFiles/CMakeOutput.log".
> See also "D:/osrm_utils/Project-OSRM/build/CMakeFiles/CMakeError.log".
>
> D:\osrm_utils\Project-OSRM\build>rem use for debug:
>
> D:\osrm_utils\Project-OSRM\build>rem cmake .. -G "NMake Makefiles"
> -DCMAKE_BUILD_TYPE=Release -DSTXXL_LIBRARY="d:/libs18d"/lib/stxxl_debug.lib
> -DBZIP2_INCLUDE_DIR="d:/libs18d"/include
> -DBZIP2_LIBRARIES="d:/libs18d"/lib/libbz2.lib
> -DCMAKE_INSTALL_PREFIX="d:/libs18d" -DBOOST_ROOT="d:/libs/boost"
> -DBoost_USE_STATIC_LIBS=ON
>
> D:\osrm_utils\Project-OSRM\build>nmake
>
> Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> NMAKE : fatal error U1064: MAKEFILE not found and no target specified
> Stop.
>
> D:\osrm_utils\Project-OSRM\build>cd ..
>
> D:\osrm_utils\Project-OSRM>
>
> Thanks for the interest and if I have left anything out or it does not
> make sense, let me know and I'll try and send it on.
>
>
> The folder contents for compiling:-
>
>  Directory of D:\osrm_utils
>
> 27-Apr-16  15:17    <DIR>          .
> 27-Apr-16  15:17    <DIR>          ..
> 27-Apr-16  13:14    <DIR>          boost_1_55_0
> 26-Apr-16  17:55    <DIR>          boost_1_60_0
> 26-Apr-16  17:54               621 build_base.bat
> 27-Apr-16  14:41               282 build_boost.bat
> 27-Apr-16  13:51               954 build_osrm.bat
> 27-Apr-16  13:39             1,184 build_other.bat
> 27-Apr-16  16:56               541 build_stxxl.bat
> 27-Apr-16  13:08    <DIR>          bzip2-1.0.6
> 26-Apr-16  18:01    <DIR>          bzip2-1.0.6.tar
> 11-Sep-12  04:52            30,706 configure.js
> 26-Apr-16  17:48            17,930 has_member_function_callable_with.hpp
> 27-Apr-16  13:08    <DIR>          libxml2-2.9.0
> 27-Apr-16  14:20    <DIR>          lua
> 27-Apr-16  14:20    <DIR>          luabind
> 27-Apr-16  14:20    <DIR>          OSM-binary
> 26-Apr-16  18:02    <DIR>          osrm-backend-master
> 27-Apr-16  15:09    <DIR>          osrm-bin
> 27-Apr-16  13:52    <DIR>          Project-OSRM
> 27-Apr-16  14:20    <DIR>          protobuf
> 27-Apr-16  13:43    <DIR>          stxxl
> 26-Apr-16  17:48               901 stxxl_win_vs2012.patch
> 27-Apr-16  15:16    <DIR>          tbb
> 27-Apr-16  13:08    <DIR>          zlib-1.2.8
> 26-Apr-16  18:02    <DIR>          zlib-1.2.8.tar
>                8 File(s)         53,119 bytes
>               18 Dir(s)  149,039,063,040 bytes free
>
> D:\osrm_utils>
>
> I had to copy configure.js into that folder so it could be found
> --
>
>
> *John Aherne*
>
>
>
>
> *www.rocs.co.uk <http://www.rocs.co.uk>*
> 020 7223 7567
>
> _______________________________________________
> OSRM-talk mailing list
> OSRM-talk at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osrm-talk/attachments/20160428/a6beb994/attachment-0001.html>


More information about the OSRM-talk mailing list