Skip to content

Commit 0bd8e36

Browse files
author
Vahid Tavanashad
committed
update_toml
1 parent e1325c5 commit 0bd8e36

File tree

4 files changed

+98
-93
lines changed

4 files changed

+98
-93
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ The package also provides `mkl_fft._numpy_fft` and `mkl_fft._scipy_fft` interfac
8282

8383
To build ``mkl_fft`` from sources on Linux:
8484
- install a recent version of MKL, if necessary;
85-
- execute ``source /path/to/mklroot/bin/mklvars.sh intel64`` ;
86-
- execute ``pip install .``
85+
- execute ``source /path_to_oneapi/mkl/latest/env/vars.sh`` ;
86+
- execute ``python -m pip install .``

mkl_fft/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.3.11'
1+
__version__= "1.3.11"

pyproject.toml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Copyright (c) 2025, Intel Corporation
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions are met:
5+
#
6+
# * Redistributions of source code must retain the above copyright notice,
7+
# this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of Intel Corporation nor the names of its contributors
12+
# may be used to endorse or promote products derived from this software
13+
# without specific prior written permission.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
19+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
26+
[build-system]
27+
requires = ["setuptools", "Cython", "numpy"]
28+
build-backend = "setuptools.build_meta"
29+
30+
[project]
31+
name = "mkl_fft"
32+
dynamic = ["version"]
33+
description = "MKL-based FFT transforms for NumPy arrays"
34+
readme = "README.md"
35+
requires-python = ">=3.7"
36+
license = { text = "BSD" }
37+
authors = [
38+
{ name = "Intel Corporation", email = "[email protected]" }
39+
]
40+
keywords = ["DFTI", "FFT", "Fourier", "MKL"]
41+
classifiers = [
42+
"Development Status :: 5 - Production/Stable",
43+
"Intended Audience :: Science/Research",
44+
"Intended Audience :: Developers",
45+
"License :: OSI Approved",
46+
"Programming Language :: C",
47+
"Programming Language :: Python",
48+
"Programming Language :: Python :: 3",
49+
"Programming Language :: Python :: 3.9",
50+
"Programming Language :: Python :: 3.10",
51+
"Programming Language :: Python :: 3.11",
52+
"Programming Language :: Python :: 3.12",
53+
"Programming Language :: Python :: Implementation :: CPython",
54+
"Topic :: Software Development",
55+
"Topic :: Scientific/Engineering",
56+
"Operating System :: Microsoft :: Windows",
57+
"Operating System :: POSIX",
58+
"Operating System :: Unix",
59+
"Operating System :: MacOS"
60+
]
61+
dependencies = ["numpy >=1.16", "mkl", "mkl-service"]
62+
63+
[project.optional-dependencies]
64+
test = ["pytest"]
65+
66+
[project.urls]
67+
Homepage = "http://github.com/IntelPython/mkl_fft"
68+
Download = "http://github.com/IntelPython/mkl_fft"
69+
70+
[tool.setuptools]
71+
packages = ["mkl_fft", "mkl_fft.interfaces"]
72+
include-package-data = true
73+
74+
[tool.setuptools.package-data]
75+
"mkl_fft" = ["tests/*.py"]
76+
77+
[tool.setuptools.dynamic]
78+
version = {attr = "mkl_fft._version.__version__"}

setup.py

Lines changed: 17 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -24,61 +24,21 @@
2424
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2525
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626

27-
import io
2827
import os
29-
import re
30-
from os.path import join
31-
import Cython.Build
32-
from setuptools import setup, Extension
28+
import sys
3329
import numpy as np
34-
from _vendored.conv_template import process_file as process_c_file
35-
36-
with io.open('mkl_fft/_version.py', 'rt', encoding='utf8') as f:
37-
version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
38-
39-
with open("README.md", "r", encoding="utf-8") as file:
40-
long_description = file.read()
30+
from setuptools import setup, Extension
31+
import Cython.Build
4132

42-
VERSION = version
33+
sys.path.insert(0, os.path.dirname(__file__)) # Ensures local imports work
34+
from _vendored.conv_template import process_file as process_c_file
4335

44-
CLASSIFIERS = """\
45-
Development Status :: 5 - Production/Stable
46-
Intended Audience :: Science/Research
47-
Intended Audience :: Developers
48-
License :: OSI Approved
49-
Programming Language :: C
50-
Programming Language :: Python
51-
Programming Language :: Python :: 3
52-
Programming Language :: Python :: 3.9
53-
Programming Language :: Python :: 3.10
54-
Programming Language :: Python :: 3.11
55-
Programming Language :: Python :: 3.12
56-
Programming Language :: Python :: Implementation :: CPython
57-
Topic :: Software Development
58-
Topic :: Scientific/Engineering
59-
Operating System :: Microsoft :: Windows
60-
Operating System :: POSIX
61-
Operating System :: Unix
62-
Operating System :: MacOS
63-
"""
6436

