Bug #1721
closed
core/city-hash.cpp fails to build when SSE4.2 instruction set is enabled
Added by Davide Pesavento over 10 years ago.
Updated over 10 years ago.
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>
Which platform is this bug discovered on?
What option enables SSE 4.2 instruction set?
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.
- Assignee set to Haowei Yuan
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.
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?
Since the code is not used, I would go with either removal or commenting out of the irrelevant section.
Alex Afanasyev wrote:
Would it be sufficient to just remove that section in city-hash.cpp
file?
Yes.
- Status changed from New to Code review
- % Done changed from 0 to 100
- Status changed from Code review to Closed
Also available in: Atom
PDF