Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__get_cpuid was not declared in this scope #1193

Closed
emiltin opened this issue Sep 19, 2014 · 25 comments
Closed

__get_cpuid was not declared in this scope #1193

emiltin opened this issue Sep 19, 2014 · 25 comments

Comments

@emiltin
Copy link
Contributor

emiltin commented Sep 19, 2014

On my virtual machine, compilation fails with this error:

...
[ 78%] Building CXX object CMakeFiles/osrm-prepare.dir/Contractor/Prepare.cpp.o
In file included from /home/osm/osrm-backend/Contractor/Prepare.cpp:32:0:
/home/osm/osrm-backend/Contractor/../Algorithms/IteratorBasedCRC32.h: In member function ‘unsigned int IteratorbasedCRC32::cpuid() const’:
/home/osm/osrm-backend/Contractor/../Algorithms/IteratorBasedCRC32.h:115:46: error: ‘__get_cpuid’ was not declared in this scope
         __get_cpuid(1, &eax, &ebx, &ecx, &edx);
                                              ^
make[2]: *** [CMakeFiles/osrm-prepare.dir/Contractor/Prepare.cpp.o] Error 1
make[1]: *** [CMakeFiles/osrm-prepare.dir/all] Error 2
make: *** [all] Error 2

What's missing here?

@emiltin
Copy link
Contributor Author

emiltin commented Sep 19, 2014

It's a Ubuntu server 14.04.

@TheMarex
Copy link
Member

Are you using gcc or clang?

@DennisOSRM
Copy link
Collaborator

What Kind of virtual machine are you using. I suspect something is funny with the advertised cpu features

@emiltin
Copy link
Contributor Author

emiltin commented Sep 19, 2014

the host is virtual box running on ubuntu 14.04. the VM is ubuntu server (only command line) 14.04.
i'm compiling with gcc.

@DennisOSRM
Copy link
Collaborator

Hmm.. Strange.

@emiltin
Copy link
Contributor Author

emiltin commented Sep 22, 2014

Here what the VM report about cpu architecture:

$ lscpu
Architecture:          i686
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 58
Stepping:              9
CPU MHz:               3281.484
BogoMIPS:              6562.96
L1d cache:             32K
L1d cache:             32K
L2d cache:             6144K

$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 58
model name  : Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
stepping    : 9
microcode   : 0x19
cpu MHz     : 3281.484
cache size  : 6144 KB
physical id : 0
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fdiv_bug    : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc pni monitor ssse3 lahf_lm
bogomips    : 6562.96
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

@DennisOSRM
Copy link
Collaborator

what does uname -a say?

@emiltin
Copy link
Contributor Author

emiltin commented Sep 22, 2014

osm@mango:~/osrm-backend$ uname -a
Linux mango 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux

@DennisOSRM
Copy link
Collaborator

installing a 64bit version of the distribution should fix things.

@DennisOSRM
Copy link
Collaborator

@emiltin any updates here?

@emiltin
Copy link
Contributor Author

emiltin commented Oct 6, 2014

sorry got sidetracked. i will report back once i get time to retry

@DennisOSRM
Copy link
Collaborator

any update here?

@emiltin
Copy link
Contributor Author

emiltin commented Oct 27, 2014

Compiles on a 64 bit ubuntu server virtual machine. It would be helpful if a warning could be issued when you try to build on 32 bit systems.

@emiltin emiltin closed this as completed Oct 27, 2014
@DennisOSRM
Copy link
Collaborator

The CMake script should actually complain.

@hmaeda
Copy link

hmaeda commented Apr 2, 2015

I get a simialr issue... below is the error message

`[ 84%] Building CXX object CMakeFiles/osrm-prepare.dir/contractor/processing_cha in.cpp.o
In file included from /data/osrm/osrm-backend/contractor/processing_chain.cpp:32 :0:

/data/osrm/osrm-backend/contractor/../algorithms/crc32_processor.hpp: In member function ‘unsigned int IteratorbasedCRC32::cpuid() const’:

/data/osrm/osrm-backend/contractor/../algorithms/crc32_processor.hpp:115:46: err or: ‘__get_cpuid’ was not declared in this scope
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
^
CMakeFiles/osrm-prepare.dir/build.make:100: recipe for target 'CMakeFiles/osrm-p repare.dir/contractor/processing_chain.cpp.o' failed
make[2]: *** [CMakeFiles/osrm-prepare.dir/contractor/processing_chain.cpp.o] Err or 1

CMakeFiles/Makefile2:678: recipe for target 'CMakeFiles/osrm-prepare.dir/all' fa iled

make[1]: *** [CMakeFiles/osrm-prepare.dir/all] Error 2
Makefile:113: recipe for target 'all' failed

make: *** [all] Error 2

root@xxxxxxxxx:/data/osrm/osrm-backend/build# uname -a
Linux xxxxxxxxxxxx 3.16.0-23-generic #31-Ubuntu SMP Tue Oct 21 17:55:08 UTC 2014 p pc64le ppc64le ppc64le GNU/Linux`

