osu-crypto / libOTe

A fast, portable, and easy to use Oblivious Transfer Library
Other
428 stars 107 forks source link

libOTe does not build #117

Closed ruidazeng closed 10 months ago

ruidazeng commented 1 year ago

The command python build.py --all --boost --sodium yields the following error without any hints for resolution. I have installed all of the required dependencies (I also presumed the build.py automatically install the missing dependencies even if I did not).

/usr/bin/ld: ../libOTe_Tests/liblibOTe_Tests.a(ExConvCode_Tests.cpp.o): in function `osuCrypto::ExConvCode_encode_basic_test(osuCrypto::CLP const&)':
ExConvCode_Tests.cpp:(.text+0x14f4): undefined reference to `void osuCrypto::ExConvCode::accumulate<osuCrypto::block, unsigned char>(nonstd::span_lite::span<osuCrypto::block, 18446744073709551615ul>, nonstd::span_lite::span<unsigned char, 18446744073709551615ul>)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [frontend/CMakeFiles/frontend_libOTe.dir/build.make:125: frontend/frontend_libOTe] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:432: frontend/CMakeFiles/frontend_libOTe.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

Also, python build.py --install yields this error:

CMake Error at out/build/linux/cryptoTools/cmake_install.cmake:93 (file):
  file INSTALL cannot find
  "/home/ruida/libOTe/cmake/../out//libdivide/libdivide.h": No such file
  or directory.
Call Stack (most recent call first):
  out/build/linux/cmake_install.cmake:47 (include)
ruidazeng commented 1 year ago

Same issue persists when I try to build it with "relic" instead of "sodium"

ladnir commented 1 year ago

Seems to be an issue only on specific compilers. Try adding

 template void ExConvCode::accumulate<block, u8>(span<block>, span<u8> e);

To https://github.com/osu-crypto/libOTe/blob/ad07f27b9ab229fa1d64ee642798c16ea5d8813f/libOTe/Tools/ExConvCode/ExConvCodeInstantiations.cpp#L14

Cesare-Liu commented 1 year ago

The same issue still persists after the new commit ddf76. The libdivide.h file cannot be found when executing the command 'python build.py --install', regardless of whether it is built with relic or sodium.

ladnir commented 1 year ago

Oh, so it fixed the undefined reference right?

Does .\out\libdivide\ exist?

Cesare-Liu commented 1 year ago

No, there are only 5 folders in ./out : bitpolymul build install libsodium span-lite.