Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
04605fe
Moves the build system from setuptools to meson
ndgrigorian Apr 8, 2026
a8429b3
add cmake to build system dependencies
ndgrigorian Apr 8, 2026
dd8fb6c
use meson-python in builds
ndgrigorian Apr 8, 2026
e7b7b56
add pip build
ndgrigorian Apr 8, 2026
2d1f4a4
add standard clang workflow
ndgrigorian Apr 8, 2026
6b6bc71
add ninja to build system and meta.yamls
ndgrigorian Apr 8, 2026
668fbb5
use pip install in build scripts
ndgrigorian Apr 8, 2026
6f8d749
remove MKLROOT
ndgrigorian Apr 8, 2026
02efc61
don't install mkl-service in pip and standard clang builds
ndgrigorian Apr 8, 2026
e2c6db2
add mkl_threading option
ndgrigorian May 16, 2026
d665264
use gnu_thread in Linux conda-forge builds
ndgrigorian May 16, 2026
03930e6
add fix to pip builds
ndgrigorian May 16, 2026
570f465
Merge remote-tracking branch 'origin/master' into build-with-meson
vlad-perevezentsev Jul 23, 2026
9bf7d7e
Apply remarks from mkl-service PR for meson.build
vlad-perevezentsev Jul 23, 2026
60adc5f
Apply remarks from mkl-service PR for conda-recipe
vlad-perevezentsev Jul 23, 2026
72f9a2d
Update conda-recipe-cf
vlad-perevezentsev Jul 23, 2026
7483cfb
Add missing python source file to meson.build
vlad-perevezentsev Jul 23, 2026
74a8ae0
Clean up github workflows
vlad-perevezentsev Jul 23, 2026
6819973
Remove unused env variables from build_pip.yml
vlad-perevezentsev Jul 23, 2026
59da276
Add Building from source block to README.md
vlad-perevezentsev Jul 23, 2026
b98b4db
A small clean up
vlad-perevezentsev Jul 23, 2026
c925f2b
Remove redundant mkl from build-with-standard-clang dependencies
vlad-perevezentsev Jul 23, 2026
b60d962
Fix numpy install in GH CI workflows
vlad-perevezentsev Jul 23, 2026
a80ff59
add CI badges to README.md
vlad-perevezentsev Jul 23, 2026
01d2179
Fix MKL detection with non-Intel clang++
vlad-perevezentsev Jul 23, 2026
0d3b284
Merge remote-tracking branch 'origin/master' into build-with-meson
vlad-perevezentsev Aug 5, 2026
a90018c
Pass two separate RPATH entry for support macOS
vlad-perevezentsev Aug 5, 2026
569a6e0
Require meson-python >=0.16.0 for PEP 639
vlad-perevezentsev Aug 5, 2026
4184e3a
Add gh-113 to changelog
vlad-perevezentsev Aug 5, 2026
03c3c77
Add mkl-devel to build-system requires
vlad-perevezentsev Aug 5, 2026
f16cab6
Use editable install in build-with-standard-clang
vlad-perevezentsev Aug 5, 2026
979bfec
Remove redundant mkl from build_pip dependencies
vlad-perevezentsev Aug 5, 2026
3980e9f
Remove redundant CFLAGS/LDFLAGS from conda build.sh
vlad-perevezentsev Aug 5, 2026
33275d1
Switch MKL_LINK to sdl and remove meson.options
vlad-perevezentsev Aug 5, 2026
0b68ab4
Add --no-deps to build_pip
vlad-perevezentsev Aug 5, 2026
565d8b4
Clean up .gitignore for meson build
vlad-perevezentsev Aug 5, 2026
6970a72
Update maintenance docs for meson build
vlad-perevezentsev Aug 5, 2026
e000f3a
Remove unused WHEELS_OUTPUT_FOLDER from conda-recipe-cf
vlad-perevezentsev Aug 5, 2026
bb303b3
Add numpy to ignore_run_exports in conda recipes
vlad-perevezentsev Aug 5, 2026
fa5e258
Merge remote-tracking branch 'origin/master' into build-with-meson
vlad-perevezentsev Aug 5, 2026
952c133
Add OSX builds to conda-forge package workflow
vlad-perevezentsev Aug 5, 2026
60d4a45
Add osx compilers to conda-forge build config
vlad-perevezentsev Aug 5, 2026
5edd83e
Restore scripting@intel.com email in authors
vlad-perevezentsev Aug 6, 2026
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: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
shell: bash -l {0}
run: |
pip install numpy cython setuptools">=77" scikit-build cmake sphinx sphinx_rtd_theme furo pydot graphviz sphinxcontrib-programoutput sphinxcontrib-googleanalytics sphinx_design
pip install meson-python ninja cython cmake numpy sphinx sphinx_rtd_theme furo pydot graphviz sphinxcontrib-programoutput sphinxcontrib-googleanalytics sphinx_design
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/build-with-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
numpy_version: ["numpy>=2"]
numpy_version: ["'numpy>=2'"]
env:
ONEAPI_ROOT: /opt/intel/oneapi

