rmsalinas / fbow

FBOW (Fast Bag of Words) is an extremmely optimized version of the DBow2/DBow3 libraries.
559 stars 141 forks source link

Compiling on ARM64 architecture #37

Closed mmitjansc closed 3 years ago

mmitjansc commented 3 years ago

Hello @rmsalinas and @shinsumicco,

It seems this project hasn't had any update in many years, but I hope you can help me with this small issue.

For what I've seen, the CMakeLists.txt file contemplates compiling with several architectures (ARM included), but then cpu.h and fbow.h/cpp don't offer any alternative to compile under ARM64. Is there any easy way to enable this?

Thanks!

MikiyaShibuya commented 3 years ago

I have a solution (but it's sloppy) for the problem. Please add add_compile_definitions(FBOW_ANDROID=ON) to your root CMakeLists.txt and replace all __ANDROID__ macro to FBOW_ANDROID.

(If you using installed FBoW in the other project, you should add the same line add_compile_definitions(...) in its CMakelists.txt)

mmitjansc commented 3 years ago

Might be sloppy, but this solution worked like a charm, thank you!

Now I'm curious as to why it worked. I'm new in multi-processor compiling, so I'll keep digging a bit. But so far it works :)

lockingball commented 2 years ago

i cannot find immintrin.h ,that seems like g++7.5 for arm have not this .h file ,could you tell me how to fix it ,thank you!!!!

mmitjansc commented 2 years ago

Hi lockingball, You should replace all your #include <immintrin.h> in your code by #include <arm_neon.h>.