add one readme #35
This file contains 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
name: Build wheels | |
on: | |
push: | |
branches: | |
- github | |
paths-ignore: | |
- '.github/workflows/publish.yml' | |
pull_request: | |
branches: | |
- github | |
jobs: | |
build_wheels: | |
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
fail-fast: false | |
matrix: | |
buildplat: | |
- [ubuntu-20.04, manylinux, x86_64] | |
- [macos-latest, macosx, x86_64] | |
- [macos-12, macosx, arm64] | |
python: ["cp38", "cp39", "cp310", "cp311"] | |
exclude: | |
- buildplat: [macos-12, macosx, arm64] | |
python: "cp37" | |
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 linux | |
if: ${{ matrix.buildplat[1] == 'manylinux' }} | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}* | |
CIBW_ENVIRONMENT: FFLAGS='-fPIC -fallow-argument-mismatch' SETUPTOOLS_USE_DISTUTILS=stdlib | |
CIBW_ENVIRONMENT_PASS_LINUX: FFLAGS SETUPTOOLS_USE_DISTUTILS | |
CIBW_ARCHS_LINUX: "auto" | |
CIBW_BEFORE_BUILD: | | |
yum install -y blas-devel lapack-devel fftw-devel | |
- name: Build wheels on macos | |
if: ${{ matrix.buildplat[1] == 'macosx' && matrix.buildplat[2] == 'x86_64' }} | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}* | |
CIBW_ENVIRONMENT: FFLAGS='-fPIC -fallow-argument-mismatch' SETUPTOOLS_USE_DISTUTILS=stdlib | |
CIBW_ENVIRONMENT_PASS_LINUX: FFLAGS SETUPTOOLS_USE_DISTUTILS | |
CIBW_ARCHS_MACOS: "x86_64" | |
CIBW_BEFORE_BUILD: | | |
brew install gfortran && brew unlink gfortran && brew link gfortran | |
brew install openblas lapack | |
- 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_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_BEFORE_BUILD: | | |
# | |
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)} | |
# | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 60 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: qepy-wheels | |
path: ./wheelhouse/*.whl |