Commit d50caafc authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'wheels' into 'ducc0'

Binary wheel support

See merge request !115
parents 04fa4ee8 98d4ce1d
Pipeline #107811 passed with stages
in 18 minutes and 49 seconds
name: ducc-wheels
on: [push]
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install --user --upgrade setuptools pybind11 pytest pytest-timeout numpy scipy wheel cibuildwheel
- run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: auto64
CIBW_ENVIRONMENT: DUCC0_OPTIMIZATION=portable
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux2014
CIBW_MANYLINUX_S390X_IMAGE: manylinux2014
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: manylinux2014
CIBW_MANYLINUX_PYPY_I686_IMAGE: manylinux2014
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
name: ducc-tests
on: [push]
jobs:
test-linux:
runs-on: ubuntu-20.04
test-standard:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macOS-10.15, macos-11.0, windows-2019]
steps:
- uses: actions/checkout@v2
- run: python3 -m pip install --user --upgrade setuptools pybind11 pytest scipy
- run: python3 -m pip install --user .
- run: python3 -m pytest python/test -x
- uses: actions/setup-python@v2
- run: python -m pip install --user --upgrade setuptools pybind11 pytest numpy scipy
- run: python -m pip install --user .
- run: python -m pytest python/test -x
test-linuxold:
runs-on: ubuntu-18.04
steps:
......@@ -22,7 +26,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: python3 -m pip install --user --upgrade setuptools pybind11 pytest scipy
- uses: actions/setup-python@v2
- run: python -m pip install --user --upgrade setuptools pybind11 pytest scipy
- run: wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
- run: sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
- run: sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
......@@ -32,25 +37,4 @@ jobs:
- run: |
source /opt/intel/oneapi/setvars.sh intel64
DUCC0_LFLAGS="-lsvml" CC=icpx python3 -m pip install --user .
python3 -m pytest python/test -x
test-macos10:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- run: python3 -m pip install --user --upgrade setuptools pybind11 pytest scipy
- run: python3 -m pip install --user .
- run: python3 -m pytest python/test -x
test-macos11:
runs-on: macos-11.0
steps:
- uses: actions/checkout@v2
- run: python3 -m pip install --user --upgrade setuptools pybind11 pytest numpy scipy
- run: python3 -m pip install --user .
- run: python3 -m pytest python/test -x
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: python -m pip install --user --upgrade setuptools pybind11 pytest pytest-timeout scipy
- run: python -m pip install --user .
- run: python -m pytest python/test -x
python -m pytest python/test -x
0.19.0:
- general:
- binary wheels can now be built and uploaded to PyPI; the installation
instructions have been updated accordingly. Please provide feedback in case
of problems!
- fft:
- C++ sources for FFT calculation now have their own subdirectory.
- new function `r2r_fftw`, which supports FFTW's halfcomplex storage scheme.
- new function `convolve_axis`, which performs efficient convolution of arrays
with arbitrary 1D kernels, optionally followed by zero-padding/truncation.
- C++ sources for FFT calculation now have their own subdirectory.
0.18.0:
......
......@@ -11,10 +11,9 @@ interface.
### Requirements
- [Python >= 3.6](https://www.python.org/)
- [pybind11](https://github.com/pybind/pybind11)
(only during compiling/installation)
- a C++17-capable compiler, e.g.
- [Python >= 3.7](https://www.python.org/)
- only when compiling from source: [pybind11](https://github.com/pybind/pybind11)
- only when compiling from source: a C++17-capable compiler, e.g.
- `g++` 7 or later
- `clang++`
- MSVC 2019 or later
......@@ -33,18 +32,17 @@ DUCC can be installed using a simple `pip` invocation:
pip3 install --user ducc0
This will download the source package and compile it to a binary that is
optimized for the host CPU, but will probably not run on other computers
with slightly different CPUs.
In most cases this will download and install a binary wheel.
However, the performance of the installed package may not be optimal, since
the wheel has to work on all CPUs of a given architecture (e.g. x86_64) and
will therefore probably not use all features present in your local CPU.
At the cost of performance (typically factors of 1.5 to 2) it is possible to
generate a binary which will work on all CPUs of a given architecture (e.g.
x86_64). This can be done via
It is therefore recommended to install from source is possible, using the
command
DUCC0_OPTIMIZATION=portable pip3 install --user ducc0
pip3 install --no-binary ducc0 --user ducc0
NOTE: compilation of the code can take a significant amount of time
(several minutes).
NOTE: compilation can take a significant amount of time (several minutes).
Installing multiple versions simultaneously
......
[project]
requires-python = ">=3.7"
[build-system]
requires = ["setuptools >= 40.6.0", "pybind11 >= 2.6.0", "numpy >= 1.17.0"]
build-backend = "setuptools.build_meta"
......@@ -8,7 +8,7 @@ from setuptools import setup, Extension
import pybind11
pkgname = 'ducc0'
version = '0.18.0'
version = '0.19.0'
user_cflags = os.getenv("DUCC0_CFLAGS", "").split(" ")
user_cflags = [x for x in user_cflags if x != ""]
......@@ -56,9 +56,7 @@ define_macros = [("PKGNAME", pkgname),
if sys.platform == 'darwin':
import distutils.sysconfig
extra_compile_args += ['-mmacosx-version-min=10.14']
python_module_link_args += ['-mmacosx-version-min=10.14', '-bundle']
cfg_vars = distutils.sysconfig.get_config_vars()
cfg_vars['LDSHARED'] = cfg_vars['LDSHARED'].replace('-bundle', '')
python_module_link_args += ['-mmacosx-version-min=10.14']
elif sys.platform == 'win32':
extra_compile_args = ['/EHsc', '/std:c++17']
if do_optimize:
......@@ -118,7 +116,7 @@ setup(name=pkgname,
author='Martin Reinecke',
author_email='martin@mpa-garching.mpg.de',
packages=[],
python_requires=">=3.6",
python_requires=">=3.7",
ext_modules=extensions,
install_requires=['numpy>=1.17.0'],
license="GPLv2+",
......
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