From 95cfcd10d13e365e0c3f111c25cf9d61c15acce9 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Fri, 27 Sep 2024 12:02:44 +0200 Subject: [PATCH] [CMS] Changes to build TF cms externals --- tensorflow/api_template.__init__.py | 4 - tensorflow/core/kernels/conv_ops.h | 4 +- tensorflow/core/kernels/ctc_decoder_ops.cc | 2 +- tensorflow/core/kernels/ctc_loss_op.cc | 2 +- tensorflow/core/kernels/matmul_op_impl.h | 5 + .../kernels/quantized_resize_bilinear_op.cc | 2 +- tensorflow/lite/python/convert.py | 4 +- tensorflow/tools/pip_package/BUILD | 1 + tensorflow/workspace0.bzl | 6 +- tensorflow/workspace1.bzl | 2 - tensorflow/workspace2.bzl | 125 +---------- third_party/absl/absl_neon.patch | 13 ++ third_party/absl/workspace.bzl | 1 + third_party/cms/BUILD | 0 third_party/cms/numpy.BUILD | 16 ++ third_party/cms/pypi.BUILD | 4 + third_party/cms/repo.bzl | 44 ++++ third_party/cms/workspace.bzl | 205 ++++++++++++++++++ third_party/cpuinfo-ppc64le.patch | 33 +++ third_party/flatbuffers/BUILD.system | 9 +- third_party/googleapis/build_rules.bzl | 2 +- third_party/hwloc/BUILD.system | 3 +- third_party/jpeg/BUILD.system | 3 +- third_party/llvm/mlircpp20.patch | 13 ++ third_party/llvm/workspace.bzl | 1 + .../systemlibs/backports_weakref.BUILD | 9 + third_party/systemlibs/curl.BUILD | 3 +- third_party/systemlibs/eigen.BUILD | 53 +++++ third_party/systemlibs/gif.BUILD | 3 +- third_party/systemlibs/grpc.BUILD | 10 + .../systemlibs/grpc.bazel.cc_grpc_library.bzl | 2 +- third_party/systemlibs/png.BUILD | 3 +- third_party/systemlibs/protobuf.BUILD | 36 ++- third_party/systemlibs/pybind11.BUILD | 7 + third_party/systemlibs/sqlite.BUILD | 3 +- third_party/systemlibs/syslibs_configure.bzl | 2 + third_party/systemlibs/zlib.BUILD | 4 +- 37 files changed, 484 insertions(+), 155 deletions(-) create mode 100644 third_party/absl/absl_neon.patch create mode 100644 third_party/cms/BUILD create mode 100644 third_party/cms/numpy.BUILD create mode 100644 third_party/cms/pypi.BUILD create mode 100644 third_party/cms/repo.bzl create mode 100644 third_party/cms/workspace.bzl create mode 100644 third_party/cpuinfo-ppc64le.patch create mode 100644 third_party/llvm/mlircpp20.patch create mode 100644 third_party/systemlibs/backports_weakref.BUILD create mode 100644 third_party/systemlibs/eigen.BUILD diff --git a/tensorflow/api_template.__init__.py b/tensorflow/api_template.__init__.py index 5ea9ef248d55e2..b8f4e99016a6e6 100644 --- a/tensorflow/api_template.__init__.py +++ b/tensorflow/api_template.__init__.py @@ -27,7 +27,6 @@ """ # pylint: disable=g-bad-import-order,protected-access,g-import-not-at-top -import distutils as _distutils import importlib import inspect as _inspect import os as _os @@ -100,9 +99,6 @@ if "getsitepackages" in dir(_site): _site_packages_dirs += _site.getsitepackages() -if "sysconfig" in dir(_distutils): - _site_packages_dirs += [_distutils.sysconfig.get_python_lib()] - _site_packages_dirs = list(set(_site_packages_dirs)) # Find the location of this exact file. diff --git a/tensorflow/core/kernels/conv_ops.h b/tensorflow/core/kernels/conv_ops.h index aaa49642279674..2e12c038ec5b63 100644 --- a/tensorflow/core/kernels/conv_ops.h +++ b/tensorflow/core/kernels/conv_ops.h @@ -77,10 +77,10 @@ struct LaunchConvOp { // It uses malloc and free to avoid the time cost of initializing the memory. template struct Im2ColBufferResource : public ResourceBase { - Im2ColBufferResource() { + Im2ColBufferResource() { data = static_cast(port::Malloc(size * sizeof(T))); } - ~Im2ColBufferResource() { port::Free(data); } + ~Im2ColBufferResource() { port::Free(data); } // This mutex ensures that only a single operation at a time is able to use // the buffer memory held by this resource. mutex mu; diff --git a/tensorflow/core/kernels/ctc_decoder_ops.cc b/tensorflow/core/kernels/ctc_decoder_ops.cc index 2480bc435bd01c..8b400953ee184f 100644 --- a/tensorflow/core/kernels/ctc_decoder_ops.cc +++ b/tensorflow/core/kernels/ctc_decoder_ops.cc @@ -372,7 +372,7 @@ class CTCBeamSearchDecoderOp : public OpKernel { typename ctc::CTCBeamSearchDecoder::DefaultBeamScorer beam_scorer_; bool merge_repeated_; int beam_width_; - CTCBeamSearchDecoderOp(const CTCBeamSearchDecoderOp&) = delete; + CTCBeamSearchDecoderOp(const CTCBeamSearchDecoderOp&) = delete; void operator=(const CTCBeamSearchDecoderOp&) = delete; }; diff --git a/tensorflow/core/kernels/ctc_loss_op.cc b/tensorflow/core/kernels/ctc_loss_op.cc index dfe9de54c91535..6d382987fbc611 100644 --- a/tensorflow/core/kernels/ctc_loss_op.cc +++ b/tensorflow/core/kernels/ctc_loss_op.cc @@ -221,7 +221,7 @@ class CTCLossOp : public OpKernel { bool ctc_merge_repeated_; bool ignore_longer_outputs_than_inputs_; - CTCLossOp(const CTCLossOp&) = delete; + CTCLossOp(const CTCLossOp&) = delete; void operator=(const CTCLossOp&) = delete; }; diff --git a/tensorflow/core/kernels/matmul_op_impl.h b/tensorflow/core/kernels/matmul_op_impl.h index 9c5fe075d97ff5..e520285ed9bc7c 100644 --- a/tensorflow/core/kernels/matmul_op_impl.h +++ b/tensorflow/core/kernels/matmul_op_impl.h @@ -97,6 +97,7 @@ struct ParallelMatMulKernel { z.device(d) = z.conjugate(); } + __attribute__((used)) static void Run(const OpKernelContext* context, const Tensor& in_x, const Tensor& in_y, bool adj_x, bool adj_y, bool trans_x, bool trans_y, const MatMulBCast& bcast, Tensor* out, @@ -142,6 +143,7 @@ template struct ParallelMatMulKernel { static void Conjugate(const OpKernelContext* context, Tensor* out) {} + __attribute__((used)) static void Run(const OpKernelContext* context, const Tensor& in_x, const Tensor& in_y, bool adj_x, bool adj_y, bool trans_x, bool trans_y, const MatMulBCast& bcast, Tensor* out, @@ -213,6 +215,7 @@ struct SequentialMatMulKernel { t->dim_size(1), t->dim_size(2)); } + __attribute__((used)) static void Run(const Tensor& in_x, const Tensor& in_y, bool adj_x, bool adj_y, bool trans_x, bool trans_y, const MatMulBCast& bcast, Tensor* out, int start, int limit) { @@ -274,6 +277,8 @@ struct SingleBatchParallelMatMulKernel { return MatrixMap(t->flat().data(), t->dim_size(1), t->dim_size(2)); } + + __attribute__((used)) static void Run(const CPUDevice& device, const Tensor& in_x, const Tensor& in_y, bool adj_x, bool adj_y, bool trans_x, bool trans_y, Tensor* out) { diff --git a/tensorflow/core/kernels/quantized_resize_bilinear_op.cc b/tensorflow/core/kernels/quantized_resize_bilinear_op.cc index 2efdd38dc6ef45..2c256650d5af66 100644 --- a/tensorflow/core/kernels/quantized_resize_bilinear_op.cc +++ b/tensorflow/core/kernels/quantized_resize_bilinear_op.cc @@ -738,7 +738,7 @@ class QuantizedResizeBilinearOp : public OpKernel { bool align_corners_; bool half_pixel_centers_; - QuantizedResizeBilinearOp(const QuantizedResizeBilinearOp&) = delete; + QuantizedResizeBilinearOp(const QuantizedResizeBilinearOp&) = delete; void operator=(const QuantizedResizeBilinearOp&) = delete; }; diff --git a/tensorflow/lite/python/convert.py b/tensorflow/lite/python/convert.py index 26057563feaf27..94c394ca25f142 100644 --- a/tensorflow/lite/python/convert.py +++ b/tensorflow/lite/python/convert.py @@ -14,7 +14,6 @@ # ============================================================================== """Converts a frozen graph into a TFLite FlatBuffer.""" -import distutils.spawn import enum import hashlib import os as _os @@ -23,6 +22,7 @@ import tempfile as _tempfile from typing import Optional import warnings +import shutil from tensorflow.compiler.mlir.lite.python import wrap_converter from tensorflow.compiler.mlir.quantization.stablehlo import quantization_config_pb2 @@ -408,7 +408,7 @@ def _run_deprecated_conversion_binary( RuntimeError: When conversion fails, an exception is raised with the error message embedded. """ - if distutils.spawn.find_executable(_deprecated_conversion_binary) is None: + if shutils.which(_deprecated_conversion_binary) is None: raise ConverterError("""Could not find `toco_from_protos` binary, make sure your virtualenv bin directory or pip local bin directory is in your path. In particular, if you have installed TensorFlow with --user, make sure you diff --git a/tensorflow/tools/pip_package/BUILD b/tensorflow/tools/pip_package/BUILD index c4d4c8d4060a37..937d035a13e34a 100644 --- a/tensorflow/tools/pip_package/BUILD +++ b/tensorflow/tools/pip_package/BUILD @@ -35,6 +35,7 @@ transitive_hdrs( "//tensorflow/core:lib", "//tensorflow/core:protos_all_cc", "//tensorflow/core/platform:stream_executor", + "//tensorflow/cc/saved_model:tag_constants", "//tensorflow/cc/saved_model:loader", "//tensorflow/cc/saved_model:reader", "//tensorflow/cc/saved_model:bundle_v2", diff --git a/tensorflow/workspace0.bzl b/tensorflow/workspace0.bzl index 0fdb0342fae676..8d6772d9282361 100644 --- a/tensorflow/workspace0.bzl +++ b/tensorflow/workspace0.bzl @@ -5,7 +5,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies") -load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") load("@local_config_android//:android.bzl", "android_workspace") load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") load("//third_party/googleapis:repository_rules.bzl", "config_googleapis") @@ -22,11 +21,11 @@ def _tf_bind(): # Needed by Protobuf native.bind( name = "grpc_cpp_plugin", - actual = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin", + actual = "@com_github_grpc_grpc//:grpc_cpp_plugin", ) native.bind( name = "grpc_python_plugin", - actual = "@com_github_grpc_grpc//src/compiler:grpc_python_plugin", + actual = "@com_github_grpc_grpc//:grpc_python_plugin", ) native.bind( @@ -132,7 +131,6 @@ def workspace(): # at the end of the WORKSPACE file. _tf_bind() - grpc_extra_deps() rules_foreign_cc_dependencies() config_googleapis() diff --git a/tensorflow/workspace1.bzl b/tensorflow/workspace1.bzl index 812baccbbbe851..61552ce1aba987 100644 --- a/tensorflow/workspace1.bzl +++ b/tensorflow/workspace1.bzl @@ -1,7 +1,6 @@ """TensorFlow workspace initialization. Consult the WORKSPACE on how to use it.""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") load("@com_google_benchmark//:bazel/benchmark_deps.bzl", "benchmark_deps") load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories") load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") @@ -31,7 +30,6 @@ def workspace(with_rules_cc = True): android_configure(name = "local_config_android") - grpc_deps() benchmark_deps() # Alias so it can be loaded without assigning to a different symbol to prevent diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl index fd29dff05f3e8c..f4993c3eb61340 100644 --- a/tensorflow/workspace2.bzl +++ b/tensorflow/workspace2.bzl @@ -21,9 +21,7 @@ load("//third_party/benchmark:workspace.bzl", benchmark = "repo") load("//third_party/clang_toolchain:cc_configure_clang.bzl", "cc_download_clang_toolchain") load("//third_party/dlpack:workspace.bzl", dlpack = "repo") load("//third_party/ducc:workspace.bzl", ducc = "repo") -load("//third_party/eigen3:workspace.bzl", eigen3 = "repo") load("//third_party/farmhash:workspace.bzl", farmhash = "repo") -load("//third_party/flatbuffers:workspace.bzl", flatbuffers = "repo") # Import third party repository rules. See go/tfbr-thirdparty. load("//third_party/FP16:workspace.bzl", FP16 = "repo") @@ -36,7 +34,6 @@ load("//third_party/highwayhash:workspace.bzl", highwayhash = "repo") load("//third_party/hwloc:workspace.bzl", hwloc = "repo") load("//third_party/icu:workspace.bzl", icu = "repo") load("//third_party/implib_so:workspace.bzl", implib_so = "repo") -load("//third_party/jpeg:workspace.bzl", jpeg = "repo") load("//third_party/kissfft:workspace.bzl", kissfft = "repo") load("//third_party/libprotobuf_mutator:workspace.bzl", libprotobuf_mutator = "repo") load("//third_party/llvm:setup.bzl", "llvm_setup") @@ -57,6 +54,9 @@ load("//third_party/tensorrt:workspace.bzl", tensorrt = "repo") load("//third_party/triton:workspace.bzl", triton = "repo") load("//third_party/vulkan_headers:workspace.bzl", vulkan_headers = "repo") +#import CMS specific repos +load("//third_party/cms:workspace.bzl", cms= "repos") + def _initialize_third_party(): """ Load third party repositories. See above load() statements. """ FP16() @@ -65,16 +65,12 @@ def _initialize_third_party(): benchmark() ducc() dlpack() - eigen3() farmhash() - flatbuffers() gemmlowp() hexagon_nn() highwayhash() - hwloc() icu() implib_so() - jpeg() kissfft() libprotobuf_mutator() ml_dtypes() @@ -89,6 +85,7 @@ def _initialize_third_party(): vulkan_headers() tensorrt() triton() + cms() # copybara: tsl vendor @@ -318,61 +315,6 @@ def _tf_repositories(): urls = tf_mirror_urls("https://github.com/googleapis/googleapis/archive/6b3fdcea8bc5398be4e7e9930c693f0ea09316a0.tar.gz"), ) - tf_http_archive( - name = "png", - build_file = "//third_party:png.BUILD", - patch_file = ["//third_party:png_fix_rpi.patch"], - sha256 = "a00e9d2f2f664186e4202db9299397f851aea71b36a35e74910b8820e380d441", - strip_prefix = "libpng-1.6.39", - system_build_file = "//third_party/systemlibs:png.BUILD", - urls = tf_mirror_urls("https://github.com/glennrp/libpng/archive/v1.6.39.tar.gz"), - ) - - tf_http_archive( - name = "org_sqlite", - build_file = "//third_party:sqlite.BUILD", - sha256 = "bb5849ae4d7129c09d20596379a0b3f7b1ac59cf9998eba5ef283ea9b6c000a5", - strip_prefix = "sqlite-amalgamation-3430000", - system_build_file = "//third_party/systemlibs:sqlite.BUILD", - urls = tf_mirror_urls("https://www.sqlite.org/2023/sqlite-amalgamation-3430000.zip"), - ) - - tf_http_archive( - name = "gif", - build_file = "//third_party:gif.BUILD", - patch_file = [ - "//third_party:gif_fix_strtok_r.patch", - "//third_party:gif_fix_image_counter.patch", - ], - sha256 = "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd", - strip_prefix = "giflib-5.2.1", - system_build_file = "//third_party/systemlibs:gif.BUILD", - urls = tf_mirror_urls("https://pilotfiber.dl.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz"), - ) - - tf_http_archive( - name = "six_archive", - build_file = "//third_party:six.BUILD", - sha256 = "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", - strip_prefix = "six-1.16.0", - system_build_file = "//third_party/systemlibs:six.BUILD", - urls = tf_mirror_urls("https://pypi.python.org/packages/source/s/six/six-1.16.0.tar.gz"), - ) - - tf_http_archive( - name = "absl_py", - sha256 = "a7c51b2a0aa6357a9cbb2d9437e8cd787200531867dc02565218930b6a32166e", - strip_prefix = "abseil-py-1.0.0", - system_build_file = "//third_party/systemlibs:absl_py.BUILD", - system_link_files = { - "//third_party/systemlibs:absl_py.absl.BUILD": "absl/BUILD", - "//third_party/systemlibs:absl_py.absl.flags.BUILD": "absl/flags/BUILD", - "//third_party/systemlibs:absl_py.absl.testing.BUILD": "absl/testing/BUILD", - "//third_party/systemlibs:absl_py.absl.logging.BUILD": "absl/logging/BUILD", - }, - urls = tf_mirror_urls("https://github.com/abseil/abseil-py/archive/refs/tags/v1.0.0.tar.gz"), - ) - tf_http_archive( name = "com_google_protobuf", patch_file = ["//third_party/protobuf:protobuf.patch"], @@ -416,37 +358,6 @@ def _tf_repositories(): urls = tf_mirror_urls("https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"), ) - tf_http_archive( - name = "curl", - build_file = "//third_party:curl.BUILD", - sha256 = "816e41809c043ff285e8c0f06a75a1fa250211bbfb2dc0a037eeef39f1a9e427", - strip_prefix = "curl-8.4.0", - system_build_file = "//third_party/systemlibs:curl.BUILD", - urls = tf_mirror_urls("https://curl.se/download/curl-8.4.0.tar.gz"), - ) - - # WARNING: make sure ncteisen@ and vpai@ are cc-ed on any CL to change the below rule - tf_http_archive( - name = "com_github_grpc_grpc", - sha256 = "b956598d8cbe168b5ee717b5dafa56563eb5201a947856a6688bbeac9cac4e1f", - strip_prefix = "grpc-b54a5b338637f92bfcf4b0bc05e0f57a5fd8fadd", - system_build_file = "//third_party/systemlibs:grpc.BUILD", - patch_file = [ - "//third_party/grpc:generate_cc_env_fix.patch", - "//third_party/grpc:register_go_toolchain.patch", - ], - system_link_files = { - "//third_party/systemlibs:BUILD": "bazel/BUILD", - "//third_party/systemlibs:grpc.BUILD": "src/compiler/BUILD", - "//third_party/systemlibs:grpc.bazel.grpc_deps.bzl": "bazel/grpc_deps.bzl", - "//third_party/systemlibs:grpc.bazel.grpc_extra_deps.bzl": "bazel/grpc_extra_deps.bzl", - "//third_party/systemlibs:grpc.bazel.cc_grpc_library.bzl": "bazel/cc_grpc_library.bzl", - "//third_party/systemlibs:grpc.bazel.generate_cc.bzl": "bazel/generate_cc.bzl", - "//third_party/systemlibs:grpc.bazel.protobuf.bzl": "bazel/protobuf.bzl", - }, - urls = tf_mirror_urls("https://github.com/grpc/grpc/archive/b54a5b338637f92bfcf4b0bc05e0f57a5fd8fadd.tar.gz"), - ) - tf_http_archive( name = "linenoise", build_file = "//third_party:linenoise.BUILD", @@ -483,16 +394,6 @@ def _tf_repositories(): urls = tf_mirror_urls("https://github.com/google/boringssl/archive/c00d7ca810e93780bd0c8ee4eea28f4f2ea4bcdc.tar.gz"), ) - # Note: if you update this, you have to update libpng too. See cl/437813808 - tf_http_archive( - name = "zlib", - build_file = "//third_party:zlib.BUILD", - sha256 = "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30", - strip_prefix = "zlib-1.2.13", - system_build_file = "//third_party/systemlibs:zlib.BUILD", - urls = tf_mirror_urls("https://zlib.net/fossils/zlib-1.2.13.tar.gz"), - ) - # LINT.IfChange tf_http_archive( name = "fft2d", @@ -617,15 +518,6 @@ def _tf_repositories(): urls = tf_mirror_urls("https://github.com/nvidia/nccl/archive/v2.19.3-1.tar.gz"), ) - tf_http_archive( - name = "cython", - build_file = "//third_party:cython.BUILD", - sha256 = "0c2eae8a4ceab7955be1e11a4ddc5dcc3aa06ce22ad594262f1555b9d10667f0", - strip_prefix = "cython-3.0.3", - system_build_file = "//third_party/systemlibs:cython.BUILD", - urls = tf_mirror_urls("https://github.com/cython/cython/archive/3.0.3.tar.gz"), - ) - # LINT.IfChange tf_http_archive( name = "arm_neon_2_x86_sse", @@ -775,15 +667,6 @@ def _tf_repositories(): urls = tf_mirror_urls("https://github.com/nlohmann/json/archive/v3.10.5.tar.gz"), ) - tf_http_archive( - name = "pybind11", - urls = tf_mirror_urls("https://github.com/pybind/pybind11/archive/v2.10.4.tar.gz"), - sha256 = "832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970", - strip_prefix = "pybind11-2.10.4", - build_file = "//third_party:pybind11.BUILD", - system_build_file = "//third_party/systemlibs:pybind11.BUILD", - ) - tf_http_archive( name = "pybind11_protobuf", urls = tf_mirror_urls("https://github.com/pybind/pybind11_protobuf/archive/80f3440cd8fee124e077e2e47a8a17b78b451363.zip"), diff --git a/third_party/absl/absl_neon.patch b/third_party/absl/absl_neon.patch new file mode 100644 index 00000000000000..369132cd5b40bd --- /dev/null +++ b/third_party/absl/absl_neon.patch @@ -0,0 +1,13 @@ +diff --git a/absl/base/config.h b/absl/base/config.h +index 97c9a22a109..ab1e9860a91 100644 +--- a/absl/base/config.h ++++ b/absl/base/config.h +@@ -926,7 +926,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || + // https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code + #ifdef ABSL_INTERNAL_HAVE_ARM_NEON + #error ABSL_INTERNAL_HAVE_ARM_NEON cannot be directly set +-#elif defined(__ARM_NEON) && !defined(__CUDA_ARCH__) ++#elif defined(__ARM_NEON) && !(defined(__NVCC__) && defined(__CUDACC__)) + #define ABSL_INTERNAL_HAVE_ARM_NEON 1 + #endif + diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl index 06f75166ce4bb6..21588375386063 100644 --- a/third_party/absl/workspace.bzl +++ b/third_party/absl/workspace.bzl @@ -42,6 +42,7 @@ def repo(): build_file = "//third_party/absl:com_google_absl.BUILD", system_build_file = "//third_party/absl:system.BUILD", system_link_files = SYS_LINKS, + patch_file = ["//third_party/absl:absl_neon.patch"], strip_prefix = "abseil-cpp-{commit}".format(commit = ABSL_COMMIT), urls = tf_mirror_urls("https://github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT)), ) diff --git a/third_party/cms/BUILD b/third_party/cms/BUILD new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/third_party/cms/numpy.BUILD b/third_party/cms/numpy.BUILD new file mode 100644 index 00000000000000..78358f201e7973 --- /dev/null +++ b/third_party/cms/numpy.BUILD @@ -0,0 +1,16 @@ +py_library( + name = "pkg", + visibility = ["//visibility:public"], +) + +filegroup( + name = "includes", + srcs = glob(["c-api/core/include/**/*.h"]), +) + +cc_library( + name = "numpy_headers", + hdrs = [":includes"], + strip_include_prefix="c-api/core/include/", + visibility = ["//visibility:public"], +) diff --git a/third_party/cms/pypi.BUILD b/third_party/cms/pypi.BUILD new file mode 100644 index 00000000000000..82f9e9a702ee73 --- /dev/null +++ b/third_party/cms/pypi.BUILD @@ -0,0 +1,4 @@ +py_library( + name = "pkg", + visibility = ["//visibility:public"], +) diff --git a/third_party/cms/repo.bzl b/third_party/cms/repo.bzl new file mode 100644 index 00000000000000..31de7469535abc --- /dev/null +++ b/third_party/cms/repo.bzl @@ -0,0 +1,44 @@ +def _cms_new_local_repository(ctx): + cmd = ["mkdir", "-p", ctx.path(".")] + ctx.execute(cmd) + + cms_root_file = ctx.os.environ["TF_CMS_EXTERNALS"] + cmd = ["cat", cms_root_file] + res = ctx.execute(cmd) + cms_paths = [ + line.split(":", 1)[1] + for line in res.stdout.split("\n") + if line.startswith(ctx.attr.name + ":/") + ] + + if cms_paths: + cms_path = cms_paths[-1].strip() + cmd = ["ls", cms_path + "/"] + res = ctx.execute(cmd) + for rfile in res.stdout.split("\n"): + if rfile: + ctx.symlink(cms_path + "/" + rfile, ctx.path(rfile)) + + ctx.template("BUILD.bazel", ctx.attr.build_file, { + "%prefix%": "external", + }, False) + + for xfile in ctx.attr.create_files: + ctx.file(xfile, content="") + + for src, dest in ctx.attr.symlinks.items(): + if src.startswith("//") or src.startswith("@"): + src = Label(src) + ctx.symlink(src, dest) + +cms_new_local_repository = repository_rule( + implementation = _cms_new_local_repository, + attrs = { + "build_file": attr.label(), + "symlinks": attr.string_dict(), + "create_files": attr.string_list(), + }, + environ = [ + "TF_CMS_EXTERNALS", + ], +) diff --git a/third_party/cms/workspace.bzl b/third_party/cms/workspace.bzl new file mode 100644 index 00000000000000..85f6bec947d529 --- /dev/null +++ b/third_party/cms/workspace.bzl @@ -0,0 +1,205 @@ +load("//third_party/cms:repo.bzl", "cms_new_local_repository") + +def png(): + cms_new_local_repository( + name = "png", + build_file = "//third_party/systemlibs:png.BUILD", + create_files = ["COPYING"], + ) + +def jpeg(): + cms_new_local_repository( + name = "libjpeg_turbo", + build_file = "//third_party/jpeg:BUILD.system", + create_files = ["LICENSE.md"], + ) + +def gif(): + cms_new_local_repository( + name = "gif", + build_file = "//third_party/systemlibs:gif.BUILD", + create_files = ["COPYING"], + ) + +def hwloc(): + cms_new_local_repository( + name = "hwloc", + build_file = "//third_party/hwloc:BUILD.system", + create_files = ["COPYING"], + ) + +def grpc(): + cms_new_local_repository( + name = "com_github_grpc_grpc", + build_file = "//third_party/systemlibs:grpc.BUILD", + create_files = ["LICENSE"], + symlinks = { + "//third_party/systemlibs:grpc.bazel.generate_cc.bzl": "bazel/generate_cc.bzl", + "//third_party/systemlibs:grpc.bazel.grpc_extra_deps.bzl": "bazel/grpc_extra_deps.bzl", + "//third_party/systemlibs:grpc.bazel.cc_grpc_library.bzl": "bazel/cc_grpc_library.bzl", + "//third_party/systemlibs:grpc.bazel.grpc_deps.bzl": "bazel/grpc_deps.bzl", + "//third_party/systemlibs:grpc.bazel.protobuf.bzl": "bazel/protobuf.bzl", + "//third_party/systemlibs:BUILD": "bazel/BUILD", + }, + ) + +def eigen(): + cms_new_local_repository( + name = "eigen_archive", + build_file = "//third_party/systemlibs:eigen.BUILD", + create_files = ["COPYING.MPL2"], + ) + +def protobuf(): + cms_new_local_repository( + name = "com_google_protobuf", + build_file = "//third_party/systemlibs:protobuf.BUILD", + create_files = ["LICENSE"], + symlinks = { + "//third_party/systemlibs:protobuf.bzl": "protobuf.bzl", + }, + ) + +def pcre(): + cms_new_local_repository( + name = "pcre", + build_file = "//third_party/systemlibs:pcre.BUILD", + create_files = ["LICENCE"], + ) + +def pybind11(): + cms_new_local_repository( + name = "pybind11", + build_file = "//third_party/systemlibs:pybind11.BUILD", + create_files = ["LICENCE"], + ) + +def flatbuffers(): + cms_new_local_repository( + name = "flatbuffers", + build_file = "//third_party/flatbuffers:BUILD.system", + create_files = ["LICENSE"], + symlinks = { + "//third_party/flatbuffers:build_defs.bzl": "build_defs.bzl", + }, + ) + +def curl(): + cms_new_local_repository( + name = "curl", + build_file = "//third_party/systemlibs:curl.BUILD", + create_files = ["COPYING"], + ) + +def zlib(): + cms_new_local_repository( + name = "zlib", + build_file = "//third_party/systemlibs:zlib.BUILD", + symlinks = { + "include/zlib.h": "zlib.h", + "include/zconf.h": "zconf.h", + }, + ) + +def cython(): + cms_new_local_repository( + name = "cython", + build_file = "//third_party/systemlibs:cython.BUILD", + ) + +def functools32(): + cms_new_local_repository( + name = "functools32_archive", + build_file = "//third_party/systemlibs:functools32.BUILD", + ) + +def astor(): + cms_new_local_repository( + name = "astor_archive", + build_file = "//third_party/systemlibs:astor.BUILD", + ) + +def six_archive(): + cms_new_local_repository( + name = "six_archive", + build_file = "//third_party/systemlibs:six.BUILD", + ) + +def termcolor(): + cms_new_local_repository( + name = "termcolor_archive", + build_file = "//third_party/systemlibs:termcolor.BUILD", + ) + +def typing_extensions(): + cms_new_local_repository( + name = "typing_extensions_archive", + build_file = "//third_party/systemlibs:typing_extensions.BUILD", + ) + +def sqlite(): + cms_new_local_repository( + name = "org_sqlite", + build_file = "//third_party/systemlibs:sqlite.BUILD", + ) + +def absl_py(): + cms_new_local_repository( + name = "absl_py", + build_file = "//third_party/systemlibs:absl_py.BUILD", + symlinks = { + "//third_party/systemlibs:absl_py.absl.BUILD": "absl/BUILD", + "//third_party/systemlibs:absl_py.absl.flags.BUILD": "absl/flags/BUILD", + "//third_party/systemlibs:absl_py.absl.logging.BUILD": "absl/logging/BUILD", + "//third_party/systemlibs:absl_py.absl.testing.BUILD": "absl/testing/BUILD", + }, + ) + +def pasta(): + cms_new_local_repository( + name = "pasta", + build_file = "//third_party/pasta:BUILD.system", + ) + +def wrapt(): + cms_new_local_repository( + name = "wrapt", + build_file = "//third_party/systemlibs:wrapt.BUILD", + ) + +def gast(): + cms_new_local_repository( + name = "gast_archive", + build_file = "//third_party/systemlibs:gast.BUILD", + ) + +def backports_weakref(): + cms_new_local_repository( + name = "org_python_pypi_backports_weakref", + build_file = "//third_party/systemlibs:backports_weakref.BUILD", + create_files = ["LICENSE"], + ) + +def opt_einsum(): + cms_new_local_repository( + name = "opt_einsum_archive", + build_file = "//third_party/systemlibs:opt_einsum.BUILD", + ) + + +def repos(): + png() + jpeg() + gif() + hwloc() + grpc() + eigen() + pybind11() + curl() + zlib() + cython() + flatbuffers() + sqlite() + pasta() + absl_py() + six_archive() diff --git a/third_party/cpuinfo-ppc64le.patch b/third_party/cpuinfo-ppc64le.patch new file mode 100644 index 00000000000000..2e55ed82fc4590 --- /dev/null +++ b/third_party/cpuinfo-ppc64le.patch @@ -0,0 +1,33 @@ +From 84aae4fe0f7bc111dd1fb1d8a7501128a6adff3c Mon Sep 17 00:00:00 2001 +From: Nishidha Panpaliya +Date: Thu, 27 Jul 2023 10:46:51 +0000 +Subject: [PATCH] Add support for linux ppc64le architecture + +--- + BUILD.bazel | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/BUILD.bazel b/BUILD.bazel +index 231d18f9..e7134e0f 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -113,6 +113,7 @@ cc_library( + ":linux_mips64": COMMON_SRCS + LINUX_SRCS, + ":linux_riscv64": COMMON_SRCS + LINUX_SRCS, + ":linux_s390x": COMMON_SRCS + LINUX_SRCS, ++ ":linux_ppc64le": COMMON_SRCS + LINUX_SRCS, + ":macos_x86_64": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, + ":macos_x86_64_legacy": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, + ":macos_arm64": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, +@@ -241,6 +242,11 @@ config_setting( + values = {"cpu": "s390x"}, + ) + ++config_setting( ++ name = "linux_ppc64le", ++ values = {"cpu": "ppc"}, ++) ++ + config_setting( + name = "macos_x86_64_legacy", + values = { diff --git a/third_party/flatbuffers/BUILD.system b/third_party/flatbuffers/BUILD.system index 8fe4d7a590719f..60da82c79e5c46 100644 --- a/third_party/flatbuffers/BUILD.system +++ b/third_party/flatbuffers/BUILD.system @@ -1,21 +1,23 @@ licenses(["notice"]) # Apache 2.0 filegroup( - name = "LICENSE.txt", + name = "LICENSE", visibility = ["//visibility:public"], ) # Public flatc library to compile flatbuffer files at runtime. cc_library( name = "flatbuffers", - linkopts = ["-lflatbuffers"], + linkopts = ["-Lexternal/flatbuffers/lib64 -lflatbuffers"], + includes = ["include"], visibility = ["//visibility:public"], ) # Public flatc compiler library. cc_library( name = "flatc_library", - linkopts = ["-lflatbuffers"], + linkopts = ["-Lexternal/flatbuffers/lib64 -lflatbuffers"], + includes = ["include"], visibility = ["//visibility:public"], ) @@ -34,6 +36,7 @@ sh_binary( cc_library( name = "runtime_cc", + includes = ["include"], visibility = ["//visibility:public"], ) diff --git a/third_party/googleapis/build_rules.bzl b/third_party/googleapis/build_rules.bzl index 3715b85da29339..561b1c87c2ec6f 100644 --- a/third_party/googleapis/build_rules.bzl +++ b/third_party/googleapis/build_rules.bzl @@ -75,7 +75,7 @@ def cc_grpc_library(name, srcs, deps, service_namespace = "grpc", **kwargs): flags = [ "services_namespace=" + service_namespace, ], - plugin = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin", + plugin = "@com_github_grpc_grpc//:grpc_cpp_plugin", well_known_protos = True, generate_mocks = True, ) diff --git a/third_party/hwloc/BUILD.system b/third_party/hwloc/BUILD.system index 2989102a1d96c9..c089d6e82e305b 100644 --- a/third_party/hwloc/BUILD.system +++ b/third_party/hwloc/BUILD.system @@ -15,8 +15,9 @@ filegroup( cc_library( name = "hwloc", linkopts = select({ - ":with_numa_support": ["-lhwloc"], + ":with_numa_support": ["-Lexternal/hwloc/lib -lhwloc"], "//conditions:default": [], }), + includes = ["include"], visibility = ["//visibility:public"], ) diff --git a/third_party/jpeg/BUILD.system b/third_party/jpeg/BUILD.system index f4f52da9bdae1b..15efd19e8fd42a 100644 --- a/third_party/jpeg/BUILD.system +++ b/third_party/jpeg/BUILD.system @@ -7,6 +7,7 @@ filegroup( cc_library( name = "jpeg", - linkopts = ["-ljpeg"], + linkopts = ["-Lexternal/libjpeg_turbo/lib64 -ljpeg"], + includes = ["include"], visibility = ["//visibility:public"], ) diff --git a/third_party/llvm/mlircpp20.patch b/third_party/llvm/mlircpp20.patch new file mode 100644 index 00000000000000..b478ac3e2d92c3 --- /dev/null +++ b/third_party/llvm/mlircpp20.patch @@ -0,0 +1,13 @@ +diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp +index b0c314369190a4..35ac4b8fd280ea 100644 +--- a/mlir/lib/Pass/PassRegistry.cpp ++++ b/mlir/lib/Pass/PassRegistry.cpp +@@ -373,7 +373,7 @@ llvm::cl::OptionValue::operator=( + return *this; + } + +-llvm::cl::OptionValue::~OptionValue() = default; ++llvm::cl::OptionValue::~OptionValue() = default; + + void llvm::cl::OptionValue::setValue( + const OpPassManager &newValue) { diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl index 10601c8a766be9..8f6540171bfe5e 100644 --- a/third_party/llvm/workspace.bzl +++ b/third_party/llvm/workspace.bzl @@ -22,6 +22,7 @@ def repo(name): "//third_party/llvm:mathextras.patch", "//third_party/llvm:toolchains.patch", "//third_party/llvm:zstd.patch", + "//third_party/llvm:mlircpp20.patch", ], link_files = {"//third_party/llvm:run_lit.sh": "mlir/run_lit.sh"}, ) diff --git a/third_party/systemlibs/backports_weakref.BUILD b/third_party/systemlibs/backports_weakref.BUILD new file mode 100644 index 00000000000000..e878b73ef11196 --- /dev/null +++ b/third_party/systemlibs/backports_weakref.BUILD @@ -0,0 +1,9 @@ +py_library( + name = "org_python_pypi_backports_weakref", + visibility = ["//visibility:public"], +) + +filegroup( + name = "LICENSE", + visibility = ["//visibility:public"], +) diff --git a/third_party/systemlibs/curl.BUILD b/third_party/systemlibs/curl.BUILD index c5f125caa9eb46..9e2dd123c92f00 100644 --- a/third_party/systemlibs/curl.BUILD +++ b/third_party/systemlibs/curl.BUILD @@ -7,6 +7,7 @@ filegroup( cc_library( name = "curl", - linkopts = ["-lcurl"], + linkopts = ["-Lexternal/curl/lib -lcurl"], + includes = ["include"], visibility = ["//visibility:public"], ) diff --git a/third_party/systemlibs/eigen.BUILD b/third_party/systemlibs/eigen.BUILD new file mode 100644 index 00000000000000..ae8cce4c8a6906 --- /dev/null +++ b/third_party/systemlibs/eigen.BUILD @@ -0,0 +1,53 @@ +# Description: +# Eigen is a C++ template library for linear algebra: vectors, +# matrices, and related algorithms. + +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 +]) + +filegroup( + name = "COPYING.MPL2", + visibility = ["//visibility:public"], +) + +cc_library( + name = "eigen", + includes = ["include/eigen3"], + 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", + "EIGEN_MAX_ALIGN_BYTES=64", + "EIGEN_HAS_TYPE_TRAITS=0", + ], + visibility = ["//visibility:public"], +) + +cc_library( + name = "eigen3", + hdrs = [], + 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", + "EIGEN_MAX_ALIGN_BYTES=64", + ], + includes = ["include/eigen3"], + visibility = ["//visibility:public"], +) + +cc_library( + name = "eigen3_internal", + 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", + "EIGEN_MAX_ALIGN_BYTES=64", + ], + includes = ["include/eigen3"], + visibility = ["//visibility:public"], +) diff --git a/third_party/systemlibs/gif.BUILD b/third_party/systemlibs/gif.BUILD index 5eb2c918ba443f..61f1befe542a49 100644 --- a/third_party/systemlibs/gif.BUILD +++ b/third_party/systemlibs/gif.BUILD @@ -7,6 +7,7 @@ filegroup( cc_library( name = "gif", - linkopts = ["-lgif"], + linkopts = ["-Lexternal/gif/lib -lgif"], + includes = ["include"], visibility = ["//visibility:public"], ) diff --git a/third_party/systemlibs/grpc.BUILD b/third_party/systemlibs/grpc.BUILD index 8b703f11556daa..01a89db0ad8ece 100644 --- a/third_party/systemlibs/grpc.BUILD +++ b/third_party/systemlibs/grpc.BUILD @@ -7,7 +7,9 @@ filegroup( cc_library( name = "grpc", + includes = ["include"], linkopts = [ + "-Lexternal/com_github_grpc_grpc/lib", "-lgrpc", "-lgpr", ], @@ -16,7 +18,9 @@ cc_library( cc_library( name = "grpc++", + includes = ["include"], linkopts = [ + "-Lexternal/com_github_grpc_grpc/lib", "-lgrpc++", "-lgpr", ], @@ -25,17 +29,21 @@ cc_library( cc_library( name = "grpc++_public_hdrs", + includes = ["include"], visibility = ["//visibility:public"], ) cc_library( name = "grpc++_codegen_proto", + includes = ["include"], visibility = ["//visibility:public"], ) cc_library( name = "grpc_unsecure", + includes = ["include"], linkopts = [ + "-Lexternal/com_github_grpc_grpc/lib", "-lgrpc_unsecure", "-lgpr", ], @@ -44,7 +52,9 @@ cc_library( cc_library( name = "grpc++_unsecure", + includes = ["include"], linkopts = [ + "-Lexternal/com_github_grpc_grpc/lib", "-lgrpc++_unsecure", "-lgpr", ], diff --git a/third_party/systemlibs/grpc.bazel.cc_grpc_library.bzl b/third_party/systemlibs/grpc.bazel.cc_grpc_library.bzl index e427328c39be80..87f99c22601f4b 100644 --- a/third_party/systemlibs/grpc.bazel.cc_grpc_library.bzl +++ b/third_party/systemlibs/grpc.bazel.cc_grpc_library.bzl @@ -88,7 +88,7 @@ def cc_grpc_library( generate_cc( name = codegen_grpc_target, srcs = proto_targets, - plugin = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin", + plugin = "@com_github_grpc_grpc//:grpc_cpp_plugin", well_known_protos = well_known_protos, generate_mocks = generate_mocks, **kwargs diff --git a/third_party/systemlibs/png.BUILD b/third_party/systemlibs/png.BUILD index fc6b6f2d8bb0f8..33ca2968368dc5 100644 --- a/third_party/systemlibs/png.BUILD +++ b/third_party/systemlibs/png.BUILD @@ -7,6 +7,7 @@ filegroup( cc_library( name = "png", - linkopts = ["-lpng"], + linkopts = ["-Lexternal/png/lib -lpng"], + includes = ["include"], visibility = ["//visibility:public"], ) diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD index c7d940605f9f72..b702cb8c5204aa 100644 --- a/third_party/systemlibs/protobuf.BUILD +++ b/third_party/systemlibs/protobuf.BUILD @@ -51,29 +51,55 @@ genrule( name = "link_proto_files", outs = RELATIVE_WELL_KNOWN_PROTOS, cmd = """ + pdir=$$(which protoc | sed 's|/bin/protoc||') for i in $(OUTS); do f=$${i#$(@D)/} mkdir -p $(@D)/$${f%/*} - ln -sf $(PROTOBUF_INCLUDE_PATH)/$$f $(@D)/$$f + ln -sf $$pdir/include/$$f $(@D)/$$f done """, ) cc_library( name = "protobuf", - linkopts = ["-lprotobuf"], + linkopts = ["-Lexternal/com_google_protobuf/lib -lprotobuf"], + includes = ["include"], visibility = ["//visibility:public"], ) cc_library( name = "protobuf_headers", - linkopts = ["-lprotobuf"], + linkopts = ["-Lexternal/com_google_protobuf/lib -lprotobuf"], + includes = ["include"], visibility = ["//visibility:public"], ) cc_library( name = "protoc_lib", - linkopts = ["-lprotoc"], + linkopts = ["-Lexternal/com_google_protobuf/lib -lprotoc"], + includes = ["include"], + visibility = ["//visibility:public"], +) + +cc_library( + name = "protobuf_lite", + linkopts = ["-Lexternal/com_google_protobuf/lib -lprotobuf"], + includes = ["include"], + visibility = ["//visibility:public"], +) + +cc_library( + name = "proto_api", + linkopts = ["-Lexternal/com_google_protobuf/lib -lprotoc"], + includes = ["include"], + visibility = ["//visibility:public"], +) + +proto_lang_toolchain( + name = "cc_toolchain", + blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], + command_line = "--cpp_out=$(OUT)", + runtime = ":protobuf", visibility = ["//visibility:public"], ) @@ -94,7 +120,7 @@ cc_proto_library( proto_gen( name = "protobuf_python_genproto", - includes = ["."], + includes = ["include"], protoc = "@com_google_protobuf//:protoc", visibility = ["//visibility:public"], ) diff --git a/third_party/systemlibs/pybind11.BUILD b/third_party/systemlibs/pybind11.BUILD index 44e7496fc25c58..fc561962e24cb9 100644 --- a/third_party/systemlibs/pybind11.BUILD +++ b/third_party/systemlibs/pybind11.BUILD @@ -2,7 +2,14 @@ package(default_visibility = ["//visibility:public"]) cc_library( name = "pybind11", + includes = ['lib/python3.9/site-packages/pybind11/include'], deps = [ "@local_tsl//third_party/python_runtime:headers", ], ) + +# Needed by pybind11_bazel. +config_setting( + name = "osx", + constraint_values = ["@platforms//os:osx"], +) diff --git a/third_party/systemlibs/sqlite.BUILD b/third_party/systemlibs/sqlite.BUILD index 88a84a961376b7..70eee789fd2965 100644 --- a/third_party/systemlibs/sqlite.BUILD +++ b/third_party/systemlibs/sqlite.BUILD @@ -3,7 +3,8 @@ licenses(["unencumbered"]) # Public Domain # Production build of SQLite library that's baked into TensorFlow. cc_library( name = "org_sqlite", - linkopts = ["-lsqlite3"], + linkopts = ["-Lexternal/org_sqlite/lib -lsqlite3"], + includes = ["include"], visibility = ["//visibility:public"], ) diff --git a/third_party/systemlibs/syslibs_configure.bzl b/third_party/systemlibs/syslibs_configure.bzl index 822ecda6d69979..3e31f616a1aecb 100644 --- a/third_party/systemlibs/syslibs_configure.bzl +++ b/third_party/systemlibs/syslibs_configure.bzl @@ -22,6 +22,7 @@ VALID_LIBS = [ "cython", "dill_archive", "double_conversion", + "eigen_archive", "flatbuffers", "functools32_archive", "gast_archive", @@ -33,6 +34,7 @@ VALID_LIBS = [ "nasm", "nsync", "org_sqlite", + "org_python_pypi_backports_weakref", "pasta", "png", "pybind11", diff --git a/third_party/systemlibs/zlib.BUILD b/third_party/systemlibs/zlib.BUILD index 69462ae6cbc2fa..1b61ed363b299f 100644 --- a/third_party/systemlibs/zlib.BUILD +++ b/third_party/systemlibs/zlib.BUILD @@ -7,6 +7,8 @@ filegroup( cc_library( name = "zlib", - linkopts = ["-lz"], + hdrs = ["zlib.h"], + linkopts = ["-Lexternal/zlib/lib -lz"], + includes = ["."], visibility = ["//visibility:public"], )