|
| 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 | + |
| 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 |
0 commit comments