【发布时间】:2021-09-01 09:33:47
【问题描述】:
我想使用 emscripten 编译 SealPIR 库以生成 wasm 文件。
使用此命令时:
emcmake cmake .
我收到此错误:
CMake Error at CMakeLists.txt:19 (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.2.0) 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/Zied/webassembly/SealPIR/CMakeFiles/CMakeOutput.log".
emcmake: error: 'cmake . -DCMAKE_TOOLCHAIN_FILE=/home/Zied/webassembly/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR="/home/Zied/webassembly/emsdk/node/14.15.5_64bit/bin/node"' failed (1)
SEAL 已正确安装。当我在没有 emcmake 的情况下运行相同的命令时,它工作得很好。 这是我的 CMakeList
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(SealPIR VERSION 2.1 LANGUAGES CXX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
add_executable(main
main.cpp
)
add_library(sealpir STATIC
pir.cpp
pir_client.cpp
pir_server.cpp
)
find_package(SEAL 3.2.0 EXACT REQUIRED)
target_link_libraries(main sealpir SEAL::seal)
【问题讨论】:
-
SEAL is correctly installed.你也是用emscripten编译的吗?你在哪里安装的?你能找到SEALConfig.cmake文件并将路径放在这里吗? -
@GuillaumeRacicot 是的,我使用 emscripten 编译它并为它生成了一个 libseal.a 和一个 wasm 文件。我也可以找到 SEALConfig.cmake,但我不知道如何将它链接到 SealPIR。
-
“我也可以找到 SEALConfig.cmake,但我不知道如何将它链接到 SealPIR。” - 错误信息不是解释了吗?您可以设置
SEAL_DIR环境变量以包含具有给定脚本的目录。 -
我这样做了,
export SEAL_DIR=/home/Zied/webassembly/SEAL/native/src/cmake我也试过emcmake cmake . -CMAKE_PREFIX_PATH=/home/Zied/webassembly/SEAL/native/src/cmake/但我总是遇到同样的问题 -
@Zied 请。
SEALConfig.cmake文件的完整路径是什么?
标签: c++ cmake webassembly emscripten emcmake