6537
def extensions():
6638
mkl_root = os.environ.get('MKLROOT', None)
67-
if mkl_root:
68-
mkl_info = {
69-
'include_dirs': [join(mkl_root, 'include')],
70-
'library_dirs': [join(mkl_root, 'lib'), join(mkl_root, 'lib', 'intel64')],
71-
'libraries': ['mkl_rt']
72-
}
73-
else:
74-
try:
75-
mkl_info = get_info('mkl')
76-
except:
77-
mkl_info = dict()
78-
79-
mkl_include_dirs = mkl_info.get('include_dirs', [])
80-
mkl_library_dirs = mkl_info.get('library_dirs', [])
81-
mkl_libraries = mkl_info.get('libraries', ['mkl_rt'])
39+
mkl_include_dirs = [os.path.join(mkl_root, 'include')] if mkl_root else []
40+
mkl_library_dirs = [os.path.join(mkl_root, 'lib'), os.path.join(mkl_root, 'lib', 'intel64')] if mkl_root else []
41+
mkl_libraries = ['mkl_rt']
8242

8343
mklfft_templ = os.path.join("mkl_fft", "src", "mklfft.c.src")
8444
processed_mklfft_fn = os.path.join("mkl_fft", "src", "mklfft.c")
@@ -90,52 +50,19 @@ def extensions():
9050
return [
9151
Extension(
9252
"mkl_fft._pydfti",
93-
[
94-
os.path.join("mkl_fft", "_pydfti.pyx"),
95-
os.path.join("mkl_fft", "src", "mklfft.c"),
96-
],
97-
depends = [
98-
os.path.join("mkl_fft", "src", 'mklfft.h'),
99-
os.path.join("mkl_fft", "src", "multi_iter.h")
100-
],
101-
include_dirs = [os.path.join("mkl_fft", "src"), np.get_include()] + mkl_include_dirs,
102-
libraries = mkl_libraries,
103-
library_dirs = mkl_library_dirs,
104-
extra_compile_args = [
105-
'-DNDEBUG',
106-
# '-ggdb', '-O0', '-Wall', '-Wextra', '-DDEBUG',
53+
sources=[
54+
"mkl_fft/_pydfti.pyx",
55+
"mkl_fft/src/mklfft.c",
10756
],
108-
define_macros=[("NPY_NO_DEPRECATED_API", None), ("PY_ARRAY_UNIQUE_SYMBOL", "mkl_fft_ext")]
57+
include_dirs=["mkl_fft/src", np.get_include()] + mkl_include_dirs,
58+
libraries=mkl_libraries,
59+
library_dirs=mkl_library_dirs,
60+
extra_compile_args=['-DNDEBUG'],
61+
define_macros=[("NPY_NO_DEPRECATED_API", None), ("PY_ARRAY_UNIQUE_SYMBOL", "mkl_fft_ext")],
10962
)
11063
]
11164

112-
11365
setup(
114-
name = "mkl_fft",
115-
maintainer = "Intel Corp.",
116-
maintainer_email = "[email protected]",
117-
description = "MKL-based FFT transforms for NumPy arrays",
118-
version = version,
119-
cmdclass={'build_ext': Cython.Build.build_ext},
120-
packages=[
121-
"mkl_fft",
122-
"mkl_fft.interfaces",
123-
],
124-
package_data={"mkl_fft": ["tests/*.py"]},
125-
include_package_data=True,
12666
ext_modules=extensions(),
127-
zip_safe=False,
128-
long_description = long_description,
129-
long_description_content_type="text/markdown",
130-
url = "http://github.com/IntelPython/mkl_fft",
131-
author = "Intel Corporation",
132-
download_url = "http://github.com/IntelPython/mkl_fft",
133-
license = "BSD",
134-
classifiers = [_f for _f in CLASSIFIERS.split('\n') if _f],
135-
platforms = ["Windows", "Linux", "Mac OS-X"],
136-
test_suite = "pytest",
137-
python_requires = '>=3.7',
138-
setup_requires=["Cython",],
139-
install_requires = ["numpy >=1.16", "mkl"],
140-
keywords=["DFTI", "FFT", "Fourier", "MKL",],
67+
cmdclass={'build_ext': Cython.Build.build_ext},
14168
)

0 commit comments

Comments
 (0)