1

I'm trying to compile OSRM in a Xubuntu 12.04 virtual machine following these instructions. I had some problems installing boost (a requisite) and I compiled it manually.

The error is this:

/home/user/src/Project-OSRM/datastore.cpp: In function 'int main(int, const char**)':
/home/user/src/Project-OSRM/datastore.cpp:163:86: error: no matching function for call to 'min(long unsigned int, std::basic_string<char>::size_type)'
/home/user/src/Project-OSRM/datastore.cpp:163:86: note: candidates are:
/usr/include/c++/4.6/bits/stl_algobase.h:187:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
/usr/include/c++/4.6/bits/stl_algobase.h:233:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
make[2]: *** [CMakeFiles/osrm-datastore.dir/datastore.cpp.o] Error 1
make[1]: *** [CMakeFiles/osrm-datastore.dir/all] Error 2

I've tried to define these variables in compile time

CFLAGS=/usr/local/include
LDFLAGS=/usr/local/lib

The directories where boost headers and libs can be found. Just in case. Still getting the same error.

Any suggestions? I've used boost 1.49 (I know there's a problem with it, but I'm still not there). And maybe the problem isn't boost, but something else.

Many thanks in advance

  • I doubt the problem is boost. Maybe you just need to add a cast for the second argument to min (in Project-OSRM/datastore.cpp line 163) to long unsigned int. – BradHards Nov 27 '13 at 8:32
  • That change caused a lot of "undefined reference to boost..." errors. I guess boost is not properly found (strange, because I ran a simple C++ code to show boost version and worked). Anyway, changing the sources in order to compile sounds odd for me. Thanks anyway. – Jorge Arévalo Nov 27 '13 at 8:49
  • DO you perhaps have an older version of boost installed in parallel? Did you pass any arguments to CMake? – BradHards Nov 27 '13 at 9:17
  • I've installed boost 1.49 and later boost 1.55, but looks that boost 1.49 is first detected. And I didn't pass any argument to CMake – Jorge Arévalo Nov 27 '13 at 11:05
  • Does it help if you pass something like -DBOOST_ROOT=/path/to/boost-1.55/lib/ (for your real boost-1.55 library path, of course) to CMake? – BradHards Nov 27 '13 at 19:51
1

Switch to a 64 bit kernel installation of Linux and your problems should be fixed.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 1
    Maybe you can elaborate a bit more how exactly the OPs problem is related with the kernel architecture? – Curlew Dec 16 '13 at 21:43
  • 1
    std::min needs both parameters to be of the same type, ie. size in bits. On 32 bit systems, the parameters of the min operation are not the same. This is essentially what the compiler is complaining about. Also, OSRM is unsupported on 32 bit kernels. – DennisL Dec 17 '13 at 9:16
  • It makes sense. I finally used a Mac OS X machine with a 64bits kernel, and it worked. So, you're probably right. – Jorge Arévalo Dec 17 '13 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.