Bug #1721
closedcore/city-hash.cpp fails to build when SSE4.2 instruction set is enabled
100%
Description
[ 63/102] cxx: core/city-hash.cpp -> build/core/city-hash.cpp.2.o
21:09:42 runner ['x86_64-pc-linux-gnu-g++', '-march=native', '-O2', '-pipe', '-fPIC', '-include', '/tmp/portage/net-misc/nfd-9999/work/nfd-9999/build/core-objects.2', '-I/tmp/portage/net-misc/nfd-9999/work/nfd-9999/build', '-I/tmp/portage/net-misc/nfd-9999/work/nfd-9999', '-I/tmp/portage/net-misc/nfd-9999/work/nfd-9999/build/core', '-I/tmp/portage/net-misc/nfd-9999/work/nfd-9999/core', '-I/usr/include', '../core/city-hash.cpp', '-c', '-o', '/tmp/portage/net-misc/nfd-9999/work/nfd-9999/build/core/city-hash.cpp.2.o']
../core/city-hash.cpp:509:21: fatal error: citycrc.h: No such file or directory
#include <citycrc.h>
^
compilation terminated.
From core/city-hash.cpp:
#ifdef __SSE4_2__
#include <citycrc.h>
#include <nmmintrin.h>
Updated by Junxiao Shi over 10 years ago
Which platform is this bug discovered on?
What option enables SSE 4.2 instruction set?
Updated by Davide Pesavento over 10 years ago
Junxiao Shi wrote:
Which platform is this bug discovered on?
Platform should be irrelevant, in any case it's Linux with gcc-4.8.3
What option enables SSE 4.2 instruction set?
-march=native
in my case, because I'm building on a CPU that supports SSE 4.2. Alternatively you can use -msse4.2
to forcefully enable it.
Updated by Davide Pesavento over 10 years ago
I guess someone simply forgot to commit this header to git when city hash was added https://code.google.com/p/cityhash/source/browse/trunk/src/citycrc.h
Updated by Alex Afanasyev over 10 years ago
Would it be sufficient to just remove that section in city-hash.cpp
file? It seem that this provides additional functions (CityHashCrc*
) when SSE 4.2 is enabled.
Updated by Haowei Yuan over 10 years ago
Yes, commenting out that section should be sufficient, and this would not affect NFD since we are not using CityHashCrc128 or CityHashCrc256 declared in citycrc.h.
Alternatively, we could add the citycrc.h file to the repository. The only thing is we need to change #include <city.h>
in line 31 to #include <city-hash.h>
.
I think we can probably go with the first approach, and comments can be added to the code to include a pointer to the citycrc.h file.. What do you guys think?
Updated by Alex Afanasyev over 10 years ago
Since the code is not used, I would go with either removal or commenting out of the irrelevant section.
Updated by Davide Pesavento over 10 years ago
Alex Afanasyev wrote:
Would it be sufficient to just remove that section in
city-hash.cpp
file?
Yes.
Updated by Alex Afanasyev over 10 years ago
- Status changed from New to Code review
- % Done changed from 0 to 100
Updated by Junxiao Shi over 10 years ago
- Status changed from Code review to Closed