cryptobiu / libscapi

Comprehensive Open Source Library for Secure Multiparty Computation
MIT License
180 stars 66 forks source link

Error making libscapi (libOTe) #75

Closed manel1874 closed 4 years ago

manel1874 commented 4 years ago

Hello,

When I make libscapi, I get the following error in building libOTe library:

make[3]: Entering directory '/home/manel/libscapi/build/libOTe' [ 1%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Common/Timer.cpp.o [ 2%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Common/Log.cpp.o [ 3%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Common/CLP.cpp.o [ 4%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Common/CuckooIndex.cpp.o [ 5%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Common/Defines.cpp.o [ 7%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Common/TestCollection.cpp.o [ 8%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Common/BitVector.cpp.o [ 9%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Crypto/AES.cpp.o [ 10%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Crypto/RCurve.cpp.o [ 11%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Crypto/Curve.cpp.o [ 12%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Crypto/Blake2.cpp.o [ 14%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Crypto/sha1.cpp.o [ 15%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Crypto/PRNG.cpp.o [ 16%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Circuit/BetaCircuit.cpp.o [ 17%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Circuit/BetaLibrary.cpp.o [ 18%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Network/Session.cpp.o In file included from /home/manel/libscapi/build/libOTe/cryptoTools/cryptoTools/Network/Session.h:4:0, from /home/manel/libscapi/build/libOTe/cryptoTools/cryptoTools/Network/Session.cpp:1: /home/manel/libscapi/build/libOTe/cryptoTools/cryptoTools/Network/Channel.h:360:22: error: ‘boost::asio::strand {aka boost::asio::io_service::strand}’ is not a template boost::asio::strand mSendStrand, mRecvStrand; ^ compilation terminated due to -Wfatal-errors. cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/build.make:422: recipe for target 'cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Network/Session.cpp.o' failed make[3]: [cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Network/Session.cpp.o] Error 1 make[3]: Leaving directory '/home/manel/libscapi/build/libOTe' CMakeFiles/Makefile2:142: recipe for target 'cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/all' failed make[2]: [cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/all] Error 2 make[2]: Leaving directory '/home/manel/libscapi/build/libOTe' Makefile:127: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/manel/libscapi/build/libOTe' makefile:168: recipe for target 'compile-libote' failed make: [compile-libote] Error 2

Steps to reproduce the bug I simply created a ubuntu virtual machine and then ran the following:

$ sudo apt-get update
$ sudo apt-get install -y git build-essential
$ sudo apt-get install -y libssl-ocaml-dev libssl-dev
$ sudo apt-get install -y libgmp3-dev
$ sudo apt-get -y install g++ gcc libicu-dev

Download Boost:

$ wget -O boost_1_64_0.tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.bz2/download
$ tar --bzip2 -xf boost_1_64_0.tar.bz2
$ cd boost_1_64_0

Run the script which prepares Boost's build process sudo ./bootstrap.sh --prefix=/usr/local --with-libraries=all

Compile the project sudo ./b2 install

Add the Boost libraries path to the default Ubuntu library search path sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/boost.conf'

Update the default Ubuntu library search paths sudo ldconfig

Clone and make libscapi

$ cd ~
$ git clone https://github.com/cryptobiu/libscapi.git
$ cd libscapi
$ make

Machine details:

Additional context Before the error I received the following warnings:

CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
  Imported targets not available for Boost version 106400
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
  cryptoTools/cryptoTools/CMakeLists.txt:129 (find_package)
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
  Imported targets not available for Boost version 106400
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
  cryptoTools/cryptoTools/CMakeLists.txt:129 (find_package)
CMake Warning:
  Manually-specified variables were not used by the project:

    LIBSCAPI_ROOT
liorko87 commented 4 years ago

Please try with boost 1.71

manel1874 commented 4 years ago

Thank you Lior! I successfully made libOT. However, later in the make process (KCP library compilation), I get this error:

g++ -c -g -std=c++14 -Iinstall/include -Iinstall/include/OTExtensionBristol -Iinstall/include/libOTe -Iinstall/include/libOTe/cryptoTools -I/home/manel -I/home/manel/OTExtensionBristol -mavx -maes -msse4.1 -mpclmul -Wall -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-parentheses -Wno-ignored-attributes -O3 -fPIC -o obj/interactive_mid_protocols/OTFullSimulationROM.o src/interactive_mid_protocols/OTFullSimulationROM.cpp
g++ -c -g -std=c++14 -Iinstall/include -Iinstall/include/OTExtensionBristol -Iinstall/include/libOTe -Iinstall/include/libOTe/cryptoTools -I/home/manel -I/home/manel/OTExtensionBristol -mavx -maes -msse4.1 -mpclmul -Wall -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-parentheses -Wno-ignored-attributes -O3 -fPIC -o obj/comm/Network.o src/comm/Network.cpp In file included from src/comm/Network.cpp:16:0: src/comm/../../include/comm/utils.h:8:31: fatal error: log4cpp/Category.hh: No such file or directory compilation terminated. makefile:129: recipe for target 'obj/comm/Network.o' failed

liorko87 commented 4 years ago

Try: sudo apt-get install -y liblog4cpp5-dev

manel1874 commented 4 years ago

Perfect! It works, I finished the make process. Thank you Lior!