build failure on 32-bit x86: `error: cannot bind non-const lvalue reference of type ‘uint64_t&’ {aka ‘long long unsigned int&’} to a value of type ‘std::size_t’ {aka ‘unsigned int’}`
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 5k
- Forks
- 622
- Avg merge
- 8h 37m
- Merged PRs (30d)
- 5
Description
The build of SPTAG on the 32-bit x86 port (i386) of Debian GNU/Linux failed due to compile errors.
cd "/<<PKGBUILDDIR>>/obj-i686-linux-gnu/AnnService" && /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_SYSTEM_DYN_LINK -D_exe -I"/<<PKGBUILDDIR>>/AnnService" -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wunreachable-code -Wno-reorder -Wno-sign-compare -Wno-unknown-pragmas -Wcast-align -lm -lrt -fopenmp -fopenmp -std=gnu++14 -MD -MT AnnService/CMakeFiles/sptag-ssdserving.dir/src/SSDServing/VectorSearch/BootVectorSearch.cpp.o -MF CMakeFiles/sptag-ssdserving.dir/src/SSDServing/VectorSearch/BootVectorSearch.cpp.o.d -o CMakeFiles/sptag-ssdserving.dir/src/SSDServing/VectorSearch/BootVectorSearch.cpp.o -c "/<<PKGBUILDDIR>>/AnnService/src/SSDServing/VectorSearch/BootVectorSearch.cpp"
In file included from /<<PKGBUILDDIR>>/AnnService/src/SSDServing/VectorSearch/BootVectorSearch.cpp:6:
/<<PKGBUILDDIR>>/AnnService/inc/SSDServing/VectorSearch/SearchSsdIndex.h: In function ‘void SPTAG::SSDServing::VectorSearch::LoadTruthTXT(std::string, std::vector<std::set<int> >&, int, SPTAG::SizeType)’:
/<<PKGBUILDDIR>>/AnnService/inc/SSDServing/VectorSearch/SearchSsdIndex.h:108:45: error: cannot bind non-const lvalue reference of type ‘uint64_t&’ {aka ‘long long unsigned int&’} to a value of type ‘std::size_t’ {aka ‘unsigned int’}
108 | if (ptr->ReadString(lineBufferSize, currentLine, ' ') == 0) {
| ^~~~~~~~~~~~~~
In file included from /<<PKGBUILDDIR>>/AnnService/inc/Core/Common.h:15,
from /<<PKGBUILDDIR>>/AnnService/inc/SSDServing/VectorSearch/BootVectorSearch.h:5,
from /<<PKGBUILDDIR>>/AnnService/src/SSDServing/VectorSearch/BootVectorSearch.cpp:4:
/<<PKGBUILDDIR>>/AnnService/inc/Helper/DiskIO.h:55:61: note: initializing argument 1 of ‘virtual uint64_t SPTAG::Helper::DiskPriorityIO::ReadString(uint64_t&, std::unique_ptr<char []>&, char, uint64_t)’
55 | virtual std::uint64_t ReadString(std::uint64_t& readSize, std::unique_ptr<char[]>& buffer, char delim = '\n', std::uint64_t offset = UINT64_MAX) = 0;
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from /<<PKGBUILDDIR>>/AnnService/src/SSDServing/VectorSearch/BootVectorSearch.cpp:6:
/<<PKGBUILDDIR>>/AnnService/inc/SSDServing/VectorSearch/SearchSsdIndex.h:114:41: error: cannot bind non-const lvalue reference of type ‘uint64_t&’ {aka ‘long long unsigned int&’} to a value of type ‘std::size_t’ {aka ‘unsigned int’}
114 | if (ptr->ReadString(lineBufferSize, currentLine, '\n') == 0) {
| ^~~~~~~~~~~~~~
In file included from /<<PKGBUILDDIR>>/AnnService/inc/Core/Common.h:15,
from /<<PKGBUILDDIR>>/AnnService/inc/SSDServing/VectorSearch/BootVectorSearch.h:5,
from /<<PKGBUILDDIR>>/AnnService/src/SSDServing/VectorSearch/BootVectorSearch.cpp:4:
/<<PKGBUILDDIR>>/AnnService/inc/Helper/DiskIO.h:55:61: note: initializing argument 1 of ‘virtual uint64_t SPTAG::Helper::DiskPriorityIO::ReadString(uint64_t&, std::unique_ptr<char []>&, char, uint64_t)’
55 | virtual std::uint64_t ReadString(std::uint64_t& readSize, std::unique_ptr<char[]>& buffer, char delim = '\n', std::uint64_t offset = UINT64_MAX) = 0;
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from /<<PKGBUILDDIR>>/AnnService/src/SSDServing/VectorSearch/BootVectorSearch.cpp:6:
/<<PKGBUILDDIR>>/AnnService/inc/SSDServing/VectorSearch/SearchSsdIndex.h:121:40: error: cannot bind non-const lvalue reference of type ‘uint64_t&’ {aka ‘long long unsigned int&’} to a value of type ‘std::size_t’ {aka ‘unsigned int’}
121 | while (ptr->ReadString(lineBufferSize, currentLine, '\n') > 0) { remainlines++; }
| ^~~~~~~~~~~~~~
In file included from /<<PKGBUILDDIR>>/AnnService/inc/Core/Common.h:15,
from /<<PKGBUILDDIR>>/AnnService/inc/SSDServing/VectorSearch/BootVectorSearch.h:5,
from /<<PKGBUILDDIR>>/AnnService/src/SSDServing/VectorSearch/BootVectorSearch.cpp:4:
/<<PKGBUILDDIR>>/AnnService/inc/Helper/DiskIO.h:55:61: note: initializing argument 1 of ‘virtual uint64_t SPTAG::Helper::DiskPriorityIO::ReadString(uint64_t&, std::unique_ptr<char []>&, char, uint64_t)’
55 | virtual std::uint64_t ReadString(std::uint64_t& readSize, std::unique_ptr<char[]>& buffer, char delim = '\n', std::uint64_t offset = UINT64_MAX) = 0;
| ~~~~~~~~~~~~~~~^~~~~~~~
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with AnnService/inc/SSDServing/VectorSearch/SearchSsdIndex.h at the LoadTruthTXT calls reported in the build log, then inspect the ReadString declaration in AnnService/inc/Helper/DiskIO.h and the caller from BootVectorSearch.cpp. Reproduce the C++14 build on Debian i386 and confirm that the reported 32-bit compilation errors are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100