microsoft / SEAL

Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
https://www.microsoft.com/en-us/research/group/cryptography-research/
MIT License
3.61k stars 709 forks source link

seal[hexl]: cannot find -leasyloggingpp: No such file or directory #713

Open lqvir opened 21 hours ago

lqvir commented 21 hours ago

Description:

I installed Microsoft SEAL using vcpkg on WSL2 with the following command:

vcpkg install seal[hexl]

Then, I got an error /usr/bin/ld: cannot find -leasyloggingpp: No such file or directory in the Debug (CMAKE_BUILD_TYPE=Debug) while the same error did not appear in Release. I use the following CMake Commands:

cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=/home/konjak/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build .

Failure log

konjak@lab:~/Sealtest/build$ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=/home/konjak/vcpkg/scripts/buildsystems/vcpkg.cmake
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: optimized;/home/konjak/vcpkg/installed/x64-linux/lib/libz.a;debug;/home/konjak/vcpkg/installed/x64-linux/debug/lib/libz.a (found version "1.3.0") 
-- Intel HEXL found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Microsoft SEAL -> Version 4.1.1 detected
-- Microsoft SEAL -> Targets available: SEAL::seal
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") 
-- Checking for module 'easyloggingpp'
--   Found easyloggingpp, version 9.96.7
-- Configuring done
-- Generating done
-- Build files have been written to: /home/konjak/Sealtest/build
konjak@lab:~/Sealtest/build$ cmake --build .
[ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable main
/usr/bin/ld: cannot find -leasyloggingpp: No such file or directory
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/main.dir/build.make:102: main] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/main.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

CMake Files Version 1

cmake_minimum_required(VERSION 3.11)

project(CMAKE_TEST)

set(CMAKE_CXX_STANDARD 11)

add_executable(main main.cpp)

find_package(SEAL CONFIG REQUIRED)

target_link_libraries(main PRIVATE SEAL::seal)

CMake Files Version 2

cmake_minimum_required(VERSION 3.11)

project(CMAKE_TEST)

set(CMAKE_CXX_STANDARD 11)

add_executable(main main.cpp)

find_package(SEAL CONFIG REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(easyloggingpp easyloggingpp REQUIRED IMPORTED_TARGET)

target_link_libraries(main PRIVATE SEAL::seal PkgConfig::easyloggingpp)
lqvir commented 21 hours ago

Of course, this error can be fixed by installed easyloggingpp globally. But I think this solution is contrary to the original purpose of using VCPKG.