Skip to content

Commit 04df947

Browse files
committed
add a new workflow
1 parent 0820b9b commit 04df947

File tree

7 files changed

+539
-80
lines changed

7 files changed

+539
-80
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build project with IntelLLVM clang compiler
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
permissions: read-all
9+
10+
jobs:
11+
build-with-clang:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
python: ["3.9", "3.10", "3.11", "3.12"]
17+
numpy_version: ["numpy'<2'", "numpy'>=2'"]
18+
19+
env:
20+
ONEAPI_ROOT: /opt/intel/oneapi
21+
22+
defaults:
23+
run:
24+
shell: bash -el {0}
25+
26+
steps:
27+
- name: Cancel Previous Runs
28+
uses: styfle/cancel-workflow-action@0.12.1
29+
with:
30+
access_token: ${{ github.token }}
31+
32+
- name: Add Intel repository
33+
run: |
34+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
35+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
36+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
37+
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
38+
sudo apt-get update
39+
40+
- name: Install Intel OneAPI
41+
run: |
42+
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
43+
sudo apt-get install intel-oneapi-tbb
44+
sudo apt-get install intel-oneapi-mkl-devel
45+
46+
- name: Setup Python
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: ${{ matrix.python }}
50+
architecture: x64
51+
52+
- name: Checkout repo
53+
uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
57+
- name: Install mkl_umath dependencies
58+
run: |
59+
pip install scikit-build cmake ninja cython setuptools">=77"
60+
pip install ${{ matrix.numpy_version }}
61+
62+
- name: List oneAPI folder content
63+
run: ls ${{ env.ONEAPI_ROOT }}/compiler
64+
65+
- name: Build mkl_umath
66+
run: |
67+
source ${{ env.ONEAPI_ROOT }}/setvars.sh
68+
echo $CMPLR_ROOT
69+
export CC=$CMPLR_ROOT/bin/icx
70+
export CFLAGS="${CFLAGS} -fno-fast-math -O2"
71+
pip install . --no-build-isolation --no-deps --verbose
72+
73+
- name: Run mkl_umath tests
74+
run: |
75+
source ${{ env.ONEAPI_ROOT }}/setvars.sh
76+
pip install pytest
77+
cd ..
78+
python -m pytest -sv --pyargs mkl_umath/mkl_umath/tests

.github/workflows/build_pip.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Editable build using pip
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
permissions: read-all
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
shell: bash -el {0}
17+
18+
strategy:
19+
matrix:
20+
python: ['3.9', '3.10', '3.11', '3.12']
21+
numpy_ver: ["numpy'<2'", "numpy'>=2'"]
22+
23+
steps:
24+
- name: Install jq
25+
shell: bash -l {0}
26+
run: |
27+
sudo apt-get install jq
28+
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- uses: conda-incubator/setup-miniconda@v3
34+
with:
35+
use-mamba: true
36+
miniforge-version: latest
37+
channels: conda-forge
38+
conda-remove-defaults: true
39+
activate-environment: test
40+
python-version: ${{ matrix.python }}
41+
42+
- name: Install Compiler and MKL
43+
run: |
44+
conda install mkl-devel mkl-service dpcpp_linux-64
45+
python -c "import sys; print(sys.executable)"
46+
which python
47+
python -c "import mkl; print(mkl.__file__)"
48+
49+
- name: Build conda package
50+
run: |
51+
pip install --no-cache-dir scikit-build cmake ninja cython
52+
pip install --no-cache-dir ${{ matrix.numpy_ver }}
53+
echo "CONDA_PREFFIX is '${CONDA_PREFIX}'"
54+
export MKLROOT=${CONDA_PREFIX}
55+
pip install . --no-build-isolation --no-deps --verbose
56+
pip install --no-cache-dir pytest
57+
pip list
58+
cd ..
59+
python -m pytest -v mkl_umath/mkl_umath/tests

0 commit comments

Comments
 (0)