-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (76 loc) · 3.88 KB
/
macos_arm64.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build wheels on Macos-arm64
on:
push:
branches:
- action
pull_request:
branches:
- action
jobs:
build_wheels_macos_arm64:
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
matrix:
buildplat:
- [macos-12, macosx, arm64]
python: ["cp39"]
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Build wheels on macos_arm64
if: ${{ matrix.buildplat[1] == 'macosx' && matrix.buildplat[2] == 'arm64' }}
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}*
CIBW_BUILD_VERBOSITY: 3
CIBW_ENVIRONMENT: FFLAGS='-fPIC -fallow-argument-mismatch' SETUPTOOLS_USE_DISTUTILS=stdlib QE_INSTALL_FLAGS='--host=host' NPY_DISTUTILS_APPEND_FLAGS=1 MACOSX_DEPLOYMENT_TARGET=11.0 LDFLAGS='-L/usr/local/lib/libdir -Wl,-rpath,/usr/local/lib/libdir -arch x86_64' SDKROOT=/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk build_alias=arm-apple-darwin20.0.0 host_alias=x86_64-unknown-linux-gnu CFLAGS='-fPIC -arch arm64' CPP='gcc -E'
CIBW_ENVIRONMENT_PASS_LINUX: FFLAGS SETUPTOOLS_USE_DISTUTILS QE_INSTALL_FLAGS NPY_DISTUTILS_APPEND_FLAGS MACOSX_DEPLOYMENT_TARGET SDKROOT LDFLAGS build_alias host_alias CFLAGS CPP
CIBW_ARCHS_MACOS: "arm64"
CIBW_REPAIR_WHEEL_COMMAND_MACOS: delocate-wheel -e 'qepy' --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
CIBW_BEFORE_BUILD: |
#
pip install delocate==0.10.6
brew install openblas lapack
#
curl -L -O https://github.com/isuruf/gcc/releases/download/gcc-10-arm-20210728/gfortran-darwin-arm64.tar.gz
export GFORTRAN_SHA=4a1354e61294d5163609e83b6b2b082bd9a9bbdf
if [[ "$(shasum gfortran-darwin-arm64.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-arm64.tar.gz" ]]; then
echo "shasum mismatch for gfortran-darwin-arm64"
exit 1
fi
sudo mkdir -p /opt/
sudo cp "gfortran-darwin-arm64.tar.gz" /opt/gfortran-darwin-arm64.tar.gz
pushd /opt
sudo tar -xvf gfortran-darwin-arm64.tar.gz
sudo rm gfortran-darwin-arm64.tar.gz
popd
FC_ARM64="$(find /opt/gfortran-darwin-arm64/bin -name "*-gfortran")"
libgfortran="$(find /opt/gfortran-darwin-arm64/lib -name "libgfortran.dylib")"
libdir=$(dirname $libgfortran)
FC_ARM64_LDFLAGS="-L$libdir -Wl,-rpath,$libdir"
#
sudo ln -s $FC_ARM64 /usr/local/bin/gfortran
sudo ln -s $libdir /usr/local/lib/libdir
echo ${SDKROOT:-$(xcrun --show-sdk-path)}
#
#gfortran -v
#export FFLAGS='-fPIC -fallow-argument-mismatch' SETUPTOOLS_USE_DISTUTILS=stdlib QE_INSTALL_FLAGS='--host=host' NPY_DISTUTILS_APPEND_FLAGS=1 MACOSX_DEPLOYMENT_TARGET=11.0 LDFLAGS='-L/usr/local/lib/libdir -Wl,-rpath,/usr/local/lib/libdir -arch x86_64' SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} build_alias=arm-apple-darwin20.0.0 host_alias=x86_64-unknown-linux-gnu CFLAGS='-fPIC -arch arm64'
#python -m pip install setuptools==59.8.0 f90wrap==0.2.11 oldest-supported-numpy
#ls *
#python setup.py build
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 6
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}
path: ./wheelhouse/*.whl