Expand All @@ -38,7 +38,6 @@ jobs:
- 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
Expand All @@ -54,8 +53,8 @@ jobs:

- name: Install mkl_random dependencies
run: |
pip install cython setuptools">=77"
pip install "${{ matrix.numpy_version }}"
pip install meson-python ninja cython cmake
pip install ${{ matrix.numpy_version }}

- name: List oneAPI folder content
run: ls "${{ env.ONEAPI_ROOT }}/compiler"
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/build-with-standard-clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build project with standard clang compiler

on:
pull_request:
push:
branches: [master]

permissions: read-all

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

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

env:
COMPILER_ROOT: /usr/bin

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

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

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang

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

- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install mkl_random dependencies
run: |
pip install meson-python ninja cmake cython mkl-devel
pip install ${{ matrix.numpy_version }}

- name: Build mkl_random
run: |
export CC=${{ env.COMPILER_ROOT }}/clang
export CXX=${{ env.COMPILER_ROOT }}/clang++
pip install -e . --no-build-isolation --no-deps --verbose

- name: Run mkl_random tests
run: |
pip install pytest
python -m pytest -sv --pyargs mkl_random
46 changes: 46 additions & 0 deletions .github/workflows/build_pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Editable build using pip and pre-release NumPy

on:
push:
branches:
- master
pull_request:

permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}

strategy:
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
use_pre: ["", "--pre"]

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
with:
miniforge-version: latest
channels: conda-forge
activate-environment: test
python-version: ${{ matrix.python }}

- name: Install MKL
run: |
conda install mkl-devel

- name: Build with pip
run: |
pip install --no-cache-dir meson-python ninja cmake cython
pip install --no-cache-dir numpy ${{ matrix.use_pre }}
pip install -e . --no-build-isolation --no-deps --verbose
pip install --no-cache-dir pytest
pip list
python -m pytest -v mkl_random/tests
154 changes: 154 additions & 0 deletions .github/workflows/conda-package-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,157 @@ jobs:
run: |
conda activate ${{ env.TEST_ENV_NAME }}
pytest -v --pyargs ${{ env.MODULE_NAME }}

build_osx:
runs-on: macos-26-intel
strategy:
matrix:
include:
- python: "3.10"
numpy: "2.2"
- python: "3.11"
numpy: "2.3"
- python: "3.12"
numpy: "2.3"
- python: "3.13"
numpy: "2.3"
- python: "3.14"
numpy: "2.3"

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

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
miniforge-version: latest
activate-environment: build
channels: conda-forge
python-version: ${{ matrix.python }}

- name: Cache conda packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
env:
CACHE_NUMBER: 0 # Increase to reset cache
with:
path: /Users/runner/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-

- name: Install conda-build
shell: bash -el {0}
run: |
conda install -n base -y conda-build
conda list -n base

- name: Store conda paths as envs
shell: bash -el {0}
run: |
echo "CONDA_BLD=$CONDA/conda-bld/osx-64/" >> "$GITHUB_ENV"

- name: Build conda package
shell: bash -el {0}
run: |
CHANNELS=(-c conda-forge --override-channels)
VERSIONS=(--python "${{ matrix.python }}" --numpy "${{ matrix.numpy }}")
TEST=(--no-test)

conda build \
"${TEST[@]}" \
"${VERSIONS[@]}" \
"${CHANNELS[@]}" \
conda-recipe-cf

- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda

test_osx:
needs: build_osx
runs-on: macos-26-intel
strategy:
matrix:
include:
- python: "3.10"
numpy: "2.2"
- python: "3.11"
numpy: "2.3"
- python: "3.12"
numpy: "2.3"
- python: "3.13"
numpy: "2.3"
- python: "3.14"
numpy: "2.3"

steps:
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}

- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
miniforge-version: latest
channels: conda-forge
activate-environment: base

- name: Install conda-index
shell: bash -el {0}
run: conda install -n base -y conda-index