Note I am on a powerpc64 architecture...any ideas what causes this issue?

@DennisOSRM
Copy link
Collaborator

It's a compiler intrinsic for x64 CPUs.

I will look into predefined variables on powerpc64 that will fix a couple of #ifdefs

@hmaeda
Copy link

hmaeda commented Apr 7, 2015

To add a bit of extra info...

I was following carried out the following commands

root@xxxxxxxx:/data/osrm/osrm-backend/build# cmake ..
-- Building on a 64 bit system
-- Configuring OSRM in release mode
-- LTO working
-- Using gcc specific binutils for LTO.
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   date_time
--   filesystem
--   iostreams
--   program_options
--   regex
--   system
--   thread
--   unit_test_framework
-- Found Intel TBB
-- Looking for Luabind...
-- Found Luabind: /usr/lib/libluabind.so
-- Looking for LuaJIT 5.2
-- Could NOT find LUAJIT (missing:  LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
-- Performing Test LUABIND_WORKS
-- Performing Test LUABIND_WORKS - Success
-- Luabind/Lua5.2 combination working with /usr/lib/powerpc64le-linux-gnu/liblua5.2.so
-- Looking for STXXL...
-- Found STXXL: /usr/lib/libstxxl.so
-- OpenMP support found. Linking just in case for stxxl
-- Looking for OSMPBF...
-- Found OSMPBF: /usr/lib/libosmpbf.a
-- Configuring done
-- Generating done
-- Build files have been written to: /data/osrm/osrm-backend/build
root@xxxxxxx:/data/osrm/osrm-backend/build# sudo make install
[  2%] Built target ANGLE
[  7%] Built target COORDINATE
[ 10%] Built target EXCEPTION
[ 12%] Configuring revision fingerprint
[ 12%] Built target FingerPrintConfigure
Scanning dependencies of target FINGERPRINT
[ 15%] Building CXX object CMakeFiles/FINGERPRINT.dir/util/fingerprint.cpp.o
[ 15%] Built target FINGERPRINT
[ 17%] Built target GITDESCRIPTION
[ 23%] Built target IMPORT
[ 25%] Built target LOGGER
[ 28%] Built target MERCATOR
[ 30%] Built target PHANTOMNODE
Linking CXX static library libOSRM.a
[ 53%] Built target OSRM
[ 56%] Built target RESTRICTION
Linking CXX executable osrm-datastore
[ 58%] Built target osrm-datastore
Linking CXX executable osrm-extract
[ 76%] Built target osrm-extract
[ 79%] Building CXX object CMakeFiles/osrm-prepare.dir/contractor/processing_chain.cpp.o
In file included from /data/osrm/osrm-backend/contractor/processing_chain.cpp:32:0:
/data/osrm/osrm-backend/contractor/../algorithms/crc32_processor.hpp: In member function ‘unsigned int IteratorbasedCRC32::cpuid() const’:
/data/osrm/osrm-backend/contractor/../algorithms/crc32_processor.hpp:115:46: error: ‘__get_cpuid’ was not declared in this scope
         __get_cpuid(1, &eax, &ebx, &ecx, &edx);
                                              ^
CMakeFiles/osrm-prepare.dir/build.make:100: recipe for target 'CMakeFiles/osrm-prepare.dir/contractor/processing_chain.cpp.o' failed
make[2]: *** [CMakeFiles/osrm-prepare.dir/contractor/processing_chain.cpp.o] Error 1
CMakeFiles/Makefile2:678: recipe for target 'CMakeFiles/osrm-prepare.dir/all' failed
make[1]: *** [CMakeFiles/osrm-prepare.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

@DennisOSRM
Copy link
Collaborator

What cpu and operating system are you using?

@hmaeda
Copy link

hmaeda commented Apr 7, 2015

root@xxxxxx:~/project# uname -a
Linux xxxxxx 3.16.0-23-generic #31-Ubuntu SMP Tue Oct 21 17:55:08 UTC 2014 ppc64le ppc64le ppc64le GNU/Linux

@hmaeda
Copy link

hmaeda commented Apr 7, 2015

Is there a way that OSRM can run without LuaJIT?

@DennisOSRM
Copy link
Collaborator

Yes. Luajit is optional

@hmaeda
Copy link

hmaeda commented Apr 7, 2015

Is the lack of LuaJIT when running the sudo make install command causing an issue?

@DennisOSRM
Copy link
Collaborator

No, this is unrelated. As explained above, it's a platform issue where it does not properly detect that it is not running on X64 hardware. We should have a fix shortly.

@DennisOSRM
Copy link
Collaborator

Try the latest code from develop branch. It's been a bit of an instrument flight, but it should compile now.

@hmaeda
Copy link

hmaeda commented Apr 7, 2015

Amazing that worked thank you!

On Tue, Apr 7, 2015 at 1:47 PM, Dennis Luxen notifications@github.com
wrote:

Try the latest code from develop branch. It's been a bit of an instrument
flight, but it should compile now.


Reply to this email directly or view it on GitHub
#1193 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants