From 5319b6d0330313c9252b8b94f8b5550386973cd5 Mon Sep 17 00:00:00 2001 From: jeffmur Date: Sun, 8 Sep 2024 14:18:09 -0700 Subject: [PATCH] v0.0.11 --- CMakeLists.txt | 2 +- Makefile | 522 ++++++++++++++++++++++++++++++++++---------- dart/CHANGELOG.md | 4 + dart/binary.version | 2 +- dart/pubspec.yaml | 2 +- pyproject.toml | 2 +- 6 files changed, 416 insertions(+), 118 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d10b7a5..1bb54b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.10) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) -project(fhel VERSION 0.0.8 LANGUAGES CXX) +project(fhel VERSION 0.0.11 LANGUAGES CXX) # Import Backend Library add_subdirectory(src/backend/seal) diff --git a/Makefile b/Makefile index 17b6fef..52acb10 100644 --- a/Makefile +++ b/Makefile @@ -1,117 +1,411 @@ -PROJECT_ROOT := $(shell pwd) -DART_SRC ?= $(PROJECT_ROOT)/dart -FHE_LIB_SRC ?= $(PROJECT_ROOT)/src/backend -FLUTTER_EXAMPLE ?= $(PROJECT_ROOT)/example +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.30 -# Abstraction Layer, e.g. hello_world -FHE_BUILD_DIR ?= $(PROJECT_ROOT)/build -FHE_RELEASE_DIR ?= $(PROJECT_ROOT)/dist +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target -# Clean up all artifacts for this project -.PHONY: clean +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Disable VCS-based implicit rules. +% : %,v + +# Disable VCS-based implicit rules. +% : RCS/% + +# Disable VCS-based implicit rules. +% : RCS/%,v + +# Disable VCS-based implicit rules. +% : SCCS/s.% + +# Disable VCS-based implicit rules. +% : s.% + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/jeffmur/dev/fhel + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/jeffmur/dev/fhel + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..." + /usr/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components +.PHONY : list_install_components/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/jeffmur/dev/fhel/CMakeFiles /home/jeffmur/dev/fhel//CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/jeffmur/dev/fhel/CMakeFiles 0 +.PHONY : all + +# The main clean target clean: - @echo "Cleaning project..." - @rm -rf $(FHE_BUILD_DIR) - @rm -rf $(FHE_RELEASE_DIR) - @echo "Cleaning dependencies..." - @cd $(FHE_LIB_SRC); $(MAKE) clean - -# Retrive github submodules -.PHONY: trust-project -trust-project: - @echo "Trusting project...$(PROJECT_ROOT)" - @git config --global --add safe.directory $(PROJECT_ROOT) - @git submodule update --init --recursive - -# Build helper, e.g hello_world -.PHONY: build-cmake -build-cmake: UNIT_TEST ?= ON -build-cmake: TARGET_DIR ?= $(FHE_BUILD_DIR) -build-cmake: - @echo "Building project..." - @cmake -S . -B $(TARGET_DIR) -DUNIT_TEST=$(UNIT_TEST) - @cmake --build $(TARGET_DIR) - -# Install Dependencies and Build Project -.PHONY: build -build: trust-project build-cmake - -# Release helper -.PHONY: dist-cmake -dist-cmake: export UNIT_TEST ?= OFF -dist-cmake: export TARGET_DIR ?= $(FHE_RELEASE_DIR) -dist-cmake: - @make build-cmake - -.PHONY: dist -dist: dist-cmake - -.PHONY: dist-ci -dist-ci: OUTPUT_FILE ?= libfhel-$(OS)-$(ARCH).tar.gz -dist-ci: OUTPUT_PATH ?= $(FHE_RELEASE_DIR)/$(OUTPUT_FILE) -dist-ci: dist-cmake - @ls -d $(FHE_RELEASE_DIR)/libfhel* | grep -o '[^/]*$$' | tar -czvf $(OUTPUT_PATH) -C $(FHE_RELEASE_DIR) --files-from=- - @echo "tar_gz_name=$(OUTPUT_FILE)" >> $(GITHUB_OUTPUT) - @echo "tar_gz_path=$(OUTPUT_PATH)" >> $(GITHUB_OUTPUT) - -# Generate html dart api docs -.PHONY: docs -docs: - @cd $(DART_SRC); $(MAKE) docs - -# Publish dart package -.PHONY: publish -publish: - @cd $(DART_SRC); $(MAKE) publish - -# Test Abstract Layer (AFHEL) -.PHONY: ctest -ctest: - @echo "Testing cpp..." - @cd $(FHE_BUILD_DIR); ctest - -# Debug Abstract Layer (AFHEL) -.PHONY: ctest-debug -ctest-debug: build-cmake - @echo "Debugging cpp..." - @cd $(FHE_BUILD_DIR); ./seal_test - -# SEAL Basics using the Abstraction Layer -.PHONY: seal-basics -seal-basics: build-cmake - @echo "SEAL basics..." - @cd $(FHE_BUILD_DIR); ./seal_basics - -# Test Implementation Layer (FHE) -.PHONY: dtest -dtest: - @echo "Testing dart..." - @cd $(DART_SRC); $(MAKE) test FHEL_C_LIB_PREFIX=$(FHE_BUILD_DIR) - -# Build the flutter example -.PHONY: apk -apk: - @cd $(FLUTTER_EXAMPLE); flutter build apk - -# Automate testing for github workflows -.PHONY: ctest-ci -ctest-ci: build-cmake ctest - -.PHONY: dtest-ci -dtest-ci: build-cmake - @git config --global --add safe.directory /tmp/flutter - @cd $(DART_SRC); $(MAKE) deps - $(MAKE) dtest - -.PHONY: apk-ci -apk-ci: export ANDROID_SDK_ROOT ?= /tmp/android-sdk-linux -apk-ci: export FHEL_DISABLE_AUTO_BUILD = 1 -apk-ci: - @git config --global --add safe.directory /tmp/flutter - $(MAKE) apk - -# Publish dart package from github workflows -.PHONY: publish-ci -publish-ci: - @git config --global --add safe.directory /tmp/flutter - @cd $(DART_SRC); $(MAKE) publish-force + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named fhel + +# Build rule for target. +fhel: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 fhel +.PHONY : fhel + +# fast build rule for target. +fhel/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/fhel.dir/build.make CMakeFiles/fhel.dir/build +.PHONY : fhel/fast + +#============================================================================= +# Target rules for targets named seal + +# Build rule for target. +seal: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 seal +.PHONY : seal + +# fast build rule for target. +seal/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/CMakeFiles/seal.dir/build.make src/backend/seal/CMakeFiles/seal.dir/build +.PHONY : seal/fast + +#============================================================================= +# Target rules for targets named sealc + +# Build rule for target. +sealc: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 sealc +.PHONY : sealc + +# fast build rule for target. +sealc/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/CMakeFiles/sealc.dir/build.make src/backend/seal/CMakeFiles/sealc.dir/build +.PHONY : sealc/fast + +#============================================================================= +# Target rules for targets named zlib + +# Build rule for target. +zlib: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 zlib +.PHONY : zlib + +# fast build rule for target. +zlib/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zlib-build/CMakeFiles/zlib.dir/build.make src/backend/seal/thirdparty/zlib-build/CMakeFiles/zlib.dir/build +.PHONY : zlib/fast + +#============================================================================= +# Target rules for targets named zlibstatic + +# Build rule for target. +zlibstatic: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 zlibstatic +.PHONY : zlibstatic + +# fast build rule for target. +zlibstatic/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zlib-build/CMakeFiles/zlibstatic.dir/build.make src/backend/seal/thirdparty/zlib-build/CMakeFiles/zlibstatic.dir/build +.PHONY : zlibstatic/fast + +#============================================================================= +# Target rules for targets named example + +# Build rule for target. +example: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 example +.PHONY : example + +# fast build rule for target. +example/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zlib-build/CMakeFiles/example.dir/build.make src/backend/seal/thirdparty/zlib-build/CMakeFiles/example.dir/build +.PHONY : example/fast + +#============================================================================= +# Target rules for targets named minigzip + +# Build rule for target. +minigzip: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 minigzip +.PHONY : minigzip + +# fast build rule for target. +minigzip/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zlib-build/CMakeFiles/minigzip.dir/build.make src/backend/seal/thirdparty/zlib-build/CMakeFiles/minigzip.dir/build +.PHONY : minigzip/fast + +#============================================================================= +# Target rules for targets named example64 + +# Build rule for target. +example64: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 example64 +.PHONY : example64 + +# fast build rule for target. +example64/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zlib-build/CMakeFiles/example64.dir/build.make src/backend/seal/thirdparty/zlib-build/CMakeFiles/example64.dir/build +.PHONY : example64/fast + +#============================================================================= +# Target rules for targets named minigzip64 + +# Build rule for target. +minigzip64: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 minigzip64 +.PHONY : minigzip64 + +# fast build rule for target. +minigzip64/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zlib-build/CMakeFiles/minigzip64.dir/build.make src/backend/seal/thirdparty/zlib-build/CMakeFiles/minigzip64.dir/build +.PHONY : minigzip64/fast + +#============================================================================= +# Target rules for targets named clean-all + +# Build rule for target. +clean-all: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean-all +.PHONY : clean-all + +# fast build rule for target. +clean-all/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zstd-build/CMakeFiles/clean-all.dir/build.make src/backend/seal/thirdparty/zstd-build/CMakeFiles/clean-all.dir/build +.PHONY : clean-all/fast + +#============================================================================= +# Target rules for targets named libzstd_static + +# Build rule for target. +libzstd_static: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libzstd_static +.PHONY : libzstd_static + +# fast build rule for target. +libzstd_static/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zstd-build/lib/CMakeFiles/libzstd_static.dir/build.make src/backend/seal/thirdparty/zstd-build/lib/CMakeFiles/libzstd_static.dir/build +.PHONY : libzstd_static/fast + +#============================================================================= +# Target rules for targets named uninstall + +# Build rule for target. +uninstall: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 uninstall +.PHONY : uninstall + +# fast build rule for target. +uninstall/fast: + $(MAKE) $(MAKESILENT) -f src/backend/seal/thirdparty/zstd-build/lib/CMakeFiles/uninstall.dir/build.make src/backend/seal/thirdparty/zstd-build/lib/CMakeFiles/uninstall.dir/build +.PHONY : uninstall/fast + +src/backend/aseal.o: src/backend/aseal.cpp.o +.PHONY : src/backend/aseal.o + +# target to build an object file +src/backend/aseal.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/fhel.dir/build.make CMakeFiles/fhel.dir/src/backend/aseal.cpp.o +.PHONY : src/backend/aseal.cpp.o + +src/backend/aseal.i: src/backend/aseal.cpp.i +.PHONY : src/backend/aseal.i + +# target to preprocess a source file +src/backend/aseal.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/fhel.dir/build.make CMakeFiles/fhel.dir/src/backend/aseal.cpp.i +.PHONY : src/backend/aseal.cpp.i + +src/backend/aseal.s: src/backend/aseal.cpp.s +.PHONY : src/backend/aseal.s + +# target to generate assembly for a file +src/backend/aseal.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/fhel.dir/build.make CMakeFiles/fhel.dir/src/backend/aseal.cpp.s +.PHONY : src/backend/aseal.cpp.s + +src/fhe.o: src/fhe.cpp.o +.PHONY : src/fhe.o + +# target to build an object file +src/fhe.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/fhel.dir/build.make CMakeFiles/fhel.dir/src/fhe.cpp.o +.PHONY : src/fhe.cpp.o + +src/fhe.i: src/fhe.cpp.i +.PHONY : src/fhe.i + +# target to preprocess a source file +src/fhe.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/fhel.dir/build.make CMakeFiles/fhel.dir/src/fhe.cpp.i +.PHONY : src/fhe.cpp.i + +src/fhe.s: src/fhe.cpp.s +.PHONY : src/fhe.s + +# target to generate assembly for a file +src/fhe.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/fhel.dir/build.make CMakeFiles/fhel.dir/src/fhe.cpp.s +.PHONY : src/fhe.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... clean-all" + @echo "... uninstall" + @echo "... example" + @echo "... example64" + @echo "... fhel" + @echo "... libzstd_static" + @echo "... minigzip" + @echo "... minigzip64" + @echo "... seal" + @echo "... sealc" + @echo "... zlib" + @echo "... zlibstatic" + @echo "... src/backend/aseal.o" + @echo "... src/backend/aseal.i" + @echo "... src/backend/aseal.s" + @echo "... src/fhe.o" + @echo "... src/fhe.i" + @echo "... src/fhe.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/dart/CHANGELOG.md b/dart/CHANGELOG.md index 0c4b823..7fc5f53 100644 --- a/dart/CHANGELOG.md +++ b/dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.11 + +Conan Release Management + ## 0.0.8 Auto-build Android binary in github releases diff --git a/dart/binary.version b/dart/binary.version index d169b2f..2cfabea 100644 --- a/dart/binary.version +++ b/dart/binary.version @@ -1 +1 @@ -0.0.8 +0.0.11 diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml index b42e4c2..117c060 100644 --- a/dart/pubspec.yaml +++ b/dart/pubspec.yaml @@ -2,7 +2,7 @@ name: fhel description: |- Natively supports Fully Homomorphic Encryption operations on sensitive data without revealing it. Supports Key Derivation, Encryption, Decryption, and Mathematical operations. -version: 0.0.8 +version: 0.0.11 repository: https://github.com/jeffmur/fhel environment: diff --git a/pyproject.toml b/pyproject.toml index 88fff59..73f3b99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fhel" -version = "0.0.8" +version = "0.0.11" description = "Compiler for fhel releases" authors = ["Jeffrey Murray "] package-mode = false