Visa-Research / volepsi

Efficient Private Set Intersection base on VOLE
MIT License
98 stars 32 forks source link

Build Fails on macOS Due to “no template named 'unary_function' in namespace 'std'” #64

Closed minglangdong closed 3 months ago

minglangdong commented 3 months ago

Hi, I attempted to build the volepsi library on my macOS 14.1.1 system with Boost support enabled. However, the build fails due to a compilation error that “no template named 'unary_function' in namespace 'std'”.

My Steps to Reproduce

  1. Cloned the volepsi repository.
  2. Ran the build command python3 build.py -DVOLE_PSI_ENABLE_BOOST=ON --debug.
  3. Encountered the following build error during the compilation:

libOTe Build '/usr/local/Cellar/cmake/3.23.2/bin/cmake' '--build' '/Users/[username]/Programs/coproto-debug/volepsi/out/libOTe/out/build/osx' '--config' 'Debug' [ 0%] Building CXX object cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Circuit/BetaCircuit.cpp.o In file included from /Users/[username]/Programs/coproto-debug/volepsi/out/libOTe/cryptoTools/cryptoTools/Circuit/BetaCircuit.cpp:1: In file included from /Users/[username]/Programs/coproto-debug/volepsi/out/libOTe/cryptoTools/cryptoTools/Circuit/BetaCircuit.h:7: In file included from /Users/[username]/Programs/coproto-debug/volepsi/out/libOTe/cryptoTools/cryptoTools/../cryptoTools/Common/BitVector.h:6: In file included from /Users/[username]/Programs/coproto-debug/volepsi/out/libOTe/cryptoTools/cryptoTools/../cryptoTools/Network/IoBuffer.h:18: In file included from /Users/[username]/Programs/coproto-debug/volepsi/out/install/osx/include/boost/variant.hpp:17: In file included from /Users/[username]/Programs/coproto-debug/volepsi/out/install/osx/include/boost/variant/variant.hpp:21: In file included from /Users/[username]/Programs/coproto-debug/volepsi/out/install/osx/include/boost/type_index.hpp:29: In file included from /Users/[username]/Programs/coproto-debug/volepsi/out/install/osx/include/boost/type_index/stl_type_index.hpp:47: /Users/[username]/Programs/coproto-debug/volepsi/out/install/osx/include/boost/container_hash/hash.hpp:131:33: fatal error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'? struct hash_base : std::unary_function<T, std::size_t> {};


/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
^
1 error generated.
make[2]: *** [cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/Circuit/BetaCircuit.cpp.o] Error 1
make[1]: *** [cryptoTools/cryptoTools/CMakeFiles/cryptoTools.dir/all] Error 2
make: *** [all] Error 2
CMake Error at thirdparty/fetch.cmake:22 (file):
  file failed to open for reading (No such file or directory):
 /Users/[username]/Programs/coproto-debug/volepsi/thirdparty/log-libOTe.txt

Call Stack (most recent call first):
  thirdparty/getLibOTe.cmake:63 (run)
  cmake/findDependancies.cmake:115 (include)
  CMakeLists.txt:14 (include)

CMake Error at thirdparty/fetch.cmake:23 (message):
  libOTe Build failed (2).
Call Stack (most recent call first):
  thirdparty/getLibOTe.cmake:63 (run)
  cmake/findDependancies.cmake:115 (include)
  CMakeLists.txt:14 (include)

-- Configuring incomplete, errors occurred!
See also "/Users/[username]/Programs/coproto-debug/volepsi/out/build/osx/CMakeFiles/CMakeOutput.log".
See also "/Users/[username]/Programs/coproto-debug/volepsi/out/build/osx/CMakeFiles/CMakeError.log".
make: Makefile: No such file or directory
make: *** No rule to make target `Makefile'.  Stop.

***
This build issue has been resolved by setting the option "-DCMAKE_CXX_STANDARD=17".