mpc-msri / EzPC

MIT License
401 stars 122 forks source link

Fail to build Seal when building SCI #173

Closed deadlywing closed 1 year ago

deadlywing commented 1 year ago

I follow the instructions from readme of SCI: cmake -DCMAKE_INSTALL_PREFIX=./install .. And I get:


-- Build files have been written to: /home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src
[  2%] Building CXX object CMakeFiles/seal.dir/seal/batchencoder.cpp.o
In file included from /home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/util/mempool.h:19,
                 from /home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/util/pointer.h:8,
                 from /home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/util/uintcore.h:12,
                 from /home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/batchencoder.h:10,
                 from /home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/batchencoder.cpp:8:
/home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/util/locks.h:17:33: error: ‘unique_lock’ in namespace ‘std’ does not name a template type
   17 |         using WriterLock = std::unique_lock<std::shared_mutex>;
      |                                 ^~~~~~~~~~~
/home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/util/locks.h:10:1: note: ‘std::unique_lock’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
    9 | #include <shared_mutex>
  +++ |+#include <mutex>
   10 | 
/home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/util/locks.h:29:35: error: ‘WriterLock’ does not name a type
   29 |             SEAL_NODISCARD inline WriterLock acquire_write()
      |                                   ^~~~~~~~~~
/home/zhoujinjin/temp/EzPC/SCI/extern/SEAL/native/src/seal/util/locks.h:39:35: error: ‘WriterLock’ does not name a type
   39 |             SEAL_NODISCARD inline WriterLock try_acquire_write() noexcept
      |                                   ^~~~~~~~~~
gmake[2]: *** [CMakeFiles/seal.dir/build.make:76: CMakeFiles/seal.dir/seal/batchencoder.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/seal.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
CMake Error at src/LinearHE/CMakeLists.txt:18 (find_package):
  Could not find a package configuration file provided by "SEAL" (requested
  version 3.3.2) with any of the following names:

    SEALConfig.cmake
    seal-config.cmake

  Add the installation prefix of "SEAL" to CMAKE_PREFIX_PATH or set
  "SEAL_DIR" to a directory containing one of the above files.  If "SEAL"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!
See also "/home/zhoujinjin/temp/EzPC/SCI/build/CMakeFiles/CMakeOutput.log".

I find the repo of SEAL 3.3.2 does not exists cmakelists.txt at all. So maybe it's the reason of it ?
alarst13 commented 10 months ago

I also had this issue. I didn't have time to check exactly why this was happening, or if it had to do with my C++ version, but simply adding #include <mutex> after #include <shared_mutex> in the extern/SEAL/native/src/seal/util/locks.h seemed to fix the issue. Hope it helps someone.