From d2adb263d61645ff2b33e5f667dc86a1d3c49707 Mon Sep 17 00:00:00 2001 From: shaojian-ant <121606618+shaojian-ant@users.noreply.github.com> Date: Wed, 8 Jan 2025 20:23:12 +0800 Subject: [PATCH] repo-sync-2025-01-08T19:34:57+0800 (#162) * repo-sync-2025-01-08T19:34:57+0800 * Update repositories.bzl * Update README_cn.md * Update README.md --- .bazelignore | 3 + .bazelrc | 6 +- .bazelversion | 2 +- .gitignore | 1 + .licenserc.yaml | 49 +++---- BUILD.bazel | 21 +++ MODULE.bazel | 78 +++++++++++ README_cn.md | 1 + WORKSPACE | 109 --------------- bazel/BUILD.bazel | 13 ++ bazel/defs.bzl | 22 ++++ .../en/LC_MESSAGES/getting_started/faq.po | 1 + .../en/LC_MESSAGES/references/numpy_api.po | 1 + .../en/LC_MESSAGES/references/phe_api.po | 2 + .../LC_MESSAGES/references/upgrade_guide.po | 1 + heu/algorithms/incubator/mock_phe/BUILD.bazel | 4 +- heu/experimental/gemini-rlwe/BUILD.bazel | 8 +- heu/experimental/gpu-ckks/README.md | 2 +- heu/experimental/tfhe/src/BUILD.bazel | 2 +- .../tfhe/tests/cxxbind/BUILD.bazel | 5 +- heu/library/algorithms/dgk/BUILD.bazel | 4 +- heu/library/algorithms/dj/BUILD.bazel | 4 +- heu/library/algorithms/elgamal/BUILD.bazel | 8 +- heu/library/algorithms/mock/BUILD.bazel | 10 +- heu/library/algorithms/ou/BUILD.bazel | 8 +- .../paillier_clustar_fpga/BUILD.bazel | 4 +- .../paillier_operators/BUILD.bazel | 2 +- .../algorithms/paillier_float/BUILD.bazel | 4 +- .../algorithms/paillier_gpu/BUILD.bazel | 8 +- .../algorithms/paillier_ipcl/BUILD.bazel | 10 +- .../algorithms/paillier_zahlen/BUILD.bazel | 6 +- heu/library/benchmark/BUILD.bazel | 14 +- heu/library/benchmark/algos/BUILD.bazel | 4 +- heu/library/benchmark/tommath/BUILD.bazel | 4 +- heu/library/numpy/BUILD.bazel | 4 +- heu/library/numpy/test/BUILD.bazel | 2 +- heu/library/phe/base/BUILD.bazel | 2 +- heu/library/phe/encoding/BUILD.bazel | 6 +- heu/pylib/BUILD.bazel | 2 + heu/pylib/numpy_binding/BUILD.bazel | 2 +- heu/spi/auto_test/BUILD.bazel | 2 +- heu/spi/he/sketches/README.md | 1 + heu/spi/he/sketches/common/BUILD.bazel | 2 +- heu/spi/utils/BUILD.bazel | 6 +- requirements_lock.txt | 63 +++++++++ third_party/bazel_cpp/cereal.BUILD | 2 +- third_party/bazel_cpp/eigen.BUILD | 80 ----------- third_party/bazel_cpp/ipcl.BUILD | 10 +- third_party/bazel_cpp/ipp.BUILD | 7 +- third_party/bazel_cpp/repositories.bzl | 124 +----------------- third_party/bazel_cpp/seal.BUILD | 4 +- 51 files changed, 323 insertions(+), 417 deletions(-) create mode 100644 .bazelignore create mode 100644 BUILD.bazel create mode 100644 MODULE.bazel delete mode 100644 WORKSPACE create mode 100644 bazel/BUILD.bazel create mode 100644 bazel/defs.bzl create mode 100644 requirements_lock.txt delete mode 100644 third_party/bazel_cpp/eigen.BUILD diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 00000000..074a61a2 --- /dev/null +++ b/.bazelignore @@ -0,0 +1,3 @@ + +# TODO(FIXME): add it back +heu/experimental/tfhe/ \ No newline at end of file diff --git a/.bazelrc b/.bazelrc index 8691a948..02b47e44 100644 --- a/.bazelrc +++ b/.bazelrc @@ -15,6 +15,10 @@ common --experimental_repo_remote_exec common --experimental_cc_shared_library +common --registry=https://raw.githubusercontent.com/secretflow/bazel-registry/main +common --registry=https://bcr.bazel.build +common --registry=https://baidu.github.io/babylon/registry + build --verbose_failures build --incompatible_new_actions_api=false @@ -46,7 +50,7 @@ build:macos --host_copt=-Wa,--noexecstack # Bazel will automatic pick platform config since we have enable_platform_specific_config set build:macos --features=-supports_dynamic_linker build:macos --cxxopt -Wno-error=unused-const-variable -build:macos --cxxopt -Wno-error=sign-compare # for eigen 3.4 +build:macos --cxxopt -Wno-error=sign-compare # for eigen 3.4 build:macos --macos_minimum_os=12.0 # static link libstdc++ & libgcc diff --git a/.bazelversion b/.bazelversion index 4be2c727..6b0e58e7 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.5.0 \ No newline at end of file +7.4.1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0a37b927..079b0a9f 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ Cargo.lock # Bazel files bazel-* +MODULE.bazel.lock # Temp IDE files *.pdb diff --git a/.licenserc.yaml b/.licenserc.yaml index f0025d22..2c7d668b 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -2,7 +2,7 @@ header: # <1> license: spdx-id: Apache-2.0 # <2> copyright-owner: Ant Group Co., Ltd. # <3> - copyright-year: '2024' # <25> + copyright-year: "2024" # <25> software-name: secretflow # <4> pattern: | # <6> @@ -19,31 +19,32 @@ header: # <1> limitations under the License. paths: # <7> - - '**' + - "**" paths-ignore: # <8> - - '.circleci' - - '.github' - - '**/*.md' - - '**/*.yaml' - - '**/*.yml' - - '**/*.txt' - - '**/*.po' - - '**/*.rst' - - '**/*.lds' - - '**/*.patch' - - '**/*.bat' - - 'LICENSE' - - 'NOTICE' - - '.bazelversion' - - '.bazelignore' - - '.clang-format' - - '.gitattributes' - - '.gitignore' - - '.gitmodules' - - 'pyproject.toml' - - 'third_party/bazel_rust/**/*.bazel' # Generated - - 'third_party/bazel_rust/**/*.bzl' # Generated + - ".circleci" + - ".github" + - "**/*.md" + - "**/*.yaml" + - "**/*.yml" + - "**/*.txt" + - "**/*.po" + - "**/*.rst" + - "**/*.lds" + - "**/*.patch" + - "**/*.bat" + - "LICENSE" + - "NOTICE" + - ".bazelversion" + - ".bazelignore" + - ".clang-format" + - ".gitattributes" + - ".gitignore" + - ".gitmodules" + - "pyproject.toml" + - "MODULE.bazel.lock" + - "third_party/bazel_rust/**/*.bazel" # Generated + - "third_party/bazel_rust/**/*.bzl" # Generated comment: never # <9> diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 00000000..e576f77f --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,21 @@ +# Copyright 2024 Ant Group Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@rules_python//python:pip.bzl", "compile_pip_requirements") + +compile_pip_requirements( + name = "requirements", + src = "requirements.txt", + requirements_txt = "requirements_lock.txt", +) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 00000000..1d993c39 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,78 @@ +# Copyright 2024 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### + +module( + name = "heu", + version = "0.5.1", + compatibility_level = 1, +) + +bazel_dep(name = "yacl", version = "0.4.5b10-nightly-20241224") +bazel_dep(name = "seal", version = "3.6.6") +bazel_dep(name = "spdlog", version = "1.14.1") +bazel_dep(name = "fmt", version = "11.0.2") +bazel_dep(name = "msgpack-c", version = "6.1.0") +bazel_dep(name = "gflags", version = "2.2.2") +bazel_dep(name = "abseil-cpp", version = "20240722.0") +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "bazel_features", version = "1.20.0") +bazel_dep(name = "rules_python", version = "0.16.2") +bazel_dep(name = "pybind11_bazel", version = "2.13.6") +bazel_dep(name = "rules_cuda", version = "0.2.3") +bazel_dep(name = "cereal", version = "1.3.2") +bazel_dep(name = "platforms", version = "0.0.8") + +# self-hosted registry +bazel_dep(name = "pailliercryptolib", version = "2.0.0-20231102-fdc2135") +bazel_dep(name = "org_interconnection", version = "0.0.1") +bazel_dep(name = "eigen", version = "3.4.90-20230801-66e8f3") + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain( + ignore_root_user_error = True, + python_version = "3.10", +) + +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") +pip.parse( + extra_pip_args = [ + ], + hub_name = "pypi", + python_version = "3.10", + requirements_lock = "//:requirements_lock.txt", +) +use_repo(pip, "pypi") + +cuda = use_extension("@rules_cuda//cuda:extensions.bzl", "toolchain") +cuda.local_toolchain( + name = "local_cuda", + toolkit_path = "", +) +use_repo(cuda, "local_cuda") + +bazel_dep(name = "rules_rust", version = "0.53.0") + +# test +bazel_dep(name = "googletest", version = "1.15.2", dev_dependency = True) +bazel_dep(name = "google_benchmark", version = "1.8.5", dev_dependency = True) + +non_module_dependencies = use_extension("//bazel:defs.bzl", "non_module_dependencies") +use_repo(non_module_dependencies, "com_github_nvlabs_cgbn") diff --git a/README_cn.md b/README_cn.md index 6d81d002..519f7a9c 100644 --- a/README_cn.md +++ b/README_cn.md @@ -167,3 +167,4 @@ bazel test heu/... 隐语是一个非常包容和开放的社区,我们欢迎任何形式的贡献,如果您想要改进 HEU,请参考[贡献指南](CONTRIBUTING.md) + diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index fc3ce2b1..00000000 --- a/WORKSPACE +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 2024 Ant Group Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "com_alipay_sf_heu") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -#### fetch third-party deps #### - -load("//third_party/bazel_cpp:repositories.bzl", "heu_cpp_deps") - -heu_cpp_deps() - -load("@yacl//bazel:repositories.bzl", "yacl_deps") - -yacl_deps() - -#### for cpp #### - -load( - "@rules_foreign_cc//foreign_cc:repositories.bzl", - "rules_foreign_cc_dependencies", -) - -rules_foreign_cc_dependencies( - register_built_tools = False, - register_default_tools = False, - register_preinstalled_tools = True, -) - -load("@bazel_features//:deps.bzl", "bazel_features_deps") - -bazel_features_deps() - -#### for python #### - -load("@rules_python//python:repositories.bzl", "py_repositories") - -py_repositories() - -# Python binding. -http_archive( - name = "pybind11_bazel", - sha256 = "dc4882b23a617575d0fd822aba88aa4a14133c3d428b5a8fb83d81d03444a475", - strip_prefix = "pybind11_bazel-8889d39b2b925b2a47519ae09402a96f00ccf2b4", - urls = [ - "https://github.com/pybind/pybind11_bazel/archive/8889d39b2b925b2a47519ae09402a96f00ccf2b4.zip", - ], -) - -# We still require the pybind library. -http_archive( - name = "pybind11", - build_file = "@pybind11_bazel//:pybind11.BUILD", - sha256 = "bf8f242abd1abcd375d516a7067490fb71abd79519a282d22b6e4d19282185a7", - strip_prefix = "pybind11-2.12.0", - urls = [ - "https://github.com/pybind/pybind11/archive/refs/tags/v2.12.0.tar.gz", - ], -) - -load("@pybind11_bazel//:python_configure.bzl", "python_configure") - -python_configure(name = "local_config_python") - -#### for rust #### - -http_archive( - name = "rules_rust", - sha256 = "29fee78077bd8c6477bc895a47e6c759f92df0735ed60587e1da7b51f53d26eb", - strip_prefix = "rules_rust-23a4631cad819003642b1a148e458fe4ed2c54e1", - urls = [ - # Main branch as of 2021-12-07 - "https://github.com/bazelbuild/rules_rust/archive/23a4631cad819003642b1a148e458fe4ed2c54e1.tar.gz", - ], -) - -load("@rules_rust//rust:repositories.bzl", "rust_repositories") - -rust_repositories(version = "1.58.1") - -load("//third_party/bazel_rust/cargo:crates.bzl", "rust_fetch_remote_crates") - -rust_fetch_remote_crates() - -#### for cuda #### - -load("@rules_cuda//cuda:repositories.bzl", "register_detected_cuda_toolchains", "rules_cuda_dependencies") - -rules_cuda_dependencies() - -register_detected_cuda_toolchains() - -#### for other third-party libs #### - -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") - -protobuf_deps() diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel new file mode 100644 index 00000000..f4888ea3 --- /dev/null +++ b/bazel/BUILD.bazel @@ -0,0 +1,13 @@ +# Copyright 2024 Ant Group Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/bazel/defs.bzl b/bazel/defs.bzl new file mode 100644 index 00000000..c831e3c8 --- /dev/null +++ b/bazel/defs.bzl @@ -0,0 +1,22 @@ +# Copyright 2024 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//third_party/bazel_cpp:repositories.bzl", "heu_cpp_deps") + +def _non_module_dependencies_impl(_ctx): + heu_cpp_deps() + +non_module_dependencies = module_extension( + implementation = _non_module_dependencies_impl, +) diff --git a/docs/locale/en/LC_MESSAGES/getting_started/faq.po b/docs/locale/en/LC_MESSAGES/getting_started/faq.po index 0d3bc722..928901c9 100644 --- a/docs/locale/en/LC_MESSAGES/getting_started/faq.po +++ b/docs/locale/en/LC_MESSAGES/getting_started/faq.po @@ -269,3 +269,4 @@ msgstr "" " on `HEU + SPU for LR (i.e., HESS-LR) " "`__," " from which you can learn the usage of the HEU Device." + diff --git a/docs/locale/en/LC_MESSAGES/references/numpy_api.po b/docs/locale/en/LC_MESSAGES/references/numpy_api.po index 6760b3e3..90639642 100644 --- a/docs/locale/en/LC_MESSAGES/references/numpy_api.po +++ b/docs/locale/en/LC_MESSAGES/references/numpy_api.po @@ -855,3 +855,4 @@ msgid "" "Compute tree predict based on split features and points, the tree may be " "unbalanced." msgstr "" + diff --git a/docs/locale/en/LC_MESSAGES/references/phe_api.po b/docs/locale/en/LC_MESSAGES/references/phe_api.po index e3b5c234..20d14610 100644 --- a/docs/locale/en/LC_MESSAGES/references/phe_api.po +++ b/docs/locale/en/LC_MESSAGES/references/phe_api.po @@ -441,3 +441,5 @@ msgstr "" #: ../../docstring heu.phe.PyCapsule.setup:21 of msgid "Setup phe environment by an already generated public key" msgstr "" + + diff --git a/docs/locale/en/LC_MESSAGES/references/upgrade_guide.po b/docs/locale/en/LC_MESSAGES/references/upgrade_guide.po index 01870222..6714a010 100644 --- a/docs/locale/en/LC_MESSAGES/references/upgrade_guide.po +++ b/docs/locale/en/LC_MESSAGES/references/upgrade_guide.po @@ -130,3 +130,4 @@ msgstr "If you encounter a compilation error, please pass in the schema paramete "For example, if this line causes a compilation error: ``phe.BigintEncoder()``, " "you should change it to ``phe.BigintEncoder(kit.get_schema())``. For more details, refer to the previous section on **API Changes**." + diff --git a/heu/algorithms/incubator/mock_phe/BUILD.bazel b/heu/algorithms/incubator/mock_phe/BUILD.bazel index a65b41ad..53079f31 100644 --- a/heu/algorithms/incubator/mock_phe/BUILD.bazel +++ b/heu/algorithms/incubator/mock_phe/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library") package(default_visibility = ["//visibility:public"]) @@ -35,7 +35,7 @@ yacl_cc_library( hdrs = ["base.h"], deps = [ "//heu/spi/he/sketches/scalar/phe", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", "@yacl//yacl/utils:serializer", ], ) diff --git a/heu/experimental/gemini-rlwe/BUILD.bazel b/heu/experimental/gemini-rlwe/BUILD.bazel index 5a2704a1..9404b8d1 100644 --- a/heu/experimental/gemini-rlwe/BUILD.bazel +++ b/heu/experimental/gemini-rlwe/BUILD.bazel @@ -36,7 +36,7 @@ yacl_cc_library( ":lwe_util", ":modswitch", ":poly_encoder", - "@com_github_microsoft_seal//:seal", + "@seal", ], ) @@ -92,7 +92,7 @@ yacl_cc_library( ], deps = [ ":modswitch", - "@com_github_microsoft_seal//:seal", + "@seal", "@yacl//yacl/base:buffer", "@yacl//yacl/base:byte_container_view", ], @@ -103,7 +103,7 @@ yacl_cc_library( srcs = ["modswitch_helper.cc"], hdrs = ["modswitch_helper.h"], deps = [ - "@com_github_microsoft_seal//:seal", + "@seal", "@yacl//yacl/base:exception", "@yacl//yacl/base:int128", ], @@ -114,7 +114,7 @@ yacl_cc_test( srcs = ["modswitch_helper_test.cc"], deps = [ ":modswitch", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) diff --git a/heu/experimental/gpu-ckks/README.md b/heu/experimental/gpu-ckks/README.md index 5eecc7b2..5ee2b22f 100644 --- a/heu/experimental/gpu-ckks/README.md +++ b/heu/experimental/gpu-ckks/README.md @@ -107,4 +107,4 @@ sudo cmake --install build ## Flaws & TODOs * **The version is not completely end-to-end!** -* Some new functions will be finished. \ No newline at end of file +* Some new functions will be finished. diff --git a/heu/experimental/tfhe/src/BUILD.bazel b/heu/experimental/tfhe/src/BUILD.bazel index 7e43a9b5..9db267f9 100644 --- a/heu/experimental/tfhe/src/BUILD.bazel +++ b/heu/experimental/tfhe/src/BUILD.bazel @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_static_library") load("//third_party/bazel_rust/cargo:crates.bzl", "all_crate_deps") load("//third_party/bazel_rust/cargo:rust_cxx_bridge.bzl", "rust_cxx_bridge") -load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/heu/experimental/tfhe/tests/cxxbind/BUILD.bazel b/heu/experimental/tfhe/tests/cxxbind/BUILD.bazel index dc7c4a5a..74ab6f4c 100644 --- a/heu/experimental/tfhe/tests/cxxbind/BUILD.bazel +++ b/heu/experimental/tfhe/tests/cxxbind/BUILD.bazel @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") -load("//third_party/bazel_rust/cargo:crates.bzl", "all_crate_deps") - test_suite( name = "tfhe_cxxbind_tests", ) @@ -25,6 +22,6 @@ cc_test( srcs = ["basic.cc"], deps = [ "//heu/experimental/tfhe/src:cxx_torus", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) diff --git a/heu/library/algorithms/dgk/BUILD.bazel b/heu/library/algorithms/dgk/BUILD.bazel index 1eedec33..343ce494 100644 --- a/heu/library/algorithms/dgk/BUILD.bazel +++ b/heu/library/algorithms/dgk/BUILD.bazel @@ -37,7 +37,7 @@ yacl_cc_library( hdrs = ["secret_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -47,7 +47,7 @@ yacl_cc_library( hdrs = ["public_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) diff --git a/heu/library/algorithms/dj/BUILD.bazel b/heu/library/algorithms/dj/BUILD.bazel index d3862335..a38726cc 100644 --- a/heu/library/algorithms/dj/BUILD.bazel +++ b/heu/library/algorithms/dj/BUILD.bazel @@ -37,7 +37,7 @@ yacl_cc_library( hdrs = ["secret_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -47,7 +47,7 @@ yacl_cc_library( hdrs = ["public_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) diff --git a/heu/library/algorithms/elgamal/BUILD.bazel b/heu/library/algorithms/elgamal/BUILD.bazel index b2806b6e..07ee3e9d 100644 --- a/heu/library/algorithms/elgamal/BUILD.bazel +++ b/heu/library/algorithms/elgamal/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) @@ -39,7 +39,7 @@ yacl_cc_library( hdrs = ["secret_key.h"], deps = [ "//heu/library/algorithms/elgamal/utils:lookup_table", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -50,7 +50,7 @@ yacl_cc_library( deps = [ ":plaintext", "//heu/library/algorithms/elgamal/utils:lookup_table", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -69,7 +69,7 @@ yacl_cc_library( deps = [ ":public_key", "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", "@yacl//yacl/crypto/ecc", ], ) diff --git a/heu/library/algorithms/mock/BUILD.bazel b/heu/library/algorithms/mock/BUILD.bazel index c7b2fd5d..0a203d1e 100644 --- a/heu/library/algorithms/mock/BUILD.bazel +++ b/heu/library/algorithms/mock/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library") package(default_visibility = ["//visibility:public"]) @@ -38,7 +38,7 @@ yacl_cc_library( hdrs = ["plaintext.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -47,7 +47,7 @@ yacl_cc_library( hdrs = ["ciphertext.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -56,7 +56,7 @@ yacl_cc_library( hdrs = ["secret_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -66,7 +66,7 @@ yacl_cc_library( deps = [ ":plaintext", "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) diff --git a/heu/library/algorithms/ou/BUILD.bazel b/heu/library/algorithms/ou/BUILD.bazel index aa977a68..facdb70a 100644 --- a/heu/library/algorithms/ou/BUILD.bazel +++ b/heu/library/algorithms/ou/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) @@ -38,7 +38,7 @@ yacl_cc_library( hdrs = ["secret_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -48,7 +48,7 @@ yacl_cc_library( hdrs = ["public_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -57,7 +57,7 @@ yacl_cc_library( hdrs = ["ciphertext.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) diff --git a/heu/library/algorithms/paillier_clustar_fpga/BUILD.bazel b/heu/library/algorithms/paillier_clustar_fpga/BUILD.bazel index ede91334..4f90b0ef 100644 --- a/heu/library/algorithms/paillier_clustar_fpga/BUILD.bazel +++ b/heu/library/algorithms/paillier_clustar_fpga/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) @@ -70,7 +70,7 @@ yacl_cc_library( "//heu/library/algorithms/paillier_clustar_fpga/fpga_engine/paillier_operators:fpga_operators", "//heu/library/algorithms/util", "//heu/library/algorithms/util:mp_int", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", "@yacl//yacl/base:byte_container_view", ], ) diff --git a/heu/library/algorithms/paillier_clustar_fpga/fpga_engine/paillier_operators/BUILD.bazel b/heu/library/algorithms/paillier_clustar_fpga/fpga_engine/paillier_operators/BUILD.bazel index 08429020..94f4ffeb 100644 --- a/heu/library/algorithms/paillier_clustar_fpga/fpga_engine/paillier_operators/BUILD.bazel +++ b/heu/library/algorithms/paillier_clustar_fpga/fpga_engine/paillier_operators/BUILD.bazel @@ -33,7 +33,7 @@ yacl_cc_library( "//heu/library/algorithms/paillier_clustar_fpga/fpga_engine/driver:fpga_driver", "//heu/library/algorithms/util", "//heu/library/algorithms/util:mp_int", - "@com_github_fmtlib_fmt//:fmtlib", + "@fmt", "@yacl//yacl/base:byte_container_view", "@yacl//yacl/base:exception", ], diff --git a/heu/library/algorithms/paillier_float/BUILD.bazel b/heu/library/algorithms/paillier_float/BUILD.bazel index 21f891f1..71bfaf5c 100644 --- a/heu/library/algorithms/paillier_float/BUILD.bazel +++ b/heu/library/algorithms/paillier_float/BUILD.bazel @@ -40,8 +40,8 @@ yacl_cc_library( visibility = ["//visibility:public"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", - "@com_google_absl//absl/types:optional", + "@abseil-cpp//absl/types:optional", + "@msgpack-c//:msgpack", ], ) diff --git a/heu/library/algorithms/paillier_gpu/BUILD.bazel b/heu/library/algorithms/paillier_gpu/BUILD.bazel index c5e34bf3..29a6eca1 100644 --- a/heu/library/algorithms/paillier_gpu/BUILD.bazel +++ b/heu/library/algorithms/paillier_gpu/BUILD.bazel @@ -93,7 +93,7 @@ yacl_cc_library( ], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -107,7 +107,7 @@ yacl_cc_library( deps = [ ":plaintext", "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -121,7 +121,7 @@ yacl_cc_library( deps = [ ":plaintext", "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -136,7 +136,7 @@ yacl_cc_library( ":gpupaillier", ":plaintext", "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) diff --git a/heu/library/algorithms/paillier_ipcl/BUILD.bazel b/heu/library/algorithms/paillier_ipcl/BUILD.bazel index 611e45d9..66a3c854 100644 --- a/heu/library/algorithms/paillier_ipcl/BUILD.bazel +++ b/heu/library/algorithms/paillier_ipcl/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) @@ -56,10 +56,10 @@ yacl_cc_library( ], deps = [ "//heu/library/algorithms/util", - "@com_github_fmtlib_fmt//:fmtlib", - "@com_github_intel_ipcl//:ipcl", - "@com_github_msgpack_msgpack//:msgpack", - "@com_github_uscilab_cereal//:cereal", + "@cereal", + "@fmt", + "@msgpack-c//:msgpack", + "@pailliercryptolib//:ipcl", "@yacl//yacl/base:byte_container_view", "@yacl//yacl/base:int128", ], diff --git a/heu/library/algorithms/paillier_zahlen/BUILD.bazel b/heu/library/algorithms/paillier_zahlen/BUILD.bazel index 364fd98d..46a7d01b 100644 --- a/heu/library/algorithms/paillier_zahlen/BUILD.bazel +++ b/heu/library/algorithms/paillier_zahlen/BUILD.bazel @@ -37,7 +37,7 @@ yacl_cc_library( hdrs = ["secret_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -47,7 +47,7 @@ yacl_cc_library( hdrs = ["public_key.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) @@ -56,7 +56,7 @@ yacl_cc_library( hdrs = ["ciphertext.h"], deps = [ "//heu/library/algorithms/util", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) diff --git a/heu/library/benchmark/BUILD.bazel b/heu/library/benchmark/BUILD.bazel index c291c0ad..b236c784 100644 --- a/heu/library/benchmark/BUILD.bazel +++ b/heu/library/benchmark/BUILD.bazel @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library") +load("@yacl//bazel:yacl.bzl", "yacl_cc_binary") yacl_cc_binary( name = "phe", srcs = ["phe_bench.cc"], deps = [ "//heu/library/phe", - "@com_github_fmtlib_fmt//:fmtlib", - "@com_github_gflags_gflags//:gflags", - "@com_github_google_benchmark//:benchmark", + "@fmt", + "@gflags", + "@google_benchmark//:benchmark", ], ) @@ -30,8 +30,8 @@ yacl_cc_binary( srcs = ["np_bench.cc"], deps = [ "//heu/library/numpy", - "@com_github_fmtlib_fmt//:fmtlib", - "@com_github_gflags_gflags//:gflags", - "@com_github_google_benchmark//:benchmark", + "@fmt", + "@gflags", + "@google_benchmark//:benchmark", ], ) diff --git a/heu/library/benchmark/algos/BUILD.bazel b/heu/library/benchmark/algos/BUILD.bazel index a4441bef..d54db143 100644 --- a/heu/library/benchmark/algos/BUILD.bazel +++ b/heu/library/benchmark/algos/BUILD.bazel @@ -19,7 +19,7 @@ yacl_cc_binary( srcs = ["ou_bench.cc"], deps = [ "//heu/library/algorithms/ou", - "@com_github_google_benchmark//:benchmark_main", + "@google_benchmark//:benchmark_main", ], ) @@ -28,6 +28,6 @@ yacl_cc_binary( srcs = ["paillier_float_bench.cc"], deps = [ "//heu/library/algorithms/paillier_float", - "@com_github_google_benchmark//:benchmark_main", + "@google_benchmark//:benchmark_main", ], ) diff --git a/heu/library/benchmark/tommath/BUILD.bazel b/heu/library/benchmark/tommath/BUILD.bazel index 3d2aad81..f11025b6 100644 --- a/heu/library/benchmark/tommath/BUILD.bazel +++ b/heu/library/benchmark/tommath/BUILD.bazel @@ -21,7 +21,7 @@ yacl_cc_binary( deps = [ "//heu/library/algorithms/ou", "//heu/library/algorithms/util:mp_int", - "@com_github_google_benchmark//:benchmark", + "@google_benchmark//:benchmark", ], ) @@ -30,6 +30,6 @@ yacl_cc_binary( srcs = ["crt_bench.cc"], deps = [ "//heu/library/algorithms/paillier_zahlen", - "@com_github_google_benchmark//:benchmark", + "@google_benchmark//:benchmark", ], ) diff --git a/heu/library/numpy/BUILD.bazel b/heu/library/numpy/BUILD.bazel index b1c4c3eb..94a76112 100644 --- a/heu/library/numpy/BUILD.bazel +++ b/heu/library/numpy/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) @@ -44,7 +44,7 @@ yacl_cc_library( deps = [ ":ic_de_proto", "//heu/library/phe", - "@com_github_eigenteam_eigen//:eigen3", + "@eigen", "@yacl//yacl/utils:parallel", ], ) diff --git a/heu/library/numpy/test/BUILD.bazel b/heu/library/numpy/test/BUILD.bazel index e7308872..df3fbe30 100644 --- a/heu/library/numpy/test/BUILD.bazel +++ b/heu/library/numpy/test/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") yacl_cc_library( name = "test_tools", diff --git a/heu/library/phe/base/BUILD.bazel b/heu/library/phe/base/BUILD.bazel index b5ba4a68..12a5445e 100644 --- a/heu/library/phe/base/BUILD.bazel +++ b/heu/library/phe/base/BUILD.bazel @@ -57,7 +57,7 @@ yacl_cc_library( deps = [ ":schema", ":variant_helper", - "@com_github_msgpack_msgpack//:msgpack", + "@msgpack-c//:msgpack", ], ) diff --git a/heu/library/phe/encoding/BUILD.bazel b/heu/library/phe/encoding/BUILD.bazel index 601e9921..64dcb908 100644 --- a/heu/library/phe/encoding/BUILD.bazel +++ b/heu/library/phe/encoding/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) @@ -45,7 +45,7 @@ yacl_cc_test( srcs = ["plain_encoder_test.cc"], deps = [ ":plain_encoder", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) @@ -64,7 +64,7 @@ yacl_cc_test( srcs = ["batch_encoder_test.cc"], deps = [ ":batch_encoder", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) diff --git a/heu/pylib/BUILD.bazel b/heu/pylib/BUILD.bazel index fad36f5b..065bdbef 100644 --- a/heu/pylib/BUILD.bazel +++ b/heu/pylib/BUILD.bazel @@ -57,6 +57,7 @@ py_test( imports = ["."], deps = [ ":heu_modules", + "@pypi//numpy:pkg", ], ) @@ -66,5 +67,6 @@ py_test( imports = ["."], deps = [ ":heu_modules", + "@pypi//numpy:pkg", ], ) diff --git a/heu/pylib/numpy_binding/BUILD.bazel b/heu/pylib/numpy_binding/BUILD.bazel index 423b2429..7505ded7 100644 --- a/heu/pylib/numpy_binding/BUILD.bazel +++ b/heu/pylib/numpy_binding/BUILD.bazel @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") load("@pybind11_bazel//:build_defs.bzl", "pybind_extension", "pybind_library") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") package(default_visibility = ["//visibility:public"]) diff --git a/heu/spi/auto_test/BUILD.bazel b/heu/spi/auto_test/BUILD.bazel index bacb73f6..df7994a8 100644 --- a/heu/spi/auto_test/BUILD.bazel +++ b/heu/spi/auto_test/BUILD.bazel @@ -21,7 +21,7 @@ yacl_cc_library( deps = [ "//heu/spi", "//heu/spi/utils:formater", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) diff --git a/heu/spi/he/sketches/README.md b/heu/spi/he/sketches/README.md index e7de9c8e..418e71a9 100644 --- a/heu/spi/he/sketches/README.md +++ b/heu/spi/he/sketches/README.md @@ -58,3 +58,4 @@ Sketch 为 SPI 接口的预实现,实现不同 Lib 的公共部分逻辑,跟 | ScalarPhe | ./scalar/phe | 专为标量化的加法同态加密库实现的公共功能 | | Vector | ./vector | 将上层调用全部转换成向量调用 | | VectorPhe | ./vector/phe | 专为向量化的加法同态加密库实现的公共功能 | + diff --git a/heu/spi/he/sketches/common/BUILD.bazel b/heu/spi/he/sketches/common/BUILD.bazel index 48f49bd6..273159cb 100644 --- a/heu/spi/he/sketches/common/BUILD.bazel +++ b/heu/spi/he/sketches/common/BUILD.bazel @@ -49,7 +49,7 @@ yacl_cc_library( hdrs = ["keys.h"], deps = [ "//heu/spi/he", - "@com_github_fmtlib_fmt//:fmtlib", + "@fmt", ], ) diff --git a/heu/spi/utils/BUILD.bazel b/heu/spi/utils/BUILD.bazel index 744ba5d6..cc3e2b29 100644 --- a/heu/spi/utils/BUILD.bazel +++ b/heu/spi/utils/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") +load("@yacl//bazel:yacl.bzl", "yacl_cc_library") package(default_visibility = ["//visibility:public"]) @@ -25,7 +25,7 @@ yacl_cc_library( name = "formater", hdrs = ["formater.h"], deps = [ - "@com_github_fmtlib_fmt//:fmtlib", - "@com_google_absl//absl/types:span", + "@abseil-cpp//absl/types:span", + "@fmt", ], ) diff --git a/requirements_lock.txt b/requirements_lock.txt new file mode 100644 index 00000000..d734b91c --- /dev/null +++ b/requirements_lock.txt @@ -0,0 +1,63 @@ +# +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: +# +# bazel run //:requirements.update +# +numpy==2.1.3 \ + --hash=sha256:016d0f6f5e77b0f0d45d77387ffa4bb89816b57c835580c3ce8e099ef830befe \ + --hash=sha256:02135ade8b8a84011cbb67dc44e07c58f28575cf9ecf8ab304e51c05528c19f0 \ + --hash=sha256:08788d27a5fd867a663f6fc753fd7c3ad7e92747efc73c53bca2f19f8bc06f48 \ + --hash=sha256:0d30c543f02e84e92c4b1f415b7c6b5326cbe45ee7882b6b77db7195fb971e3a \ + --hash=sha256:0fa14563cc46422e99daef53d725d0c326e99e468a9320a240affffe87852564 \ + --hash=sha256:13138eadd4f4da03074851a698ffa7e405f41a0845a6b1ad135b81596e4e9958 \ + --hash=sha256:14e253bd43fc6b37af4921b10f6add6925878a42a0c5fe83daee390bca80bc17 \ + --hash=sha256:15cb89f39fa6d0bdfb600ea24b250e5f1a3df23f901f51c8debaa6a5d122b2f0 \ + --hash=sha256:17ee83a1f4fef3c94d16dc1802b998668b5419362c8a4f4e8a491de1b41cc3ee \ + --hash=sha256:2312b2aa89e1f43ecea6da6ea9a810d06aae08321609d8dc0d0eda6d946a541b \ + --hash=sha256:2564fbdf2b99b3f815f2107c1bbc93e2de8ee655a69c261363a1172a79a257d4 \ + --hash=sha256:3522b0dfe983a575e6a9ab3a4a4dfe156c3e428468ff08ce582b9bb6bd1d71d4 \ + --hash=sha256:4394bc0dbd074b7f9b52024832d16e019decebf86caf909d94f6b3f77a8ee3b6 \ + --hash=sha256:45966d859916ad02b779706bb43b954281db43e185015df6eb3323120188f9e4 \ + --hash=sha256:4d1167c53b93f1f5d8a139a742b3c6f4d429b54e74e6b57d0eff40045187b15d \ + --hash=sha256:4f2015dfe437dfebbfce7c85c7b53d81ba49e71ba7eadbf1df40c915af75979f \ + --hash=sha256:50ca6aba6e163363f132b5c101ba078b8cbd3fa92c7865fd7d4d62d9779ac29f \ + --hash=sha256:50d18c4358a0a8a53f12a8ba9d772ab2d460321e6a93d6064fc22443d189853f \ + --hash=sha256:5641516794ca9e5f8a4d17bb45446998c6554704d888f86df9b200e66bdcce56 \ + --hash=sha256:576a1c1d25e9e02ed7fa5477f30a127fe56debd53b8d2c89d5578f9857d03ca9 \ + --hash=sha256:6a4825252fcc430a182ac4dee5a505053d262c807f8a924603d411f6718b88fd \ + --hash=sha256:72dcc4a35a8515d83e76b58fdf8113a5c969ccd505c8a946759b24e3182d1f23 \ + --hash=sha256:747641635d3d44bcb380d950679462fae44f54b131be347d5ec2bce47d3df9ed \ + --hash=sha256:762479be47a4863e261a840e8e01608d124ee1361e48b96916f38b119cfda04a \ + --hash=sha256:78574ac2d1a4a02421f25da9559850d59457bac82f2b8d7a44fe83a64f770098 \ + --hash=sha256:825656d0743699c529c5943554d223c021ff0494ff1442152ce887ef4f7561a1 \ + --hash=sha256:8637dcd2caa676e475503d1f8fdb327bc495554e10838019651b76d17b98e512 \ + --hash=sha256:96fe52fcdb9345b7cd82ecd34547fca4321f7656d500eca497eb7ea5a926692f \ + --hash=sha256:973faafebaae4c0aaa1a1ca1ce02434554d67e628b8d805e61f874b84e136b09 \ + --hash=sha256:996bb9399059c5b82f76b53ff8bb686069c05acc94656bb259b1d63d04a9506f \ + --hash=sha256:a38c19106902bb19351b83802531fea19dee18e5b37b36454f27f11ff956f7fc \ + --hash=sha256:a6b46587b14b888e95e4a24d7b13ae91fa22386c199ee7b418f449032b2fa3b8 \ + --hash=sha256:a9f7f672a3388133335589cfca93ed468509cb7b93ba3105fce780d04a6576a0 \ + --hash=sha256:aa08e04e08aaf974d4458def539dece0d28146d866a39da5639596f4921fd761 \ + --hash=sha256:b0df3635b9c8ef48bd3be5f862cf71b0a4716fa0e702155c45067c6b711ddcef \ + --hash=sha256:b47fbb433d3260adcd51eb54f92a2ffbc90a4595f8970ee00e064c644ac788f5 \ + --hash=sha256:baed7e8d7481bfe0874b566850cb0b85243e982388b7b23348c6db2ee2b2ae8e \ + --hash=sha256:bc6f24b3d1ecc1eebfbf5d6051faa49af40b03be1aaa781ebdadcbc090b4539b \ + --hash=sha256:c006b607a865b07cd981ccb218a04fc86b600411d83d6fc261357f1c0966755d \ + --hash=sha256:c181ba05ce8299c7aa3125c27b9c2167bca4a4445b7ce73d5febc411ca692e43 \ + --hash=sha256:c7662f0e3673fe4e832fe07b65c50342ea27d989f92c80355658c7f888fcc83c \ + --hash=sha256:c80e4a09b3d95b4e1cac08643f1152fa71a0a821a2d4277334c88d54b2219a41 \ + --hash=sha256:c894b4305373b9c5576d7a12b473702afdf48ce5369c074ba304cc5ad8730dff \ + --hash=sha256:d7aac50327da5d208db2eec22eb11e491e3fe13d22653dce51b0f4109101b408 \ + --hash=sha256:d89dd2b6da69c4fff5e39c28a382199ddedc3a5be5390115608345dec660b9e2 \ + --hash=sha256:d9beb777a78c331580705326d2367488d5bc473b49a9bc3036c154832520aca9 \ + --hash=sha256:dc258a761a16daa791081d026f0ed4399b582712e6fc887a95af09df10c5ca57 \ + --hash=sha256:e14e26956e6f1696070788252dcdff11b4aca4c3e8bd166e0df1bb8f315a67cb \ + --hash=sha256:e6988e90fcf617da2b5c78902fe8e668361b43b4fe26dbf2d7b0f8034d4cafb9 \ + --hash=sha256:e711e02f49e176a01d0349d82cb5f05ba4db7d5e7e0defd026328e5cfb3226d3 \ + --hash=sha256:ea4dedd6e394a9c180b33c2c872b92f7ce0f8e7ad93e9585312b0c5a04777a4a \ + --hash=sha256:ecc76a9ba2911d8d37ac01de72834d8849e55473457558e12995f4cd53e778e0 \ + --hash=sha256:f55ba01150f52b1027829b50d70ef1dafd9821ea82905b63936668403c3b471e \ + --hash=sha256:f653490b33e9c3a4c1c01d41bc2aef08f9475af51146e4a7710c450cf9761598 \ + --hash=sha256:fa2d1337dc61c8dc417fbccf20f6d1e139896a30721b7f1e832b2bb6ef4eb6c4 + # via -r requirements.txt diff --git a/third_party/bazel_cpp/cereal.BUILD b/third_party/bazel_cpp/cereal.BUILD index e7d70e23..6005e424 100644 --- a/third_party/bazel_cpp/cereal.BUILD +++ b/third_party/bazel_cpp/cereal.BUILD @@ -29,6 +29,6 @@ cmake( "BUILD_SANDBOX": "OFF", "SKIP_PERFORMANCE_COMPARISON": "ON", }, - lib_source = "@com_github_uscilab_cereal//:all", + lib_source = ":all", out_headers_only = True, ) diff --git a/third_party/bazel_cpp/eigen.BUILD b/third_party/bazel_cpp/eigen.BUILD deleted file mode 100644 index d8ce4f91..00000000 --- a/third_party/bazel_cpp/eigen.BUILD +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 2024 Ant Group Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# copy from tf: -# https://raw.githubusercontent.com/tensorflow/tensorflow/master/third_party/eigen.BUILD -# -# Description: -# Eigen is a C++ template library for linear algebra: vectors, -# matrices, and related algorithms. - -load("@rules_cc//cc:defs.bzl", "cc_library") - -licenses([ - # Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code. - # We've taken special care to not reference any restricted code. - "reciprocal", # MPL2 - "notice", # Portions BSD -]) - -exports_files(["COPYING.MPL2"]) - -EIGEN_FILES = [ - "Eigen/**", - "unsupported/Eigen/CXX11/**", - "unsupported/Eigen/FFT", - "unsupported/Eigen/KroneckerProduct", - "unsupported/Eigen/src/FFT/**", - "unsupported/Eigen/src/KroneckerProduct/**", - "unsupported/Eigen/MatrixFunctions", - "unsupported/Eigen/SpecialFunctions", - "unsupported/Eigen/src/MatrixFunctions/**", - "unsupported/Eigen/src/SpecialFunctions/**", -] - -# Files known to be under MPL2 license. -EIGEN_MPL2_HEADER_FILES = glob( - EIGEN_FILES, - exclude = [ - # Guarantees that any non-MPL2 file added to the list above will fail to - # compile. - "Eigen/src/Core/util/NonMPL2.h", - "Eigen/**/CMakeLists.txt", - ], -) - -cc_library( - name = "eigen3", - hdrs = EIGEN_MPL2_HEADER_FILES, - # If your program crashes, you can try to add this flag globally - copts = select({ - "@platforms//cpu:x86_64": [ - "-mavx", - ], - "//conditions:default": [], - }), - defines = [ - # This define (mostly) guarantees we don't link any problematic - # code. We use it, but we do not rely on it, as evidenced above. - "EIGEN_MPL2_ONLY", - ], - includes = ["."], - visibility = ["//visibility:public"], -) - -filegroup( - name = "eigen_header_files", - srcs = EIGEN_MPL2_HEADER_FILES, - visibility = ["//visibility:public"], -) diff --git a/third_party/bazel_cpp/ipcl.BUILD b/third_party/bazel_cpp/ipcl.BUILD index 234e8276..70bd7828 100644 --- a/third_party/bazel_cpp/ipcl.BUILD +++ b/third_party/bazel_cpp/ipcl.BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake", "configure_make") +load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") package(default_visibility = ["//visibility:public"]) @@ -37,12 +37,14 @@ cmake( "OPENSSL_ROOT_DIR": "$EXT_BUILD_DEPS/openssl", "CMAKE_BUILD_TYPE": "Release", }, + generate_args = ["-G Ninja"], lib_source = "@com_github_intel_ipcl//:all", linkopts = ["-ldl"], out_static_libs = ["libipcl.a"], deps = [ - "@com_github_intel_ipp//:ipp", - "@com_github_openssl_openssl//:openssl", - "@com_github_uscilab_cereal//:cereal", + "@cereal", + "@ippcp//:ipp", + "@openssl//:crypto", + "@openssl//:ssl", ], ) diff --git a/third_party/bazel_cpp/ipp.BUILD b/third_party/bazel_cpp/ipp.BUILD index 56e308fd..c9d43ab9 100644 --- a/third_party/bazel_cpp/ipp.BUILD +++ b/third_party/bazel_cpp/ipp.BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@yacl//bazel:yacl.bzl", "yacl_cmake_external") +load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") package(default_visibility = ["//visibility:public"]) @@ -21,7 +21,7 @@ filegroup( srcs = glob(["**"]), ) -yacl_cmake_external( +cmake( name = "ipp", cache_entries = { "ARCH": "intel64", @@ -30,12 +30,13 @@ yacl_cmake_external( "OPENSSL_ROOT_DIR": "$EXT_BUILD_DEPS/openssl", "CMAKE_BUILD_TYPE": "Release", }, + generate_args = ["-G Ninja"], lib_source = ":all_srcs", out_static_libs = [ "intel64/libippcp.a", "intel64/libcrypto_mb.a", ], deps = [ - "@com_github_openssl_openssl//:openssl", + "@openssl//:crypto", ], ) diff --git a/third_party/bazel_cpp/repositories.bzl b/third_party/bazel_cpp/repositories.bzl index 0776bac4..08109c73 100644 --- a/third_party/bazel_cpp/repositories.bzl +++ b/third_party/bazel_cpp/repositories.bzl @@ -16,140 +16,20 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def heu_cpp_deps(): - _bazel_skylib() - _com_github_eigenteam_eigen() - _com_github_microsoft_seal() - _com_github_intel_ipcl() - _com_github_uscilab_cereal() _com_github_nvlabs_cgbn() - _com_github_intel_ipp() - _yacl() - _rules_cuda() - -def _bazel_skylib(): - maybe( - http_archive, - name = "bazel_skylib", - sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz", - ], - ) - -def _com_github_eigenteam_eigen(): - EIGEN_COMMIT = "66e8f38891841bf88ee976a316c0c78a52f0cee5" - EIGEN_SHA256 = "01fcd68409c038bbcfd16394274c2bf71e2bb6dda89a2319e23fc59a2da17210" - maybe( - http_archive, - name = "com_github_eigenteam_eigen", - sha256 = EIGEN_SHA256, - build_file = "@com_alipay_sf_heu//third_party/bazel_cpp:eigen.BUILD", - strip_prefix = "eigen-{commit}".format(commit = EIGEN_COMMIT), - urls = [ - "https://gitlab.com/libeigen/eigen/-/archive/{commit}/eigen-{commit}.tar.gz".format( - commit = EIGEN_COMMIT, - ), - ], - ) - -def _com_github_microsoft_seal(): - maybe( - http_archive, - name = "com_github_microsoft_seal", - sha256 = "85a63188a5ccc8d61b0adbb92e84af9b7223fc494d33260fa17a121433790a0e", - strip_prefix = "SEAL-3.6.6", - type = "tar.gz", - patch_args = ["-p1"], - patches = [ - "@com_alipay_sf_heu//third_party/bazel_cpp:patches/seal.patch", - "@com_alipay_sf_heu//third_party/bazel_cpp:patches/seal-evaluator.patch", - ], - urls = [ - "https://github.com/microsoft/SEAL/archive/refs/tags/v3.6.6.tar.gz", - ], - build_file = "@com_alipay_sf_heu//third_party/bazel_cpp:seal.BUILD", - ) - -def _com_github_intel_ipcl(): - maybe( - http_archive, - name = "com_github_intel_ipcl", - patch_args = ["-p1"], - sha256 = "1a6ecb6cb830e45e501eace9b499ce776ab97aa6fddaeeb5b22dc3c340446467", - patches = [ - "@com_alipay_sf_heu//third_party/bazel_cpp:patches/ipcl.patch", - ], - strip_prefix = "pailliercryptolib-fdc21350302117103452968ababc2f9676f0d383", - build_file = "@com_alipay_sf_heu//third_party/bazel_cpp:ipcl.BUILD", - urls = [ - "https://github.com/intel/pailliercryptolib/archive/fdc21350302117103452968ababc2f9676f0d383.tar.gz", - ], - ) - -def _com_github_uscilab_cereal(): - maybe( - http_archive, - name = "com_github_uscilab_cereal", - sha256 = "ce52ae6abcdbda5fecd63abbaa7ab57e54b814b24d7cb6f5096f5753d1975d24", - build_file = "@com_alipay_sf_heu//third_party/bazel_cpp:cereal.BUILD", - strip_prefix = "cereal-ebef1e929807629befafbb2918ea1a08c7194554", - urls = [ - "https://github.com/USCiLab/cereal/archive/ebef1e929807629befafbb2918ea1a08c7194554.tar.gz", - ], - ) def _com_github_nvlabs_cgbn(): maybe( http_archive, name = "com_github_nvlabs_cgbn", sha256 = "1e8e4cdd0d36b1fb54c2f6adca2eb4b5846a6578dbb6e68b37858c42af0ce4f0", - build_file = "@com_alipay_sf_heu//third_party/bazel_cpp:cgbn.BUILD", + build_file = "//third_party/bazel_cpp:cgbn.BUILD", strip_prefix = "CGBN-e8b9d265c7b84077d02340b0986f3c91b2eb02fb", patch_args = ["-p1"], patches = [ - "@com_alipay_sf_heu//third_party/bazel_cpp:patches/cgbn.patch", + "//third_party/bazel_cpp:patches/cgbn.patch", ], urls = [ "https://github.com/NVlabs/CGBN/archive/e8b9d265c7b84077d02340b0986f3c91b2eb02fb.tar.gz", ], ) - -def _com_github_intel_ipp(): - maybe( - http_archive, - name = "com_github_intel_ipp", - sha256 = "d70f42832337775edb022ca8ac1ac418f272e791ec147778ef7942aede414cdc", - strip_prefix = "cryptography-primitives-ippcp_2021.8", - build_file = "@com_alipay_sf_heu//third_party/bazel_cpp:ipp.BUILD", - patch_args = ["-p1"], - patches = [ - "@com_alipay_sf_heu//third_party/bazel_cpp:patches/ippcp.patch", - ], - urls = [ - "https://github.com/intel/ipp-crypto/archive/refs/tags/ippcp_2021.8.tar.gz", - ], - ) - -def _yacl(): - maybe( - http_archive, - name = "yacl", - urls = [ - "https://github.com/secretflow/yacl/archive/refs/tags/0.4.5b8_nightly_20241014.tar.gz", - ], - strip_prefix = "yacl-0.4.5b8_nightly_20241014", - sha256 = "9141792f07eba507ffd21c57ec3df2ad5fdf90ce605ffb7bc1b7b4e84a9c34fa", - ) - -def _rules_cuda(): - maybe( - http_archive, - name = "rules_cuda", - sha256 = "f62baee0150ac91f4cdfcb10df2be0d0e9b941d1d32c8cddf00b16b57bdb1540", - strip_prefix = "rules_cuda-17ca7f8c04cf746aa4c0a0c3722799278df7ca93", - urls = [ - # Main branch as of 2023-1-07 - "https://github.com/bazel-contrib/rules_cuda/archive/17ca7f8c04cf746aa4c0a0c3722799278df7ca93.tar.gz", - ], - ) diff --git a/third_party/bazel_cpp/seal.BUILD b/third_party/bazel_cpp/seal.BUILD index 3d9ea549..f93a2c5a 100644 --- a/third_party/bazel_cpp/seal.BUILD +++ b/third_party/bazel_cpp/seal.BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake", "configure_make") +load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") package(default_visibility = ["//visibility:public"]) @@ -31,7 +31,7 @@ cmake( "SEAL_THROW_ON_TRANSPARENT_CIPHERTEXT": "OFF", "CMAKE_INSTALL_LIBDIR": "lib", }, - lib_source = "@com_github_microsoft_seal//:all", + lib_source = "@seal//:all", out_include_dir = "include/SEAL-3.6", out_static_libs = ["libseal-3.6.a"], deps = ["@zlib"],