Commit Graph

4716 Commits

Author SHA1 Message Date
Daniel Patterson
5c1f76e3cf Build shared libraries on a selection of platforms. 2015-11-18 09:54:33 -05:00
Patrick Niklaus
63ba6018f3 Cache the node priorities between runs
This speeds up processings on the same dataset significantly by creating
a .level file that saves the level in which a node was contracted.
It removes the need for expensive recomputation of priorities and such.

Use with care! Running `osrm-extract` again will invalidate .level
files.
2015-11-18 00:56:33 +01:00
Daniel Patterson
8f3482561b Rename great_circle_distance->haversine_distance, and euclidean_distance->great_circle_distance, because that's what they actually are. 2015-11-17 17:10:06 -05:00
Daniel Patterson
13ceeb191c Merge pull request #1766 from Project-OSRM/feature/bearing_selection
Add bearing support to all plugins, add optional range to bearing parameter.
2015-11-17 16:41:34 -05:00
Daniel Patterson
1536d1c044 Add bearing filter support to viaroute, trip, nearest, and distance
table plugins.
Make bearing range configurable by adding a comma-separated second part
to the bearing paramenter, like so:

    b=<bearing:0-359>(,<range:0-180>)

If no range is supplied, it defaults to +/- 10 degrees.
2015-11-17 16:35:20 -05:00
Daniel Patterson
16b6c26d6e Merge pull request #1774 from Project-OSRM/feature/match_summary
Add a route summary to each match result.
2015-11-17 15:32:00 -05:00
Daniel Patterson
c7e30e2266 Add a summary to each match result showing distance and duration.
Helpful for comparing how long the routing engine thinks the matched
trace should take to travel.
2015-11-17 15:28:21 -05:00
Daniel Patterson
d5e4495f89 Merge pull request #1723 from Project-OSRM/i_like_travis
New Travis CI integration - upgrades Linux builds to Ubuntu trusty, simplifies dependency installation because system packages are now available for most things.
2015-11-17 15:26:29 -05:00
Daniel J. Hofmann
963960a44c Switch Travis builds over to trusty for Linux (simpler dependency installs), build
with mutliple compilers, fix debug builds.

OSX builds are disabled until we fix #1778
2015-11-17 15:15:31 -05:00
Daniel Patterson
a62c10321c Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1.
Fixes  #1758
2015-11-03 21:56:26 -08:00
Patrick Niklaus
bb49e03435 Merge pull request #1743 from c0nk/wip-build
Don't generate files in source tree
2015-10-22 16:32:28 -04:00
Kal Conley
38e7b1a262 Remove non-existent git_sha.cpp from .gitignore 2015-10-19 21:33:10 +02:00
Kal Conley
a00d3dfc00 Don't generate util/version.hpp in source tree 2015-10-19 21:33:10 +02:00
Kal Conley
cd458e7a44 Don't generate util/fingerprint_impl.hpp in source tree 2015-10-19 21:33:10 +02:00
Patrick Niklaus
3f82570469 Merge pull request #1740 from c0nk/develop
Fix various bugs
2015-10-19 20:31:23 +02:00
Kal Conley
a8642bd208 Fix segmentation fault when "hsgrdata" unset 2015-10-19 20:13:02 +02:00
Kal Conley
b404c79ca4 Fix json renderer always rendering arrays empty 2015-10-19 20:13:02 +02:00
Kal Conley
29c75337f2 Fix segmentation fault when sizeof(size_t) < sizeof(int64_t) 2015-10-19 20:13:02 +02:00
Patrick Niklaus
fca4aeb50b Merge pull request #1741 from Project-OSRM/oom_messages
Catch `std::bad_alloc` at the top and translate to human readable messages
2015-10-19 19:29:53 +02:00
Daniel J. Hofmann
1dfa2d6e91 Catch bad_alloc and provide human reasable error messages 2015-10-19 18:18:11 +02:00
Daniel J. Hofmann
79650ca3fd Flatten main executable entry points by using functional try blocks 2015-10-19 18:18:11 +02:00
Patrick Niklaus
fd84827e51 Don't use stalling in core search 2015-10-19 17:11:03 +02:00
Daniel J. Hofmann
78283a0e0e Check if memory locking should be done before locking unconditionally 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
993321e971 Lock by default, set fail on error 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
f7a1e2f652 Flatten routed by using functional try-catch blocks 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
e75be68466 Only lock the virtual address space when shared memory was requested
In addition, some improvements:

