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

Wizard recipe: SEAL-v3.5.4 #1189

Merged
merged 4 commits into from
Jun 22, 2020
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
76 changes: 76 additions & 0 deletions S/SEAL_jll/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

name = "SEAL_jll"
sloede marked this conversation as resolved.
Show resolved Hide resolved
version = v"3.5.4"

# Collection of sources required to complete build
sources = [
ArchiveSource("https://github.com/microsoft/SEAL/archive/v3.5.4.tar.gz", "0c325c3e3d9b77be63ef866a7c73de861be46b99b61a22be60518d34865a1f37"),
DirectorySource("./bundled")
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir
for f in ${WORKSPACE}/srcdir/patches/*.patch; do
atomic_patch -p1 ${f}
done
cd SEAL-*
# The last three '-DSEAL_USE__*' flags are required to circumvent
# cross-compilation issues.
if [[ "${target}" == *-darwin* ]]; then
# C++17 is disabled on MacOS due to the environment being too old.
cmake . \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN%.*}_clang.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=ON \
-DSEAL_BUILD_SEAL_C=ON \
-DSEAL_USE___BUILTIN_CLZLL=OFF \
-DSEAL_USE__ADDCARRY_U64=OFF \
-DSEAL_USE__SUBBORROW_U64=OFF \
-DSEAL_USE_CXX17=OFF
else
cmake . \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN%.*}_clang.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=ON \
-DSEAL_BUILD_SEAL_C=ON \
-DSEAL_USE___BUILTIN_CLZLL=OFF \
-DSEAL_USE__ADDCARRY_U64=OFF \
-DSEAL_USE__SUBBORROW_U64=OFF
fi
make -j${nproc}
make install
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = [
Linux(:x86_64, libc=:musl),
MacOS(:x86_64),
Linux(:x86_64, libc=:glibc),
Linux(:aarch64, libc=:glibc),
FreeBSD(:x86_64),
Linux(:powerpc64le, libc=:glibc),
Linux(:aarch64, libc=:musl)
]


# The products that we will ensure are always built
products = [
LibraryProduct("libsealc", :libsealc),
LibraryProduct("libseal", :libseal)
]

# Dependencies that must be installed before this package can be built
dependencies = Dependency[
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version = v"9.1.0")
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git before/SEAL-3.5.4/CMakeLists.txt after/SEAL-3.5.4/CMakeLists.txt
index c0b6dc8..99b7b73 100644
--- before/SEAL-3.5.4/CMakeLists.txt
+++ after/SEAL-3.5.4/CMakeLists.txt
@@ -262,14 +262,14 @@ if(SEAL_USE_MSGSL AND NOT MSVC)
RESULT_VARIABLE result
WORKING_DIRECTORY ${SEAL_THIRDPARTY_DIR}/msgsl)
else()
- seal_create_cache_entries(${SEAL_THIRDPARTY_DIR}/msgsl)
+ # seal_create_cache_entries(${SEAL_THIRDPARTY_DIR}/msgsl)
if(EXISTS ${SEAL_THIRDPARTY_DIR}/msgsl/CMakeCache.txt)
# Force regenerating make files. When cross compiling we might be
# compiling more than one platform at a time.
file(REMOVE ${SEAL_THIRDPARTY_DIR}/msgsl/CMakeCache.txt)
endif()
execute_process(
- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -Ccache_init.txt
+ COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -DCMAKE_INSTALL_PREFIX=$ENV{prefix} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release
OUTPUT_QUIET
RESULT_VARIABLE result
WORKING_DIRECTORY ${SEAL_THIRDPARTY_DIR}/msgsl)
@@ -322,14 +322,14 @@ if(SEAL_USE_ZLIB AND NOT MSVC)
RESULT_VARIABLE result
WORKING_DIRECTORY ${SEAL_THIRDPARTY_DIR}/zlib)
else()
- seal_create_cache_entries(${SEAL_THIRDPARTY_DIR}/zlib)
+ # seal_create_cache_entries(${SEAL_THIRDPARTY_DIR}/zlib)
if(EXISTS ${SEAL_THIRDPARTY_DIR}/zlib/build/CMakeCache.txt)
# Force regenerating make files. When cross compiling we might be
# compiling more than one platform at a time.
file(REMOVE ${SEAL_THIRDPARTY_DIR}/zlib/build/CMakeCache.txt)
endif()
execute_process(
- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -Ccache_init.txt
+ COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -DCMAKE_INSTALL_PREFIX=$ENV{prefix} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release
OUTPUT_QUIET
RESULT_VARIABLE result
WORKING_DIRECTORY ${SEAL_THIRDPARTY_DIR}/zlib)