Commit 0bc7b57d authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'develop' into 'master'

Develop

See merge request !8
parents a386e0d0 aede6bf7
......@@ -76,7 +76,7 @@ shape_t makeaxes(const py::array &in, py::object axes)
throw runtime_error("unsupported data type");
template<typename T> py::array xfftn_internal(const py::array &in,
const shape_t &axes, double fct, bool inplace, bool fwd, size_t nthreads)
const shape_t &axes, long double fct, bool inplace, bool fwd, size_t nthreads)
{
auto dims(copy_shape(in));
py::array res = inplace ? in : py::array_t<complex<T>>(dims);
......@@ -102,7 +102,7 @@ py::array ifftn(const py::array &a, py::object axes, double fct, bool inplace,
{ return xfftn(a, axes, fct, inplace, false, nthreads); }
template<typename T> py::array rfftn_internal(const py::array &in,
py::object axes_, T fct, size_t nthreads)
py::object axes_, long double fct, size_t nthreads)
{
auto axes = makeaxes(in, axes_);
auto dims_in(copy_shape(in)), dims_out(dims_in);
......@@ -121,7 +121,7 @@ py::array rfftn(const py::array &in, py::object axes_, double fct,
}
template<typename T> py::array xrfft_scipy(const py::array &in,
size_t axis, double fct, bool inplace, bool fwd, size_t nthreads)
size_t axis, long double fct, bool inplace, bool fwd, size_t nthreads)
{
auto dims(copy_shape(in));
py::array res = inplace ? in : py::array_t<T>(dims);
......@@ -145,7 +145,7 @@ py::array irfft_scipy(const py::array &in, size_t axis, double fct,
nthreads))
}
template<typename T> py::array irfftn_internal(const py::array &in,
py::object axes_, size_t lastsize, T fct, size_t nthreads)
py::object axes_, size_t lastsize, long double fct, size_t nthreads)
{
auto axes = makeaxes(in, axes_);
size_t axis = axes.back();
......@@ -169,7 +169,7 @@ py::array irfftn(const py::array &in, py::object axes_, size_t lastsize,
}
template<typename T> py::array hartley_internal(const py::array &in,
py::object axes_, double fct, bool inplace, size_t nthreads)
py::object axes_, long double fct, bool inplace, size_t nthreads)
{
auto dims(copy_shape(in));
py::array res = inplace ? in : py::array_t<T>(dims);
......
from setuptools import setup, Extension
import sys
import sysconfig
import os.path
import distutils.sysconfig
class _deferred_pybind11_include(object):
......@@ -15,31 +11,30 @@ class _deferred_pybind11_include(object):
return pybind11.get_include(self.user)
include_dirs = ['./', _deferred_pybind11_include(True),
_deferred_pybind11_include()]
extra_compile_args = []
include_dirs = ['./', _deferred_pybind11_include(),
_deferred_pybind11_include(True)]
python_module_link_args = []
base_library_link_args = []
if sys.platform == 'darwin':
import distutils.sysconfig
extra_compile_args += ['--std=c++11', '--stdlib=libc++', '-mmacosx-version-min=10.9']
vars = distutils.sysconfig.get_config_vars()
vars['LDSHARED'] = vars['LDSHARED'].replace('-bundle', '')
python_module_link_args+=['-bundle']
base_library_link_args+=['-dynamiclib']
else:
extra_compile_args += ['--std=c++11', '-march=native', '-O3', '-Wfatal-errors', '-Wno-ignored-attributes', '-DPOCKETFFT_OPENMP', '-fopenmp', '-Wfloat-conversion' ,'-Wsign-conversion', '-Wconversion' ,'-W', '-Wall']
python_module_link_args += ['-march=native', '-Wl,-rpath,$ORIGIN', '-fopenmp']
# if you don't want debugging info, add "-s" to python_module_link_args
def get_extension_modules():
pocketfft_library = Extension('pypocketfft',
sources=['pypocketfft.cc'],
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=python_module_link_args)
return [pocketfft_library]
return [Extension('pypocketfft',
sources=['pypocketfft.cc'],
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=python_module_link_args)]
setup(name='pypocketfft',
......@@ -49,7 +44,7 @@ setup(name='pypocketfft',
author='Martin Reinecke',
author_email='martin@mpa-garching.mpg.de',
packages=[],
setup_requires=['numpy>=1.10.4', 'pybind11>=2.2.1'],
setup_requires=['numpy>=1.15.0', 'pybind11>=2.2.4'],
ext_modules=get_extension_modules(),
install_requires=['numpy>=1.10.4', 'pybind11>=2.2.1']
install_requires=['numpy>=1.15.0', 'pybind11>=2.2.4']
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment