microsoft / APSI

APSI is a C++ library for Asymmetric (unlabeled or labeled) Private Set Intersection.
MIT License
186 stars 42 forks source link

Can't find SEAL #39

Closed lx-1234 closed 1 year ago

lx-1234 commented 2 years ago

I have installed SEAL using vcpkg. But when I try to compile APSI, I meet an error as following.

CMake Error at CMakeLists.txt:120 (find_package):
  By not providing "FindSEAL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SEAL", but
  CMake did not find one.

  Could not find a package configuration file provided by "SEAL" (requested
  version 3.7) 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.

I try to add "-DCMAKE_PREFIX_PATH=D:\src\vcpkg\packages" , but it doesn't work.

CMake Error at CMakeLists.txt:120 (find_package):
  Found package configuration file:

    D:/src/vcpkg/packages/seal_x64-windows-static-md/share/SEAL/SEALConfig.cmake

  but it set SEAL_FOUND to FALSE so package "SEAL" is considered to be NOT
  FOUND.

How can i fix it? Thx.

WeiDaiWD commented 2 years ago

You need cmake ../my/project -DCMAKE_TOOLCHAIN_FILE=[vcpkg-root]/scripts/buildsystems/vcpkg.cmake.

lx-1234 commented 2 years ago

You need cmake ../my/project -DCMAKE_TOOLCHAIN_FILE=[vcpkg-root]/scripts/buildsystems/vcpkg.cmake.

Thanks for your quick reply. I compile the project on Windows using VS code. And I add

"cmake.configureSettings": {
    "CMAKE_TOOLCHAIN_FILE": "D:/src/vcpkg/scripts/buildsystems/vcpkg.cmake",
    "VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
}

But it doesn't work.

kimlaine commented 1 year ago

One thing that tripped me was that when you specify the flags to CMake, you need to write -DVCPKG_TARGET_TRIPLET=x64-windows-static-md instead of -DVCPKG_TARGET_TRIPLET="x64-windows-static-md" (so no quotes). Otherwise it won't work. I'm not sure what happens when you write as you did. I tried using

        "cmake.configureArgs": [
            "-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake",
            "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md",
            "-DAPSI_BUILD_TESTS=ON",
            "-DAPSI_BUILD_CLI=ON"
        ],

and it seems to work.

Yes -- there is definitely a mistake/bug in the README.md. I'll fix that shortly.

minihu-crypto commented 1 year ago

Hello, I also encountered this problem, how to solve it?