Skip to content

Commit 83c66dd

Browse files
committed
fix: review + badge
1 parent e27a1a0 commit 83c66dd

2 files changed

Lines changed: 20 additions & 24 deletions

File tree

‎.github/workflows/coverity.yml‎

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ name: Coverity Scan
1313
# COVERITY_SCAN_EMAIL - a maintainer email for build notifications
1414
#
1515
# Free-tier quota for a project under 100K LOC (mkl_random is ~10K) is 28
16-
# builds/week, max 4/day. This scans every push to master; the concurrency
17-
# group below cancels a superseded in-progress scan, so a burst of merges
18-
# collapses toward a single upload and stays within quota. The weekly cron is
19-
# a safety net for weeks with no commits to master.
16+
# builds/week, max 4/day, so this runs on a weekly schedule plus on demand
17+
# rather than per-push.
2018

2119
on:
22-
push:
23-
branches: [master]
2420
schedule:
25-
- cron: "0 1 * * 1" # weekly safety net; well under the free build quota
21+
- cron: "0 1 * * 1" # Mondays 01:00 UTC; well under the free build quota
2622
workflow_dispatch:
2723

2824
permissions:
@@ -34,7 +30,6 @@ concurrency:
3430

3531
env:
3632
COVERITY_PROJECT: IntelPython/mkl_random
37-
ONEAPI_ROOT: /opt/intel/oneapi
3833

3934
jobs:
4035
coverity-scan:
@@ -55,28 +50,28 @@ jobs:
5550
architecture: x64
5651

5752
- name: Install build dependencies
58-
run: pip install cython "setuptools>=77" "numpy>=2"
59-
60-
- name: Add Intel repository
61-
run: |
62-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
63-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
64-
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
65-
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
66-
sudo apt-get update
67-
68-
- name: Install Intel MKL
69-
run: sudo apt-get install -y intel-oneapi-mkl-devel
53+
run: pip install cython "setuptools>=77" "numpy>=2" mkl-devel
7054

7155
- name: Export MKLROOT
7256
run: |
73-
source "${ONEAPI_ROOT}/setvars.sh"
74-
if [ -z "${MKLROOT:-}" ]; then
75-
echo "::error::MKLROOT was not set after sourcing setvars.sh"
57+
# mkl-devel installs mkl.h + libmkl_rt into the Python prefix.
58+
MKLROOT="$(python -c 'import sys; print(sys.prefix)')"
59+
if [ ! -f "${MKLROOT}/include/mkl.h" ]; then
60+
echo "::error::mkl.h not found under ${MKLROOT}; mkl-devel did not install as expected."
7661
exit 1
7762
fi
63+
# The wheel ships only the versioned libmkl_rt.so.3, not the bare
64+
# linker name, so `g++ -lmkl_rt` fails until we add the symlink.
65+
if [ ! -e "${MKLROOT}/lib/libmkl_rt.so" ]; then
66+
rt_so=("${MKLROOT}/lib/"libmkl_rt.so.*)
67+
if [ ! -e "${rt_so[0]}" ]; then
68+
echo "::error::libmkl_rt.so.* not found under ${MKLROOT}/lib."
69+
exit 1
70+
fi
71+
ln -s "${rt_so[0]}" "${MKLROOT}/lib/libmkl_rt.so"
72+
fi
7873
echo "MKLROOT=${MKLROOT}" >> "$GITHUB_ENV"
79-
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
74+
echo "LD_LIBRARY_PATH=${MKLROOT}/lib:${LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
8075
8176
- name: Download Coverity Build Tool
8277
env:

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## `mkl_random` -- a NumPy-based Python interface to Intel® oneAPI Math Kernel Library (OneMKL) Random Number Generation functionality
22
[![Conda package using conda-forge](https://github.com/IntelPython/mkl_random/actions/workflows/conda-package-cf.yml/badge.svg)](https://github.com/IntelPython/mkl_random/actions/workflows/conda-package-cf.yml)
3+
[![Coverity Scan Build Status](https://scan.coverity.com/projects/33198/badge.svg)](https://scan.coverity.com/projects/intelpython-mkl_random)
34

45
`mkl_random` started as a part of Intel® Distribution for Python optimizations to NumPy.
56

0 commit comments

Comments
 (0)