Skip to content

extend github workflows with build with clang #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ updates:
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
rebase-strategy: "disabled"
77 changes: 77 additions & 0 deletions .github/workflows/build-with-clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build project with IntelLLVM clang compiler

on:
pull_request:
push:
branches: [master]

permissions: read-all

jobs:
build-with-clang:
runs-on: ubuntu-latest

strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
numpy_version: ["numpy'<2'", "numpy'>=2'"]

env:
ONEAPI_ROOT: /opt/intel/oneapi

defaults:
run:
shell: bash -el {0}

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- name: Add Intel repository
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update

- name: Install Intel OneAPI
run: |
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
sudo apt-get install intel-oneapi-tbb
sudo apt-get install intel-oneapi-mkl-devel

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
architecture: x64

- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install mkl_fft dependencies
run: |
pip install cython setuptools">=77"
pip install ${{ matrix.numpy_version }}

- name: List oneAPI folder content
run: ls ${{ env.ONEAPI_ROOT }}/compiler

- name: Build mkl_fft
run: |
source ${{ env.ONEAPI_ROOT }}/setvars.sh
echo $CMPLR_ROOT
export CC=$CMPLR_ROOT/bin/icx
export CFLAGS="${CFLAGS} -fno-fast-math -O2"
pip install -e . --no-build-isolation --no-deps --verbose

- name: Run mkl_fft tests
run: |
source ${{ env.ONEAPI_ROOT }}/setvars.sh
pip install scipy mkl-service pytest
pytest -s -v --pyargs mkl_fft
30 changes: 30 additions & 0 deletions .github/workflows/conda-package-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ jobs:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set pkgs_dirs
run: |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc

- name: Cache conda packages
uses: actions/cache@v4
env:
Expand All @@ -43,8 +49,10 @@ jobs:

- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH

- name: Install conda-build
run: conda install conda-build

- name: Build conda package with NumPy 2.0
run: |
CHANNELS="-c conda-forge --override-channels"
Expand All @@ -56,6 +64,7 @@ jobs:
$VERSIONS \
$CHANNELS \
conda-recipe-cf

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -81,10 +90,13 @@ jobs:
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python_ver }}

- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH

- name: Install conda-build
run: conda install conda-build

- name: Create conda channel
run: |
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
Expand All @@ -97,11 +109,14 @@ jobs:
run: |
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME python=${{ matrix.python_ver }} ${{ matrix.numpy }} $CHANNELS --only-deps --dry-run > lockfile

- name: Display lockfile
run: cat lockfile

- name: Set pkgs_dirs
run: |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc

- name: Cache conda packages
uses: actions/cache@v4
env:
Expand All @@ -120,6 +135,7 @@ jobs:
conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python_ver }} ${{ matrix.numpy }} $PACKAGE_NAME pytest scipy $CHANNELS
# Test installed packages
conda list -n ${{ env.TEST_ENV_NAME }}

- name: Run tests
run: |
source $CONDA/etc/profile.d/conda.sh
Expand All @@ -133,9 +149,15 @@ jobs:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
Expand Down Expand Up @@ -181,6 +203,7 @@ jobs:
defaults:
run:
shell: cmd /C CALL {0}

strategy:
matrix:
python_ver: ['3.9', '3.10', '3.11', '3.12']
Expand Down Expand Up @@ -227,9 +250,11 @@ jobs:
shell: cmd /C CALL {0}
run: |
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json

- name: Output content of produced ver.json
shell: pwsh
run: Get-Content -Path ${{ env.workdir }}\ver.json

- name: Collect dependencies
shell: cmd /C CALL {0}
run: |
Expand All @@ -242,9 +267,11 @@ jobs:
SET PACKAGE_VERSION=%%F
)
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python_ver }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile

- name: Display lockfile content
shell: pwsh
run: Get-Content -Path .\lockfile

- name: Cache conda packages
uses: actions/cache@v4
env:
Expand All @@ -256,6 +283,7 @@ jobs:
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_ver }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-

- name: Install mkl_fft
shell: cmd /C CALL {0}
run: |
Expand All @@ -269,12 +297,14 @@ jobs:
)
SET "TEST_DEPENDENCIES=pytest pytest-cov"
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} ${{ matrix.numpy }} scipy -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}

- name: Report content of test environment
shell: cmd /C CALL {0}
run: |
echo "Value of CONDA enviroment variable was: " %CONDA%
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
conda info && conda list -n ${{ env.TEST_ENV_NAME }}

- name: Run tests
shell: cmd /C CALL {0}
run: >-
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ jobs:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set pkgs_dirs
run: |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc

- name: Cache conda packages
uses: actions/cache@v4
env:
Expand All @@ -43,8 +49,10 @@ jobs:

- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH

- name: Install conda-build
run: conda install conda-build

- name: Build conda package
run: |
CHANNELS="-c conda-forge -c https://software.repos.intel.com/python/conda --override-channels"
Expand All @@ -56,6 +64,7 @@ jobs:
$VERSIONS \
$CHANNELS \
conda-recipe

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -80,10 +89,13 @@ jobs:
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}

- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH

- name: Install conda-build
run: conda install conda-build

- name: Create conda channel
run: |
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
Expand All @@ -96,11 +108,14 @@ jobs:
run: |
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile

- name: Display lockfile
run: cat lockfile

- name: Set pkgs_dirs
run: |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc

- name: Cache conda packages
uses: actions/cache@v4
env:
Expand All @@ -119,6 +134,7 @@ jobs:
conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python }} $PACKAGE_NAME pytest scipy $CHANNELS
# Test installed packages
conda list -n ${{ env.TEST_ENV_NAME }}

- name: Run tests
run: |
source $CONDA/etc/profile.d/conda.sh
Expand All @@ -132,9 +148,15 @@ jobs:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4.2.0
with:
fetch-depth: 0

- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
Expand Down Expand Up @@ -182,6 +204,7 @@ jobs:
defaults:
run:
shell: cmd /C CALL {0}

strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
Expand All @@ -197,6 +220,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}

- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
Expand Down Expand Up @@ -226,9 +250,11 @@ jobs:
shell: cmd /C CALL {0}
run: |
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json

- name: Output content of produced ver.json
shell: pwsh
run: Get-Content -Path ${{ env.workdir }}\ver.json

- name: Collect dependencies
shell: cmd /C CALL {0}
run: |
Expand All @@ -241,9 +267,11 @@ jobs:
SET PACKAGE_VERSION=%%F
)
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile

- name: Display lockfile content
shell: pwsh
run: Get-Content -Path .\lockfile

- name: Cache conda packages
uses: actions/cache@v4
env:
Expand All @@ -255,6 +283,7 @@ jobs:
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-

- name: Install mkl_fft
shell: cmd /C CALL {0}
run: |
Expand All @@ -268,6 +297,7 @@ jobs:
)
SET "TEST_DEPENDENCIES=pytest pytest-cov"
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} scipy -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}

- name: Report content of test environment
shell: cmd /C CALL {0}
run: |
Expand Down
Loading