Skip to content

Compiler error - "inconsistent operand constraints in an 'asm'" #932

@DanielTripp

Description

@DanielTripp

Hello. I am having trouble compiling OSRM. I wonder if anyone out there can shed some light on this problem.

Here is the error message from 'make':

[ 82%] Building CXX object CMakeFiles/osrm-prepare.dir/prepare.cpp.o
In file included from /home/dt/osrm/Project-OSRM/prepare.cpp:28:0:
/home/dt/osrm/Project-OSRM/Algorithms/IteratorBasedCRC32.h: In member function 'unsigned int (IteratorbasedCRC32<ContainerT>::* IteratorbasedCRC32<ContainerT>::detectBestCRC32C())(char*, unsigned int, unsigned int) [with ContainerT = std::vector<EdgeBasedNode>, IteratorbasedCRC32<ContainerT>::CRC32CFunctionPtr = unsigned int (IteratorbasedCRC32<std::vector<EdgeBasedNode> >::*)(char*, unsigned int, unsigned int), IteratorbasedCRC32<ContainerT> = IteratorbasedCRC32<std::vector<EdgeBasedNode> >]':
/home/dt/osrm/Project-OSRM/Algorithms/IteratorBasedCRC32.h:82:92: error: inconsistent operand constraints in an 'asm'
make[2]: *** [CMakeFiles/osrm-prepare.dir/prepare.cpp.o] Error 1
make[1]: *** [CMakeFiles/osrm-prepare.dir/all] Error 2
make: *** [all] Error 2

The line of code in question (at IteratorBasedCRC32.h, line 82) is this:

asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (functionInput));

Here is some more information about my system:

----- u:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:        12.04
Codename:       precise
----- u:~ $ uname -a
Linux unofficialttctrafficreport.ca 2.6.32-042stab079.6 #1 SMP Mon Aug 26 19:47:50 MSK 2013 i686 i686 i386 GNU/Linux
----- u:~ $ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 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.

This is an Ubuntu virtual machine of some kind, in a shared hosting environment. I think that it is called a Virtual Private Server and/or Virtuozzo Container, if that matters.

OSRM is a very exciting piece of software and I can't wait to use it, but I am not a C expert, so if anyone can help me out with this, I sure would appreciate it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions