SPTAG
SPTAG copied to clipboard
test failure when building on Linux in tmpfs due to the use of `O_DIRECT`
When building SPTAG on Linux in a tmpfs (a RAM-only filesystem), the tests fail because they open files with O_DIRECT but that isn't supported on tmpfs by current versions of Linux.
1: [4] Failed to create file handle: SPANN/SPTAGFullList.bin: Invalid argument
1: [4] Cannot open file:SPANN/SPTAGFullList.bin!
1: [4] Cannot Load SSDIndex!
1: ./Test/src/AlgoTest.cpp(45): error: in "AlgoTest/SPANNTest": check SPTAG::ErrorCode::Success == vecIndex->SaveIndex(out) has failed
I suggest detecting when the file open failed due to missing O_DIRECT support and opening the file again without using O_DIRECT.