Comments (8)
/opt/homebrew/Cellar/osrm-backend-5.27.1/src/util/coordinate_calculation.cpp:332:5
smth is wrong with your build (assuming you're not really building from /opt/homebrew). I'd remove the brew version and try again
from osrm-backend.
I greatly appreciate a quick response. I had 2 versions of OSRM - one that was pulled using %brew install osrm-backend and the other that was pulled using %wget https://github.com/Project-OSRM/osrm-backend/archive/v5.27.1.tar.gz
The brew version was installed in 5.27.1_4 directory.
I removed it by giving the command %rm -R *
zsh: sure you want to delete all 10 files in /opt/homebrew/Cellar/osrm-backend/5.27.1_4 [yn]? y
Is that what you meant by "I'd remove the brew version and try again".
When I run % cmake .. -DCMAKE_BUILD_TYPE=Release on the source code I had pulled using wget, I get lot of warnings:
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at CMakeLists.txt:55 (cmake_policy):
The OLD behavior for policy CMP0048 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at cmake/JSONParser.cmake:4 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
CMakeLists.txt:74 (include)
-- Building on a 64 bit system
CMake Warning at CMakeLists.txt:209 (message):
GNU gold linker isn't available.
-- Configuring OSRM in release mode
-- Configuring release mode optimizations
-- Performing Test SUPPORTS_CXXFLAG_strict_overflow=2
-- Performing Test SUPPORTS_CXXFLAG_strict_overflow=2 - Success
-- Performing Test SUPPORTS_CFLAG_strict_overflow=2
-- Performing Test SUPPORTS_CFLAG_strict_overflow=2 - Success
-- Flag -Wduplicated-cond is unsupported
-- Flag -Wduplicated-cond is unsupported
-- Flag -Wbool-compare is unsupported
-- Flag -Wbool-compare is unsupported
-- Flag -Wlogical-op is unsupported
-- Flag -Wlogical-op is unsupported
-- Flag -Wmaybe-uninitialized is unsupported
-- Flag -Wmaybe-uninitialized is unsupported
-- Flag -Wno-return-local-addr is unsupported
-- Flag -Wno-return-local-addr is unsupported
-- Flag -Wtrampolines is unsupported
-- Flag -Wtrampolines is unsupported
-- Using unknown linker, not setting linker optimizations
CMake Warning (dev) at CMakeLists.txt:412 (exec_program):
Policy CMP0153 is not set: The exec_program command should not be called.
Run "cmake --help-policy CMP0153" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Use execute_process() instead.
This warning is for project developers. Use -Wno-dev to suppress it.
-- linking against libc++
CMake Deprecation Warning at third_party/flatbuffers/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to find_package_handle_standard_args
(PkgConfig)
does not match the name of the calling package (Lua). This can lead to
problems in calling code that expects find_package
result variables
(e.g., _FOUND
) to follow a certain pattern.
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
cmake/FindLua.cmake:39 (include)
CMakeLists.txt:572 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Using Lua 5.4.6
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using ccache to speed up incremental builds
-- Configuring done (1.4s)
-- Generating done (0.2s)
-- Build files have been written to: /opt/homebrew/Cellar/osrm-backend-5.27.1/build
After this I run the same command %cmake --build . and get the same 2errors as I had previously reported
Any help would be greatly appreciated.
from osrm-backend.
I even downloaded v5.27.0 in /Users/project/code directory. Same 2 errors as before:
error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result]
std::find_if(std::begin(lhs), std::end(lhs), compute_minimum_distance_in_rhs);
: error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result]
std::adjacent_find(begin, end, compute_minimum_distance);
^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from osrm-backend.
Any suggestions anyone?
from osrm-backend.
These errors are not actually errors, but warnings treated as errors. We treat all warnings as errors:
osrm-backend/cmake/warnings.cmake
Line 52 in 31e31a6
and basically in newer version of compiler new warnings were added… Ideally we should have an option to disable it, but I think as a workaround you can:
- comment this line above
- pass flags to disable warnings (can be done via CXXFLAGS env variable)
from osrm-backend.
Thanks for the feedback. I was able to fix these issues by following steps listed below (anyone looking to see how, please check at the bottom). Now I am running in a new issue. I have a .c file that has the main() function. In that file I make a call to callLibOSRM() that is essentially example.cpp file that I have created in callLibOSRM.cpp. In this file here are my definitions:
extern "C" int callLibOSRM(void);
int callLibOSRM(void){
example.cpp
}
I get this error while building :
ld: Undefined symbols:
osrm::OSRM::OSRM(osrm::engine::EngineConfig&), referenced from:
_callLibOSRM in CallLibOSRM.o
osrm::OSRM::~OSRM(), referenced from:
_callLibOSRM in CallLibOSRM.o
_callLibOSRM in CallLibOSRM.o
osrm::OSRM::Route(osrm::engine::api::RouteParameters const&, mapbox::util::variant<osrm::util::json::Object, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, flatbuffers::FlatBufferBuilder>&) const, referenced from:
_callLibOSRM in CallLibOSRM.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can you please let me know how to fix this? This was my original issue which led me to trying to build the libOSRM using build.
Now, going back to my previous issue, here is how I have solved it. I faced 2 type of errors:
- error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result]
std::adjacent_find(path.begin(), path.end(), augment_one);
^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
To fix that all I did was added static_cast(error_statement) so it looks some thing like this in the example above:
static_cast(std::adjacent_find(path.begin(), path.end(), augment_one));
- error: variable 'current_level' set but not used [-Werror,-Wunused-but-set-variable]
unsigned current_level = 0;
To fix that all I did was added a line like this after the unused variable:
(void)current_level;
from osrm-backend.
Can someone help me please?
from osrm-backend.
After lot of research I was able to fix my problems, This thread can be closed.
In the "Build Phases" tab of the Xcode target settings, expand the "Link Binary with Libraries" section.
Click the "+" button and select the library you want to link against from the list. I added following libraries here:
libosrm.a, libboost_iostream.a, libboost_filesystem.a, libboost_thread-mt.a (please note that the libboost files were at /opt/homebrew/Cellar/boost/1.84.0/lib/ . I was unable to add the file from the XCode, so i just copied them to my libosrm/build folder and copied from there)
After that, in XCode Project navigator on the left, drag these 4 files from under Frameworks and copy under the files which call libOSRM. And Voila - it ran!
from osrm-backend.
Related Issues (20)
- Questions related to car profile
- Kubernetes - Helmchart HOT 9
- Unable to Generate cell_metrics File in OSRM HOT 1
- Fix clang-tidy warnings HOT 1
- Windows CI job goes out of memory when building tests
- osrm-extract command with run-time error on Windows OS HOT 2
- Fragmented route generation on osrm-routed
- NodeJS binding start error on Windows HOT 3
- when building from source on mac m1,Undefined symbols for architecture arm64 HOT 3
- Parameter for Polygon-Based Area Avoidance in OSRM table Method HOT 1
- Can't build shared libraries on macOS
- Docker with alpine (once again) HOT 2
- Audible fences should not be barriers HOT 1
- Building osrm-backend on Ubuntu 24.04 "Noble Numbat" from source fails HOT 7
- maxspeed on road can lead to OSRM exceeding configured vehicle maxspeeds HOT 1
- Wrong results with nearest service HOT 2
- GPX files #question HOT 6
- How to create OSRM traffic update file(csv) with gps trace data ?
- Add support for maxaxleload
- cmake fails on osrm-backend/third_party/sol2/include/sol/sol.hpp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osrm-backend.