Open sromberg opened 11 years ago
Yes, serialized indexes are not portable to different architectures currently. This is something I'm planing to fix in a future version.
Also, indexes computed with FLANN 1.7.1 would not work in 1.8.4 due to some significant changes in the library that were made when support for incremental insertion/removal wad added.
Uff, that is bad news. I have tons of different visual vocabularies stored on my disk. I cannot simply move to a new on-disk format. Also this fact should be clearly documented.
Despite that I have written several different serialization routines before and I found that it is actually quite portable as long as you stick to types with predefined sizes such as int32_t``or int64_t
. In other words, never use int
and long
and size_t
in the structures being stored. You can simple convert to these types when loading/saving.
Unfortunately the changes from version 1.7 were significant enough that it was too hard to maintain on-disk compatibility. You are correct, this should be better documented, I'll make sure to add this to the documentation.
Using fixed size primitive types such as int32_t
and int64_t
sounds like the right thing to do. I'll be adding this to a future version.
Dear Marius,
I found the following bug in FLANN 1.8.4: When compiling my code with Visual Studio 2008 SP1 in x86 mode compilation succeeds. However, when I compile my code in x64 mode then the following compilation error appears:
(The full error output is appended at the end of this message)
It is easy to fix by adding
in
serialization.h
.However, the critical questions I have in mind are:
size_t
as type somewhere in the serialization code. Does the written format therefore depend on the architecture (i.e. x86 vs. x64) then?Thanks, Stefan
Full error message: