EXTS.append( Extension('selectinf.randomized.selective_MLE_utils', [ 'selectinf/randomized/selective_MLE_utils.pyx', 'C-software/src/selective_mle.c', 'C-software/src/cox_fns.c' ], libraries=[], include_dirs=['C-software/src'])) # Cython is a dependency for building extensions, iff we don't have stamped # up pyx and c files. build_ext, need_cython = cyproc_exts(EXTS, info.CYTHON_MIN_VERSION, 'pyx-stamps') # Add numpy includes when building extension. build_ext = make_np_ext_builder(build_ext) # Check dependencies, maybe add to setuptools lists if need_cython: SetupDependency('Cython', info.CYTHON_MIN_VERSION, req_type='install_requires', heavy=False).check_fill(extra_setuptools_args) SetupDependency('numpy', info.NUMPY_MIN_VERSION, req_type='install_requires', heavy=True).check_fill(extra_setuptools_args) SetupDependency('scipy', info.SCIPY_MIN_VERSION, req_type='install_requires', heavy=True).check_fill(extra_setuptools_args)
build_ext, need_cython = cyproc_exts(EXTS, info.CYTHON_MIN_VERSION, 'pyx-stamps') # Add openmp flags if they work simple_test_c = """int main(int argc, char** argv) { return(0); }""" omp_test_c = """#include <omp.h> int main(int argc, char** argv) { return(0); }""" extbuilder = add_flag_checking( build_ext, [ [['/arch:SSE2'], [], simple_test_c, 'USING_VC_SSE2'], [['-msse2', '-mfpmath=sse'], [], simple_test_c, 'USING_GCC_SSE2'], [['-fopenmp'], ['-fopenmp'], omp_test_c, 'HAVE_OPENMP']], 'dipy') # Use ext builder to add np.get_include() at build time, not during setup.py # execution. extbuilder = make_np_ext_builder(extbuilder) if need_cython: SetupDependency('Cython', info.CYTHON_MIN_VERSION, req_type='install_requires', heavy=True).check_fill(extra_setuptools_args) SetupDependency('numpy', info.NUMPY_MIN_VERSION, req_type='install_requires', heavy=True).check_fill(extra_setuptools_args) SetupDependency('scipy', info.SCIPY_MIN_VERSION, req_type='install_requires', heavy=True).check_fill(extra_setuptools_args) SetupDependency('nibabel', info.NIBABEL_MIN_VERSION, req_type='install_requires', heavy=False).check_fill(extra_setuptools_args) cmdclass = dict(
# Test if it is a 32 bits version if not sys.maxsize > 2**32: # This flag is needed only on 32 bits msc_flag_defines += [ [['/arch:SSE2'], [], simple_test_c, 'USING_VC_SSE2'], ] flag_defines = msc_flag_defines if 'msc' in platform.python_compiler().lower( ) else gcc_flag_defines extbuilder = add_flag_checking(build_ext, flag_defines, 'dipy') # Use ext builder to add np.get_include() at build time, not during setup.py # execution. extbuilder = make_np_ext_builder(extbuilder) if need_cython: SetupDependency('Cython', info.CYTHON_MIN_VERSION, req_type='install_requires', heavy=True).check_fill(extra_setuptools_args) SetupDependency('numpy', info.NUMPY_MIN_VERSION, req_type='install_requires', heavy=True).check_fill(extra_setuptools_args) SetupDependency('scipy', info.SCIPY_MIN_VERSION, req_type='install_requires', heavy=True).check_fill(extra_setuptools_args) SetupDependency('nibabel', info.NIBABEL_MIN_VERSION,
EXTS = [] for modulename, other_sources in ( ("regreg.atoms.projl1_cython", []), ("regreg.atoms.mixed_lasso_cython", []), ("regreg.atoms.piecewise_linear", []), ): pyx_src = pjoin(*modulename.split(".")) + ".pyx" EXTS.append(Extension(modulename, [pyx_src] + other_sources)) # Cython is a dependency for building extensions, iff we don't have stamped # up pyx and c files. build_ext, need_cython = cyproc_exts(EXTS, info.CYTHON_MIN_VERSION, "pyx-stamps") # Add numpy includes when building extension. build_ext = make_np_ext_builder(build_ext) # Check dependencies, maybe add to setuptools lists if need_cython: SetupDependency("Cython", info.CYTHON_MIN_VERSION, req_type="install_requires", heavy=False).check_fill( extra_setuptools_args ) SetupDependency("numpy", info.NUMPY_MIN_VERSION, req_type="install_requires", heavy=True).check_fill( extra_setuptools_args ) SetupDependency("scipy", info.SCIPY_MIN_VERSION, req_type="install_requires", heavy=True).check_fill( extra_setuptools_args ) cmdclass = versioneer.get_cmdclass()