- name: Create conda channel
shell: bash -el {0}
run: |
mkdir -p "$GITHUB_WORKSPACE/channel/osx-64"
conda index "$GITHUB_WORKSPACE/channel" || exit 1
mv "${PACKAGE_NAME}"-*.conda "$GITHUB_WORKSPACE/channel/osx-64" || exit 1
conda index "$GITHUB_WORKSPACE/channel" || exit 1
# Test channel
conda search "$PACKAGE_NAME" -c "$GITHUB_WORKSPACE/channel" --override-channels --info --json > "$GITHUB_WORKSPACE/ver.json"
cat ver.json

- name: Collect dependencies
shell: bash -el {0}
run: |
PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")"
export PACKAGE_VERSION
conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" "python=${{ matrix.python }}" "numpy=${{ matrix.numpy }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels --only-deps --dry-run > lockfile
cat lockfile

- name: Cache conda packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
env:
CACHE_NUMBER: 0 # Increase to reset cache
with:
path: /Users/runner/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-

- name: Install mkl_random
shell: bash -el {0}
run: |
PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")"
export PACKAGE_VERSION
conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" pytest "python=${{ matrix.python }}" "numpy=${{ matrix.numpy }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels
# Test installed packages
conda list -n "${{ env.TEST_ENV_NAME }}"

- name: Run tests
shell: bash -el {0}
run: |
conda activate ${{ env.TEST_ENV_NAME }}
pytest -vv --pyargs ${{ env.MODULE_NAME }}
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# CMake build and local install directory
# Meson build and local install directory
build/
.mesonpy-*
mkl_random.egg-info/

# Byte-compiled / optimized / DLL files
__pycache__/

mkl_random/src/mklrand.c
mkl_random/mklrand.cpp
mkl_random/mklrand.cpython*.so
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
* Removed `numpy-base` dependency and `USE_NUMPY_BASE` environment variable from conda recipe [gh-124](https://github.com/IntelPython/mkl_random/pull/124)
* Migrated the build system from `setuptools` to `meson-python`, removing `setup.py` in favor of `meson.build` [gh-113](https://github.com/IntelPython/mkl_random/pull/113)

### Fixed
* Fixed compatibility with NumPy 2.5 by replacing the deprecated in-place array `shape` assignment with `reshape`, and by replacing the deprecated `numpy.testing.suppress_warnings` usage in tests with `pytest.warns` [gh-137](https://github.com/IntelPython/mkl_random/pull/137)
Expand Down
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## `mkl_random` -- a NumPy-based Python interface to Intel® oneAPI Math Kernel Library (OneMKL) Random Number Generation functionality
[![Conda package](https://github.com/IntelPython/mkl_random/actions/workflows/conda-package.yml/badge.svg)](https://github.com/IntelPython/mkl_random/actions/workflows/conda-package.yml)
[![Editable build using pip and pre-release NumPy](https://github.com/IntelPython/mkl_random/actions/workflows/build_pip.yml/badge.svg)](https://github.com/IntelPython/mkl_random/actions/workflows/build_pip.yml)
[![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)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/33198/badge.svg)](https://scan.coverity.com/projects/intelpython-mkl_random)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/mkl_random/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/mkl_random)
Expand Down Expand Up @@ -134,7 +136,25 @@ with mkl_random.mkl_random():

---

To build `mkl_random` from sources on Linux:
- install a recent version of MKL, if necessary;
- execute `source /path_to_oneapi/mkl/latest/env/vars.sh`;
- execute `python -m pip install .`
# Building from source

A C++ compiler, Intel® oneAPI Math Kernel Library (oneMKL), and NumPy are required
to build `mkl_random` from source.

Executing
```sh
python -m pip install .
```
will pull in the required build dependencies, including `mkl` and `numpy`, and build `mkl_random`.

If you already have `mkl` and `numpy` installed (from your system or a conda environment)
and want to reuse them instead of pulling fresh copies into an isolated build, first
install the build dependencies:
```sh
pip install meson-python cmake ninja cython numpy mkl-devel
```

then build against the existing installation with:
```sh
python -m pip install --no-build-isolation --no-deps .
```
17 changes: 2 additions & 15 deletions conda-recipe-cf/bld.bat
Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@
@rem Remember to source the compiler

set MKLROOT=%CONDA_PREFIX%

rem Build wheel package
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
%PYTHON% -m pip wheel --no-build-isolation --no-deps .
if errorlevel 1 exit 1
copy mkl_random*.whl %WHEELS_OUTPUT_FOLDER%
if errorlevel 1 exit 1
) ELSE (
rem Build conda package
%PYTHON% -m pip install --no-build-isolation --no-deps .
if errorlevel 1 exit 1
)
%PYTHON% -m pip install --no-build-isolation --no-deps .
if errorlevel 1 exit 1
Loading
Loading