- unlock only when locking succeeded
- scoped exception safe RAII locker

Reference:

- https://github.com/Project-OSRM/osrm-backend/issues/1698#issuecomment-144003177
2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
74ac283c52 We are on v4.8.1. 2015-10-09 16:53:17 +02:00
Patrick Niklaus
9ef1f8cba3 Fix fore core factors < 0.3 2015-10-08 20:58:21 +02:00
Daniel Patterson
e45656e5bf Refactor edge expansion into extract phase. New temporary file is generated - '.osrm.ebg' which is used by 2015-10-06 09:23:17 -07:00
Patrick Niklaus
cdc4fb45f2 Merge pull request #1720 from jordanmarkov/fix/invalid_nodes_left_in_data
Fixed a bug when extracting data from a file with cut streets (with m…
2015-10-06 11:44:51 +02:00
Daniel J. Hofmann
5379a555db Use ccache by default if available and a suitable compiler is used.
This checks if `ccache` is available, and if so uses it.
The user can stil disable it via the ccache env variable, quoting:

    disable (CCACHE_DISABLE) [boolean]
        When true, ccache will just call the real compiler, bypassing the cache completely. The default is false.

At least Clang required `CCACHE_CPP2`.

The user does not have to set up anything, just to install ccache.
Of course, things like the cache's max size, its location and so on can
be configured.

References:

- https://ccache.samba.org/manual.html
2015-10-06 11:18:43 +02:00
Daniel Patterson
d07c0bde80 Adds support for a new b= parameter on the viaroute and match
plugins, allowing for better nearest neighbor matching when a heading
is known.
2015-10-06 11:15:10 +02:00
Patrick Niklaus
7015ed203a Don't count ferries as public transportation 2015-10-06 11:13:39 +02:00
Johan Uhle
1ead4cbb14 osrm-components: remove unused param
We don't use restrictions anymore
2015-10-06 11:12:56 +02:00
Jordan Markov
84ebca0dd2 Fixed a bug when extracting data from a file with cut streets (with missing nodes). 2015-10-06 09:42:52 +03:00
Daniel Patterson
cf45b2cddb Properly initialize UUID used in Fingerprint class. Fixes #1721 2015-10-03 09:18:10 -07:00
Daniel J. Hofmann
8f8bd05f83 Silence warnings with GCC, LTO does not yet respect the -isystem switch 2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
b1155a202c Re-enable manual -fPIC flag from cae59c7. 2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
d4aaaf16f8 Revert "Re-enable position independent code, but in a portable way."
This reverts commit 2143dc97fa65c786c6566db1343ad270347dcfd3.
2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
119fb63576 LTO is broken on GCC < 4.9.0, disable it.
References:

- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038
- https://github.com/Project-OSRM/node-osrm/pull/112
2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
3f7afd47d2 Do not violate the One Definition Rule (ODR).
By linking in the coordinate object file twice, we violate the ODR,
resulting in our program to not be "well-formed" in language lawyer
speak (hint: bad, very bad).

(How come no one noticed this all the time, this was introduced
somewhere between v4.5.0 and v4.6.0 from a quick look...)

References:

- C++14 standard (N3936.pfd): 3.2 One definition rule [basic.def.odr]
- http://eel.is/c++draft/basic.def.odr
2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
ca0f8ed653 Immensly increase lua/luabind detection and check in buildsystem.
Instead of including the `luabind.hpp` header that transitively includes
basically everything else, we now only include the appropriate header
for luabind's open function.

It is important that this function is declared in the header but the
definition comes from the luabind shared object (library), such that we
can detect linker errors, too.

By only including this header, we also no longer transitively include
the header for the `luaL_newstate` function, with we have to add
manually.

With these changes, detecting, compiling, linking and checking for
lua/luabind with cmake now works instantly, instead of the 3-4
seconds as it was before! Yay, progress!
2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
809bdb7c1f Fixes version generation, no longer derives version on git tags.
We were stuck on the 4.5.0 tag from develop, since we searched for the
latest tag, but release tags are done on the master branch.

This commit rips out all the code for deriving the version on git tags.

Instead, we define major, minor, and patch versions in the CMakeLists
and then pass it on to:

- the `libosrm.pc` `pkg-config` file

- a `version.hpp` header that makes use of the preprocessor's string
  concatenation to provide an easy way for generating version string
  literals such as "v4.8.0".

That is, in the source code please now use the following defines:

    #define OSRM_VERSION_MAJOR "@OSRM_VERSION_MAJOR@"
    #define OSRM_VERSION_MINOR "@OSRM_VERSION_MINOR@"
    #define OSRM_VERSION_PATCH "@OSRM_VERSION_PATCH@"

    #define OSRM_VERSION "v" OSRM_VERSION_MAJOR "." OSRM_VERSION_MINOR "." OSRM_VERSION_PATCH
2015-09-30 18:22:25 +02:00
Daniel J. Hofmann
0424ff0818 Do not pass linker flags for static libraries.
Static libraries get the linker flags from the user / pkg-config.
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
9b952ff48c Improve debug build performance while keeping symbols.
- remove profiling/coverage mix from debug build, as it is useless as of
  now, re-enable this for a separate coverage build in the future

- use gcc's `-ggdb` and `-Og` flag (requires recent gcc) to provide
  better debug information targeted for gdb and optimize what we can

- use `-fno-inline` and `-fno-omit-stack-pointer`, in order to be able
  to jump around in gdb without functions being gone and keeping the
  stack reference
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
c5064710a8 Re-enable position independent code, but in a portable way.
CMake 2.8.9 introduce a `POSITION_INDEPENDENT_CODE` property.

This sets `-fPIE` on executables, giving us back optimizations such as
inlining of global variables and functions, while setting `-fPIC` on
libraries.

Although we do not need position independent code on executables, it
seems like some gcc versions (like 4.9.2) have issues in combinations
with `_FORTIFY_SOURCE`.

On shared libraries, CMake should per documentation even use position
independent code by default.

References:

- http://www.cmake.org/cmake/help/v3.0/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE
- http://public.kitware.com/pipermail/cmake-developers/2012-May/015839.html
- https://github.com/Project-OSRM/osrm-backend/pull/1647
- cae59c7395
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
57e522065a Add linker optimizations and dead code and data elimination.
Linkers also have options we can configure! The most usefull feature is
to give every function its own section. This results in some bloat at
compile time, but at link time now the linker can do dead code and data
elimination by simply discarding appropriate sections.

This works by splitting the `.text` section in a way that makes it
possible to later only pull in sections that are actually referenced.

That is, the basic idea is to keep the matching between sections and
functions intact, so we can optimize based on it in the linking stage.

Note: there's still an issue with how `libOSRM.a` gets build. CMake
currently passes the linker flags on to ar, in order to create a static
library. But ar does not understand the linker's flags.

Referenes:

- https://sourceware.org/binutils/docs/ld/Options.html#Options
- http://elinux.org/images/2/2d/ELC2010-gc-sections_Denys_Vlasenko.pdfMCþ"
- http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_EXE_LINKER_FLAGS.html
- http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_MODULE_LINKER_FLAGS.html
- http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_SHARED_LINKER_FLAGS.html
- http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_STATIC_LINKER_FLAGS.html
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
7143daf500 There is no CMAKE_LINKER_FLAGS variable.
There really isn't; deal with it.

Also, those are not linker flags but instead meant for the compiler.

References:

- http://www.cmake.org/cmake/help/v3.0/manual/cmake-variables.7.html
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
71a00fc01b Make lto detection more robust and not resetting cxx flags when lto fails.
This refines the last commit of parallelizing lto.

Discussion: this is ugly as hell, dispatching 1/ on the availability of
the `-flto` flag, then 2/ on the compiler since GCC allows `-flto=n`
whereas Clang for example does not.

I tried setting the CMake property `INTERPROCEDURAL_OPTIMIZATION`,
without any effect. All I could see was some lto related utilities in
the cmake debug output, but not in the actual compiler or linker
invocation.

This would eliminate the need for our hacks, with 1/ using an option
`WITH_LTO` setting `ON` by default, and based on this value setting the
`INTERPROCEDURAL_OPTIMIZATION` flag with CMake doing the actual work of
selecting the best LTO method on the target platform.

By the way, this also fixes a bug where we reset the `CMAKE_CXX_FLAGS`
to a variable that was never defined, resulting in setting the flags to
an empty string. Yay CMake, as usual.

References:

- http://www.cmake.org/cmake/help/v3.0/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
941483c14d Parallelize optimization and code generation for link time optimization.
This parallelizes the `-flto` feature resulting in parallel optimization
and code generation for link time optimization based on the number of
logical processors available.

Note: this has the side-effect of using more memory during linking.

References:

- https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html (see: -flto)
- http://www.cmake.org/cmake/help/v3.0/module/ProcessorCount.htmMC
2015-09-30 18:20:00 +02:00