Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,22 @@ The package also provides `mkl_fft.interfaces.numpy_fft` and `mkl_fft.interfaces
---

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

To build `mkl_fft` from sources on Linux with conda:
- install `python` and `mkl-devel` in a conda environment;
- execute `export MKLROOT=$CONDA_PREFIX`
- execute `python -m pip install .`
- create a virtual environemnt: `python3 -m venv fft_env`
- activate the environment: `source fft_env/bin/activate`
- install a recent version of OneMKL, if necessary
- execute `source /path_to_oneapi/mkl/latest/env/vars.sh`
- `git clone https://github.com/IntelPython/mkl_fft.git mkl_fft`
- `cd mkl_fft`
- `python -m pip install .`
- `cd ..`
- `python -c "import mkl_fft"`

To build `mkl_fft` from sources on Linux with conda follow these steps:
- `conda create -n fft_env python=3.12 mkl-devel`
- `conda activate fft_env`
- `export MKLROOT=$CONDA_PREFIX`
- `git clone https://github.com/IntelPython/mkl_fft.git mkl_fft`
- `cd mkl_fft`
- `python -m pip install .`
- `cd ..`
- `python -c "import mkl_fft"`
4 changes: 2 additions & 2 deletions mkl_fft/_numpy_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _cook_nd_args(a, s=None, axes=None, invreal=False):
shapeless = False
s = list(s)
if axes is None:
if not shapeless and np.__version__ >= "2.0":
if not shapeless and np.lib.NumpyVersion(np.__version__) >= "2.0.0":
msg = (
"`axes` should not be `None` if `s` is not `None` "
"(Deprecated in NumPy 2.0). In a future version of NumPy, "
Expand All @@ -85,7 +85,7 @@ def _cook_nd_args(a, s=None, axes=None, invreal=False):
raise ValueError("Shape and axes have different lengths.")
if invreal and shapeless:
s[-1] = (a.shape[axes[-1]] - 1) * 2
if None in s and np.__version__ >= "2.0":
if None in s and np.lib.NumpyVersion(np.__version__) >= "2.0.0":
msg = (
"Passing an array containing `None` values to `s` is "
"deprecated in NumPy 2.0 and will raise an error in "
Expand Down
3 changes: 2 additions & 1 deletion mkl_fft/tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
import pytest

requires_numpy_2 = pytest.mark.skipif(
np.__version__ < "2.0", reason="Requires NumPy >= 2.0"
np.lib.NumpyVersion(np.__version__) < "2.0.0",
reason="Requires NumPy >= 2.0.0",
)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017-2025, Intel Corporation
# Copyright (c) 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
Expand Down
Loading