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

OpenFHE: fix library install directory in CMake #7880

Merged
merged 2 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions O/OpenFHE/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sources = [
script = raw"""
cd $WORKSPACE/srcdir/openfhe-development/

# Add missing `<cmath>` header to avoid disambiguities in macOS builds
if [[ "${target}" == *-apple* ]]; then
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/macos-include-cmath.patch"
fi
Expand All @@ -33,6 +34,13 @@ cmake .. \

make -j${nproc}
make install

# Hotfix `OpenFHETargets-release.cmake` to reflect library move by BinaryBuilder.jl auditor
if [[ "${target}" == *-mingw* ]]; then
cd /
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/windows-fix-cmake-libdir.patch"
cd -
fi
"""

# These are the platforms we will build for by default, unless further
Expand Down
41 changes: 41 additions & 0 deletions O/OpenFHE/bundled/patches/windows-fix-cmake-libdir.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's presumably easier to patch the CMake file which installs the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, yes. Once I figured this out, I submitted an upstream patch (openfheorg/openfhe-development#634) and updated the PR here with the same patch. It would be great if we can merge this already now, and I'll update the build_tarballs.jl once an upstream fix has been released.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
--- a/workspace/destdir/CMake/OpenFHETargets-release.cmake
+++ b/workspace/destdir/CMake/OpenFHETargets-release.cmake
@@ -9,31 +9,31 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
set_property(TARGET OPENFHEcore APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(OPENFHEcore PROPERTIES
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/libOPENFHEcore.dll.a"
- IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOPENFHEcore.dll"
+ IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libOPENFHEcore.dll"
)

list(APPEND _IMPORT_CHECK_TARGETS OPENFHEcore )
-list(APPEND _IMPORT_CHECK_FILES_FOR_OPENFHEcore "${_IMPORT_PREFIX}/lib/libOPENFHEcore.dll.a" "${_IMPORT_PREFIX}/lib/libOPENFHEcore.dll" )
+list(APPEND _IMPORT_CHECK_FILES_FOR_OPENFHEcore "${_IMPORT_PREFIX}/lib/libOPENFHEcore.dll.a" "${_IMPORT_PREFIX}/bin/libOPENFHEcore.dll" )

# Import target "OPENFHEpke" for configuration "Release"
set_property(TARGET OPENFHEpke APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(OPENFHEpke PROPERTIES
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/libOPENFHEpke.dll.a"
- IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOPENFHEpke.dll"
+ IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libOPENFHEpke.dll"
)

list(APPEND _IMPORT_CHECK_TARGETS OPENFHEpke )
-list(APPEND _IMPORT_CHECK_FILES_FOR_OPENFHEpke "${_IMPORT_PREFIX}/lib/libOPENFHEpke.dll.a" "${_IMPORT_PREFIX}/lib/libOPENFHEpke.dll" )
+list(APPEND _IMPORT_CHECK_FILES_FOR_OPENFHEpke "${_IMPORT_PREFIX}/lib/libOPENFHEpke.dll.a" "${_IMPORT_PREFIX}/bin/libOPENFHEpke.dll" )

# Import target "OPENFHEbinfhe" for configuration "Release"
set_property(TARGET OPENFHEbinfhe APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(OPENFHEbinfhe PROPERTIES
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/libOPENFHEbinfhe.dll.a"
- IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOPENFHEbinfhe.dll"
+ IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libOPENFHEbinfhe.dll"
)

list(APPEND _IMPORT_CHECK_TARGETS OPENFHEbinfhe )
-list(APPEND _IMPORT_CHECK_FILES_FOR_OPENFHEbinfhe "${_IMPORT_PREFIX}/lib/libOPENFHEbinfhe.dll.a" "${_IMPORT_PREFIX}/lib/libOPENFHEbinfhe.dll" )
+list(APPEND _IMPORT_CHECK_FILES_FOR_OPENFHEbinfhe "${_IMPORT_PREFIX}/lib/libOPENFHEbinfhe.dll.a" "${_IMPORT_PREFIX}/bin/libOPENFHEbinfhe.dll" )

# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)