1
1
#!/usr/bin/env python
2
+ """mpi4py-fft -- Parallel Fast Fourier Transforms (FFTs) using MPI for Python"""
2
3
3
4
import os
4
5
import sys
@@ -33,6 +34,8 @@ def get_prefix_dirs():
33
34
append (dirs , sys .prefix )
34
35
if 'CONDA_BUILD' not in os .environ :
35
36
append (dirs , '/usr' )
37
+ append (dirs , '/usr/local' )
38
+ append (dirs , '/opt/homebrew' )
36
39
return dirs
37
40
38
41
def get_include_dirs ():
@@ -101,10 +104,10 @@ def generate_extensions(fftwlibs, force=True):
101
104
def remove_extensions (fftwlibs ):
102
105
"""Remove generated files"""
103
106
for fname in (
104
- 'utilities.c' ,
105
- 'fftw_xfftn.c' ,
106
- 'fftwf_xfftn.c' ,
107
- 'fftwl_xfftn.c' ,
107
+ 'utilities.c' ,
108
+ 'fftw_xfftn.c' ,
109
+ 'fftwf_xfftn.c' ,
110
+ 'fftwl_xfftn.c' ,
108
111
):
109
112
dst = os .path .join (fftwdir , fname )
110
113
try :
@@ -116,10 +119,10 @@ def remove_extensions(fftwlibs):
116
119
continue
117
120
p = 'fftw' + prec_map [d ]+ '_'
118
121
for fname in (
119
- 'fftw_planxfftn.h' ,
120
- 'fftw_planxfftn.c' ,
121
- 'fftw_xfftn.pyx' ,
122
- 'fftw_xfftn.pxd' ,
122
+ 'fftw_planxfftn.h' ,
123
+ 'fftw_planxfftn.c' ,
124
+ 'fftw_xfftn.pyx' ,
125
+ 'fftw_xfftn.pxd' ,
123
126
):
124
127
dst = os .path .join (fftwdir , fname .replace ('fftw_' , p ))
125
128
try :
@@ -131,20 +134,31 @@ def get_extensions():
131
134
"""Return list of extension modules"""
132
135
include_dirs = get_include_dirs ()
133
136
library_dirs = get_library_dirs ()
134
- ext = [Extension ("mpi4py_fft.fftw.utilities" ,
135
- sources = [os .path .join (fftwdir , "utilities.pyx" )],
136
- include_dirs = include_dirs )]
137
+ ext = [
138
+ Extension (
139
+ "mpi4py_fft.fftw.utilities" ,
140
+ sources = [os .path .join (fftwdir , "utilities.pyx" )],
141
+ define_macros = [('NPY_NO_DEPRECATED_API' , 'NPY_1_7_API_VERSION' )],
142
+ include_dirs = include_dirs ,
143
+ ),
144
+ ]
137
145
138
146
fftwlibs = get_fftw_libs ()
139
147
for d , libs in fftwlibs .items ():
140
- p = 'fftw' + prec_map [d ]+ '_'
141
- ext .append (Extension ("mpi4py_fft.fftw.{}xfftn" .format (p ),
142
- sources = [os .path .join (fftwdir , "{}xfftn.pyx" .format (p )),
143
- os .path .join (fftwdir , "{}planxfftn.c" .format (p ))],
144
- #define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')],
145
- libraries = libs ,
146
- include_dirs = include_dirs ,
147
- library_dirs = library_dirs ))
148
+ p = 'fftw' + prec_map [d ] + '_'
149
+ ext .append (
150
+ Extension (
151
+ "mpi4py_fft.fftw.{}xfftn" .format (p ),
152
+ sources = [
153
+ os .path .join (fftwdir , "{}xfftn.pyx" .format (p )),
154
+ os .path .join (fftwdir , "{}planxfftn.c" .format (p )),
155
+ ],
156
+ define_macros = [('NPY_NO_DEPRECATED_API' , 'NPY_1_7_API_VERSION' )],
157
+ libraries = libs ,
158
+ include_dirs = include_dirs ,
159
+ library_dirs = library_dirs ,
160
+ )
161
+ )
148
162
return ext
149
163
150
164
@@ -190,14 +204,19 @@ def version():
190
204
if __name__ == '__main__' :
191
205
setup (name = "mpi4py-fft" ,
192
206
version = version (),
193
- description = "mpi4py-fft -- Parallel Fast Fourier Transforms (FFTs) using MPI for Python" ,
207
+ description = __doc__ . strip () ,
194
208
long_description = long_description ,
209
+ long_description_content_type = 'text/x-rst' ,
195
210
author = "Lisandro Dalcin and Mikael Mortensen" ,
196
- url = 'https://github.com/mpi4py/mpi4py-fft' ,
197
- packages = ["mpi4py_fft" ,
198
- "mpi4py_fft.fftw" ,
199
- "mpi4py_fft.io" ],
200
- package_dir = {"mpi4py_fft" : "mpi4py_fft" },
211
+ url = "https://github.com/mpi4py/mpi4py-fft" ,
212
+ packages = [
213
+ "mpi4py_fft" ,
214
+ "mpi4py_fft.fftw" ,
215
+ "mpi4py_fft.io" ,
216
+ ],
217
+ package_dir = {
218
+ "mpi4py_fft" : "mpi4py_fft" ,
219
+ },
201
220
classifiers = [
202
221
'Development Status :: 4 - Beta' ,
203
222
'Environment :: Console' ,
@@ -209,10 +228,9 @@ def version():
209
228
'License :: OSI Approved :: BSD License' ,
210
229
'Topic :: Scientific/Engineering :: Mathematics' ,
211
230
'Topic :: Software Development :: Libraries :: Python Modules' ,
212
- ],
231
+ ],
232
+ keywords = ['Python' , 'FFTW' , 'FFT' , 'DCT' , 'DST' , 'MPI' ],
213
233
distclass = Dist ,
214
234
ext_modules = get_extensions (),
215
235
install_requires = ["mpi4py" , "numpy" ],
216
- setup_requires = ["setuptools>=18.0" , "cython>=0.25" ],
217
- keywords = ['Python' , 'FFTW' , 'FFT' , 'DCT' , 'DST' , 'MPI' ]
218
236
)
0 commit comments