Skip to content

Commit

Permalink
Link against the tensorflow-macos when building for ARM Macs
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeiger committed Sep 8, 2021
1 parent 9634f7f commit a8e1695
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/make_wheel_macOS_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ python -m pip install --default-timeout=1000 delocate wheel setuptools tensorflo

python configure.py

# For dynamic linking, we want the ARM version of TensorFlow.
# Since we cannot run it on x86 so we need to force pip to install it regardless
python -m pip install \
--platform=macosx_11_0_arm64 \
--no-deps \
--target=$(python -c 'import site; print(site.getsitepackages()[0])') \
--upgrade \
tensorflow-macos==$TF_VERSION

bazel build \
--cpu=darwin_arm64 \
--copt -mmacosx-version-min=11.0 \
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['macos-11', 'windows-latest', 'ubuntu-18.04']
os: ['macos-latest', 'windows-latest', 'ubuntu-18.04']
py-version: ['3.6', '3.7', '3.8', '3.9']
tf-version: ['2.4.2', '2.6.0']
cpu: ['x86', 'arm64']
exclude:
- os: 'ubuntu-18.04'
cpu: ['x86']
include:
- os: 'macos-11'
cpu: 'arm64'
- os: 'windows-latest'
tf-version: '2.5.0'
py-version: '3.8'
- os: 'macos-11'
cpu: 'arm64'
tf-version: '2.5.0'
py-version: '3.9'
fail-fast: false
steps:
- uses: actions/[email protected]
Expand Down Expand Up @@ -91,12 +95,16 @@ jobs:
os: ['macOS', 'Windows', 'Linux']
py-version: ['3.6', '3.7', '3.8', '3.9']
tf-version: ['2.6.0']
cpu: ['x86', 'arm64']
exclude:
- os: 'Linux'
cpu: ['x86']
include:
- os: 'macos-11'
cpu: 'arm64'
- os: 'Windows'
tf-version: '2.5.0'
py-version: '3.8'
- os: 'macos-11'
cpu: 'arm64'
tf-version: '2.5.0'
py-version: '3.9'
fail-fast: false
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release'
steps:
Expand Down

0 comments on commit a8e1695

Please sign in to comment.