Osrm-backend: CMake complains about GCC version but newer is installed

Created on 21 Jun 2018  路  5Comments  路  Source: Project-OSRM/osrm-backend

When running cmake, I'm getting

-- Enabling mason
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at cmake/JSONParser.cmake:287 (string):
  string end index: 1 is out of range -1 - 0
Call Stack (most recent call first):
  cmake/JSONParser.cmake:232 (_sbeMoveToNextNonEmptyCharacter)
  cmake/JSONParser.cmake:71 (_sbeParseObject)
  cmake/JSONParser.cmake:22 (_sbeParse)
  CMakeLists.txt:64 (sbeParseJson)


-- Building on a 64 bit system
CMake Error at CMakeLists.txt:120 (message):
  GCC>=5.0 required.  In case you are on Ubuntu upgrade via
  ppa:ubuntu-toolchain-r/test


-- Configuring incomplete, errors occurred!
See also "/scistor/guest/ehs215/osrm-backend/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.

but gcc --version reports gcc (GCC) 6.3.0

gcc 4.8.5 is also installed on this system, but the first gcc in my path is 6.3.0.

Most helpful comment

That doesn't work either (I don't have those names in my path), but this got me past the current problem:

export CC=`which gcc`
export CXX=`which g++`

All 5 comments

@retorquere can you print what g++ --version shows? Might be the path for the C++ compiler is not setup correctly.

$ g++ --version
g++ (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ /usr/bin/g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

might be it ignores the path for some reason. rm CMakeCache.txt && CXX=g++-6 CC=gcc-6 cmake .. should work.

That doesn't work either (I don't have those names in my path), but this got me past the current problem:

export CC=`which gcc`
export CXX=`which g++`

CXX=g++-6 CC=gcc-6 cmake worked for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RajibChanda picture RajibChanda  路  4Comments

freenerd picture freenerd  路  4Comments

ardanika picture ardanika  路  3Comments

davidbarre picture davidbarre  路  4Comments

Oyabi picture Oyabi  路  5Comments