Repository navigation
Conversation
Enable building, testing, and packaging TensorFlow Quantum on macOS
(Apple Silicon / arm64) with TensorFlow 2.19.1:
- configure.sh & third_party/tf/:
- Detect `libtensorflow_framework*.dylib` on Darwin and configure
`@local_config_tf//:libtensorflow_framework` to output
`libtensorflow_framework.dylib` on macOS.
- Guard Linux-only `libstdc++` ABI and GCC warning flags (`-Wno-stringop-overflow`,
`-Wno-maybe-uninitialized`) on macOS.
- Add macOS Bazel flags (`--macos_minimum_os=12.0`, `--host_cxxopt=-std=c++17`,
`-DGRPC_BAZEL_BUILD`, `-Wl,-undefined,dynamic_lookup`, and `@loader_path`
rpaths to `tensorflow`).
- Enforce CPU build (`TF_NEED_CUDA=0`) when configuring on macOS.
- Packaging & custom op loading:
- Update `release/build_pip_package.sh` to dereference Bazel runfiles symlinks
portably on BSD/macOS `cp` (`-LR`), avoid clobbering the macOS `TMPDIR`
environment variable, and normalize relative destination paths.
- Replace removed-in-3.12 `distutils.sysconfig.get_python_lib` with stdlib
`sysconfig.get_path("platlib")` in `tensorflow_quantum/core/ops/load_module.py`.
- Add native macOS build and `delocate-wheel` repair paths to
`release/build_distribution.sh`, `release/clean_distribution.sh`, and
`release/build_release.sh`.
- CI & scripts:
- Update `scripts/ci_install.sh` to install Bazel 6.5.0 on Darwin (`arm64`/`x86_64`).
- Guard x86-only `-msse2`/`-msse3`/`-msse4` flags behind `uname -m == x86_64` in
test and benchmark scripts.
- Add `macos-14` jobs to `.github/workflows/ci.yaml` and
`.github/workflows/ci-nightly-build-test.yaml`.
- Docs & metadata:
- Add macOS and Linux OS classifiers in `release/setup.py` and update
`README.md`, `docs/install.md`, and `release/README.md`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable building, testing, and packaging TensorFlow Quantum on macOS (Apple Silicon / arm64) with TensorFlow 2.19.1:
libtensorflow_framework*.dylibon Darwin and configure@local_config_tf//:libtensorflow_frameworkto outputlibtensorflow_framework.dylibon macOS.libstdc++ABI and GCC warning flags (-Wno-stringop-overflow,-Wno-maybe-uninitialized) on macOS.--macos_minimum_os=12.0,--host_cxxopt=-std=c++17,-DGRPC_BAZEL_BUILD,-Wl,-undefined,dynamic_lookup, and@loader_pathrpaths totensorflow).TF_NEED_CUDA=0) when configuring on macOS.release/build_pip_package.shto dereference Bazel runfiles symlinks portably on BSD/macOScp(-LR), avoid clobbering the macOSTMPDIRenvironment variable, and normalize relative destination paths.distutils.sysconfig.get_python_libwith stdlibsysconfig.get_path("platlib")intensorflow_quantum/core/ops/load_module.py.delocate-wheelrepair paths torelease/build_distribution.sh,release/clean_distribution.sh, andrelease/build_release.sh.scripts/ci_install.shto install Bazel 6.5.0 on Darwin (arm64/x86_64).-msse2/-msse3/-msse4flags behinduname -m == x86_64in test and benchmark scripts.macos-14jobs to.github/workflows/ci.yamland.github/workflows/ci-nightly-build-test.yaml.release/setup.pyand updateREADME.md,docs/install.md, andrelease/README.md.