SPTAG icon indicating copy to clipboard operation
SPTAG copied to clipboard

test failure when building on Linux in tmpfs due to the use of `O_DIRECT`

Open pabs3 opened this issue 3 years ago • 1 comments

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

pabs3 avatar Aug 01 '22 02:08 pabs3

I suggest detecting when the file open failed due to missing O_DIRECT support and opening the file again without using O_DIRECT.

pabs3 avatar Aug 01 '22 02:08 pabs3