diff --git a/CMakeLists.txt b/CMakeLists.txt index f5184d398..0fbe015b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,8 +175,10 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") # using Visual Studio C++ set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib) + add_definitions(-DBOOST_LIB_DIAGNOSTIC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-DNOMINMAX) # avoid min and max macros that can break compilation + add_definitions(-D_USE_MATH_DEFINES) #needed for M_PI with cmath.h add_definitions(-D_WIN32_WINNT=0x0501) add_definitions(-DXML_STATIC) find_library(ws2_32_LIBRARY_PATH ws2_32) @@ -234,7 +236,10 @@ include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS}) find_package(Boost 1.49.0 COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_SPIRIT_USE_PHOENIX_V3 -DBOOST_RESULT_OF_USE_DECLTYPE) +if(NOT WIN32) + add_definitions(-DBOOST_TEST_DYN_LINK) +endif() +add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3 -DBOOST_RESULT_OF_USE_DECLTYPE) include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) find_package(Threads REQUIRED) diff --git a/appveyor-build.bat b/appveyor-build.bat index f055c171e..568998b5f 100644 --- a/appveyor-build.bat +++ b/appveyor-build.bat @@ -8,16 +8,39 @@ SET PROJECT_DIR=%CD% ECHO PROJECT_DIR^: %PROJECT_DIR% ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS% ECHO cmake^: && cmake --version +IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found GOTO ERROR + +FOR /F %%G IN ("--version") DO cmake %%G 2>&1 | findstr /C:"3.5.0" > nul && goto CMAKE_NOT_OK +GOTO CMAKE_OK + +:CMAKE_NOT_OK +ECHO CMAKE NOT OK - downloading new CMake +IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.5/cmake-3.5.1-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +IF NOT EXIST cmake-3.5.1-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive" +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +SET PATH=%PROJECT_DIR%\cmake-3.5.1-win32-x86\bin;%PATH% + +:CMAKE_OK +ECHO CMAKE_OK +cmake --version ECHO activating VS command prompt ... SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 ECHO platform^: %platform% + +ECHO cl.exe version +cl +ECHO msbuild version +msbuild /version + :: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive SET DEPSPKG=osrm-deps-win-x64-14.0.7z :: local development +ECHO. ECHO LOCAL_DEV^: %LOCAL_DEV% IF NOT DEFINED LOCAL_DEV SET LOCAL_DEV=0 IF DEFINED LOCAL_DEV IF %LOCAL_DEV% EQU 1 IF EXIST %DEPSPKG% ECHO skipping deps download && GOTO SKIPDL @@ -33,27 +56,39 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR IF EXIST osrm-deps ECHO deleting osrm-deps... && RD /S /Q osrm-deps IF %ERRORLEVEL% NEQ 0 GOTO ERROR -IF EXIST build ECHO deletings build dir... && RD /S /Q build +IF EXIST build ECHO deleting build dir... && RD /S /Q build IF %ERRORLEVEL% NEQ 0 GOTO ERROR 7z -y x %DEPSPKG% | %windir%\system32\FIND "ing archive" IF %ERRORLEVEL% NEQ 0 GOTO ERROR +::tree osrm-deps + MKDIR build IF %ERRORLEVEL% NEQ 0 GOTO ERROR cd build IF %ERRORLEVEL% NEQ 0 GOTO ERROR -SET OSRMDEPSDIR=%PROJECT_DIR%\osrm-deps +SET OSRMDEPSDIR=%PROJECT_DIR%/osrm-deps set PREFIX=%OSRMDEPSDIR%/libs set BOOST_ROOT=%OSRMDEPSDIR%/boost +set BOOST_LIBRARYDIR=%BOOST_ROOT%/lib set TBB_INSTALL_DIR=%OSRMDEPSDIR%/tbb set TBB_ARCH_PLATFORM=intel64/vc14 +ECHO OSRMDEPSDIR ^: %OSRMDEPSDIR% +ECHO PREFIX ^: %PREFIX% +ECHO BOOST_ROOT ^: %BOOST_ROOT% +ECHO BOOST_LIBRARYDIR ^: %BOOST_LIBRARYDIR% +ECHO TBB_INSTALL_DIR ^: %TBB_INSTALL_DIR% +ECHO TBB_ARCH_PLATFORM ^: %TBB_ARCH_PLATFORM% + + ECHO calling cmake .... cmake .. ^ -G "Visual Studio 14 2015 Win64" ^ -DBOOST_ROOT=%BOOST_ROOT% ^ +-DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ^ -DBoost_ADDITIONAL_VERSIONS=1.58 ^ -DBoost_USE_MULTITHREADED=ON ^ -DBoost_USE_STATIC_LIBS=ON ^ diff --git a/appveyor.yml b/appveyor.yml index f1c98286a..98dab12ca 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,6 +20,10 @@ build_script: test: off artifacts: + - path: build\build_errors.txt + name: build_errors.txt + - path: build\build_warnings.txt + name: build_warnings.txt - path: osrm_Release.zip name: osrm_Release.zip # - path: osrm_Debug.zip @@ -41,9 +45,3 @@ deploy: folder: / enable_ssl: true active_mode: false - -# notifications: -# - provider: HipChat -# auth_token: -# secure: boLE7BjcahdIUxv9jkN7U3F8iOASF+MkhtctlVoWJoo= -# room: Directions diff --git a/build-local.bat b/build-local.bat index b26c41522..a90c0aa74 100644 --- a/build-local.bat +++ b/build-local.bat @@ -11,7 +11,8 @@ SET CONFIGURATION=Release FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH% -SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.4.0-win32-x86\bin;%PATH% +::SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.5.0-win32-x86\bin;%PATH% +SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.5.1-win32-x86\bin;%PATH% SET PATH=C:\Program Files\7-Zip;%PATH% powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force diff --git a/include/extractor/raster_source.hpp b/include/extractor/raster_source.hpp index 499e9a262..c5d276f87 100644 --- a/include/extractor/raster_source.hpp +++ b/include/extractor/raster_source.hpp @@ -42,7 +42,7 @@ class RasterGrid ydim = _ydim; _data.reserve(ydim * xdim); - boost::filesystem::ifstream stream(filepath); + boost::filesystem::ifstream stream(filepath, std::ios::binary); if (!stream) { throw util::exception("Unable to open raster file."); diff --git a/include/util/trigonometry_table.hpp b/include/util/trigonometry_table.hpp index e66a52509..fe1d316ba 100644 --- a/include/util/trigonometry_table.hpp +++ b/include/util/trigonometry_table.hpp @@ -358,7 +358,12 @@ constexpr unsigned short atan_table[4096] = { 0xffe0, 0xffea, 0xfff4, 0xffff}; // max value is pi/4 +#ifdef _MSC_VER //TODO: remove as soon as boost allows C++14 features with Visual Studio +const constexpr double SCALING_FACTOR = 4. / M_PI * 0xFFFF; +#else const constexpr double SCALING_FACTOR = 4. / boost::math::constants::pi() * 0xFFFF; +#endif + inline double atan2_lookup(double y, double x) { diff --git a/src/extractor/edge_based_graph_factory.cpp b/src/extractor/edge_based_graph_factory.cpp index 911999347..77ea0757f 100644 --- a/src/extractor/edge_based_graph_factory.cpp +++ b/src/extractor/edge_based_graph_factory.cpp @@ -138,7 +138,7 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(const NodeID node_u, const NodeI NodeID current_edge_source_coordinate_id = node_u; // traverse arrays from start and end respectively - for (const auto i : util::irange(0UL, geometry_size)) + for (const auto i : util::irange(std::size_t{ 0 }, geometry_size)) { BOOST_ASSERT(current_edge_source_coordinate_id == m_compressed_edge_container.GetBucketReference(