osu-crypto / libPSI

A repository for private set intersection.
Other
168 stars 47 forks source link

has no member named ‘usize’; did you mean ‘size’? #23

Closed Cryptographer63 closed 2 years ago

Cryptographer63 commented 2 years ago

hi~ I successfully installed libOTe, but I got the following error when compiling libPSI, what should I do?

/home/crypto/libPSI/libPSI/Tools/RandomShuffle.cpp: In member function ‘void osuCrypto::RandomShuffle::parallelShuffle(osuCrypto::span<long unsigned int>, osuCrypto::u64, osuCrypto::u64)’:
/home/crypto/libPSI/libPSI/Tools/RandomShuffle.cpp:18:27: error: ‘osuCrypto::span<long unsigned int>’ {aka ‘class nonstd::span_lite::span<long unsigned int, 18446744073709551615>’} has no member named ‘usize’; did you mean ‘size’?
   18 |         auto start = vals.usize() * t / nt;
      |                           ^~~~~
      |                           size
compilation terminated due to -Wfatal-errors.
make[2]: *** [libPSI/CMakeFiles/libPSI.dir/build.make:468: libPSI/CMakeFiles/libPSI.dir/Tools/RandomShuffle.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/crypto/libPSI/libPSI/Tools/CuckooHasher.cpp: In member function ‘void osuCrypto::CuckooHasher::insertBatch(osuCrypto::span<long unsigned int>, osuCrypto::MatrixView<long unsigned int>, osuCrypto::CuckooHasher::Workspace&)’:
/home/crypto/libPSI/libPSI/Tools/CuckooHasher.cpp:180:35: error: ‘osuCrypto::span<long unsigned int>’ {aka ‘class nonstd::span_lite::span<long unsigned int, 18446744073709551615>’} has no member named ‘usize’; did you mean ‘size’?
  180 |         u64 remaining = inputIdxs.usize();
      |                                   ^~~~~
      |                                   size
compilation terminated due to -Wfatal-errors.
make[2]: *** [libPSI/CMakeFiles/libPSI.dir/build.make:454: libPSI/CMakeFiles/libPSI.dir/Tools/CuckooHasher.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:134: libPSI/CMakeFiles/libPSI.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
ladnir commented 2 years ago

Yes, cryptoTools has been updated and removed usize. I'll try to fix this soon but in the meantime you can either roll back the commit of libOTe (maybe v1.51 works) or change usize() to size()

ladnir commented 2 years ago

ok, fixed. The new setup is:

git clone https://github.com/osu-crypto/libPSI.git
cd libPSI
python build.py

This will now download the correct version of libOTe to thirdparty/libOTe and locally install to out/install/<platform>/. Hopefully installing libPSI should also work but i didnt test it . Let me know if you have questions.

Cryptographer63 commented 2 years ago

I have no more questions, thanks