Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building HElib with HEXL installed via vcpkg fails #460

Open
fboemer opened this issue Sep 13, 2021 · 0 comments
Open

Building HElib with HEXL installed via vcpkg fails #460

fboemer opened this issue Sep 13, 2021 · 0 comments

Comments

@fboemer
Copy link
Contributor

fboemer commented Sep 13, 2021

I'm running into some errors linking to vcpkg-built HEXL from within HElib. Looks like it stems from (https://github.com/homenc/HElib/blob/master/src/CMakeLists.txt#L312-L320), which assumes libhexl.a includes all its dependencies. While this is true for a CMake build of HEXL, this is true is NOT true when building from vcpkg. In particular, CpuFeatures is linked to and not included in the static lib.

Something like target_link_libraries(helib PRIVATE $<TARGET_PROPERTY:HEXL::hexl,INTERFACE_LINK_LIBRARIES>) would need to be added to the HElib CMakeLists.txt to properly link CpuFeatures (though this change by itself causes some other errors)

To reproduce,

vcpkg install hexl

cd /home/fboemer/repos/helibproject/HElib/build
cmake .. -DUSE_INTEL_HEXL=ON -DCMAKE_INSTALL_PREFIX=./ -DHEXL_DIR=/home/fboemer/repos/vcpkg/packages/hexl_x64-linux/share/HEXL -DENABLE_TEST=ON -DCMAKE_BUILD_TYPE=Release -DCpuFeatures_DIR=/home/fboemer/repos/vcpkg/packages/cpu-features_x64-linux/share/CpuFeatures
# -- Intel HEXL found
# -- Intel HEXL Version: 1.2.1 found (minimum required is 1.2.1)
# -- Setting up googletest framework
# -- /home/fboemer/repos/helibproject/HElib/build
# -- Configuring done
# -- Generating done
# -- Build files have been written to: /home/fboemer/repos/helibproject/HElib/build

make
# /usr/bin/ld: ../../lib/libhelib.a(eltwise-add-mod.cpp.o): in function `_GLOBAL__sub_I_eltwise_add_mod.cpp':
eltwise-add-mod.cpp:(.text.startup+0x84): undefined reference to `GetX86Info'
``

@jlhcrawford , @hamishun , FYI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant