-
Notifications
You must be signed in to change notification settings - Fork 11
78 lines (66 loc) · 2.21 KB
/
build-with-clang.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
name: Build mkl_random with clang
on:
pull_request:
push:
branches: [master]
permissions: read-all
jobs:
build-with-clang:
name: Build project with IntelLLVM clang compiler
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
numpy_build_version: ["numpy'>=2'"]
env:
ONEAPI_ROOT: /opt/intel/oneapi
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
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_random dependencies
shell: bash -l {0}
run: |
pip install cython setuptools pytest pytest-cov
pip install ${{ matrix.numpy_build_version }}
- name: List oneAPI folder content
shell: bash -l {0}
run: ls /opt/intel/oneapi/compiler
- name: Build mkl_random
shell: bash -l {0}
run: |
source /opt/intel/oneapi/setvars.sh
echo $CMPLR_ROOT
export CC=$CMPLR_ROOT/bin/icx
export CXX=$CMPLR_ROOT/bin/icpx
export CFLAGS="${CFLAGS} -fno-fast-math -O2"
python setup.py develop
- name: Run mkl_random tests
shell: bash -l {0}
run: |
source /opt/intel/oneapi/setvars.sh
# Test with NumPy<2 for now
pip install numpy"<2"
pytest -s -v --pyargs mkl_random