Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Core
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

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>
Actions #1

Updated by Junxiao Shi over 10 years ago

Which platform is this bug discovered on?

What option enables SSE 4.2 instruction set?

Actions #2

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.

Actions #3

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

Actions #4

Updated by Alex Afanasyev over 10 years ago

  • Assignee set to Haowei Yuan
Actions #5

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.

Actions #6

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?

Actions #7

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.

Actions #8

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.

Actions #9

Updated by Alex Afanasyev over 10 years ago

  • Status changed from New to Code review
  • % Done changed from 0 to 100
Actions #10

Updated by Junxiao Shi over 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF