Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/build_manylinux_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build manylinux wheels

on:
workflow_dispatch:

permissions:
contents: write

jobs:
mkl-service:
uses: ./.github/workflows/wheels.yml
with:
name: mkl-service
repo: IntelPython/mkl-service
force-build: true
manylinux: true

numpy:
uses: ./.github/workflows/wheels.yml
with:
name: numpy
repo: numpy/numpy
force-build: true
manylinux: true
needs: mkl-service

scipy:
uses: ./.github/workflows/wheels.yml
with:
name: scipy
repo: scipy/scipy
force-build: true
manylinux: true
needs: [mkl-service, numpy]
35 changes: 26 additions & 9 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
required: false
type: boolean
description: "Force build even if wheels exist"
manylinux:
required: false
type: boolean
description: "Build Linux wheels in manylinux container"
version:
required: false
type: string
Expand Down Expand Up @@ -52,9 +56,10 @@ jobs:

- name: Fetch build matrix
run: |
${{ inputs.force-build }} && extra_args="--force-build"
MATRIX="$(uv run tools/fetch_matrix ${{ inputs.name }} ${extra_args} \
--store build.json --runs-on ubuntu-22.04 --runs-on windows-2019)"
fetch_args="--store build.json --runs-on ubuntu-22.04"
${{ inputs.manylinux }} || fetch_args="${fetch_args} --runs-on windows-2019"
${{ inputs.force-build }} && fetch_args="${fetch_args} --force-build"
MATRIX="$(uv run tools/fetch_matrix ${{ inputs.name }} ${fetch_args})"
echo "MATRIX=${MATRIX}" >>$GITHUB_ENV
echo "${MATRIX}" | yq -P -o yaml

Expand All @@ -71,6 +76,9 @@ jobs:

runs-on: ${{ matrix.runs-on }}

container:
${{ fromJSON(inputs.manylinux) && 'quay.io/pypa/manylinux_2_28_x86_64' || null }}

continue-on-error: true

defaults:
Expand Down Expand Up @@ -102,10 +110,10 @@ jobs:
# Move src to avoid pyproject conflicts. SRC_DIR is set relative to GITHUB_WORKSPACE to
# preserve the "D:\" prefix on Windows. (Pure Linux paths aren't supported as arguments
# to 'working-directory'.)
mv src ../../ && echo "SRC_DIR=${{ github.workspace }}/../../src" >>$GITHUB_ENV
mv src ../../ && echo "SRC_DIR=${GITHUB_WORKSPACE}/../../src" >>$GITHUB_ENV

# Keep MKL directory short as it ends up in the final build.
echo "MKL_DIR=$(realpath "${{ github.workspace }}"/../../mkl)" >>$GITHUB_ENV
echo "MKL_DIR=$(realpath "${GITHUB_WORKSPACE}"/../../mkl)" >>$GITHUB_ENV

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand All @@ -129,7 +137,7 @@ jobs:

# Fetch MKL license.
cat "$(python tools/get_file_in_pkg LICENSE.txt --pkg mkl-devel)" \
>>"${{ github.workspace }}/patches/LICENSE_MKL.txt"
>>"${GITHUB_WORKSPACE}/patches/LICENSE_MKL.txt"

# Add .so -> .so.2 symlinks to fix linking for mkl-service.
cd "${{ env.MKL_DIR }}"/lib
Expand All @@ -152,18 +160,18 @@ jobs:
echo "----" >>LICENSE.txt
echo "" >>LICENSE.txt
cat LICENSES_bundled.txt >>LICENSE.txt
cat "${{ github.workspace }}/patches/LICENSE_MKL.txt" >>LICENSE.txt
cat "${GITHUB_WORKSPACE}/patches/LICENSE_MKL.txt" >>LICENSE.txt
if: inputs.name != 'mkl-service'

- name: Apply patches
run: |
# Apply patches.
cd "${{ env.SRC_DIR }}"
git apply "${{ github.workspace }}"/patches/${{ inputs.name }}/*.patch
git apply "${GITHUB_WORKSPACE}"/patches/${{ inputs.name }}/*.patch

# Fix MKL pkg-config on Windows.
if [[ "${{ runner.os }}" == "Windows" ]]; then
cp "${{ github.workspace }}"/patches/mkl/*.pc "${PKG_CONFIG_PATH}/"
cp "${GITHUB_WORKSPACE}"/patches/mkl/*.pc "${PKG_CONFIG_PATH}/"
fi

- name: Install Windows build dependencies
Expand All @@ -183,6 +191,15 @@ jobs:
esac
if: runner.os == 'windows'

- name: Install manylinux build dependencies
run: |
case "${{ inputs.name }}" in
mkl-service)
dnf -y install clang
;&
esac
if: inputs.manylinux

- name: Build wheel
working-directory: ${{ env.SRC_DIR }}
run: |
Expand Down
Loading