TomographicImaging / CCPi-Regularisation-Toolkit

The set of CPU/GPU optimised regularisation modules for iterative image reconstruction and other image processing tasks
Apache License 2.0
49 stars 25 forks source link

Use setuptools #182

Closed paskino closed 5 months ago

paskino commented 6 months ago

This PR uses setuptools, pip and cythonize to build and install the python wrapper. A new pyproject.toml file is added in src/Python directory.

Although it builds I still have troubles in testing after a local build as in #178

Notice that this PR simplifies the setup file and adds a second Extension in the setup command with the CMake variables SETUP_GPU_WRAPPERS and GPU_EXTRA_LIBRARIES.

This is built with the cythonize command

https://github.com/vais-ral/CCPi-Regularisation-Toolkit/blob/e229a7219797938e200174b8262a861ee766fb3f/src/Python/setup-regularisers.py.in#L57-L77

paskino commented 6 months ago

conda build is failing with

error: Error: setup script specifies an absolute path:

    /home/jenkins/conda-bld/ccpi-regulariser_1709812762250/work/src/Python/src/cpu_regularisers.cpp

setup() arguments must *always* be /-separated paths relative to the
setup.py directory, *never* absolute paths.
paskino commented 5 months ago

@casperdcl and I tried many things but we couldn't make cython build correctly.

Given https://github.com/vais-ral/CCPi-Regularisation-Toolkit/issues/178#issuecomment-1862593404 I am working at removing the Cython interface using ctypes.

See https://github.com/vais-ral/CCPi-Regularisation-Toolkit/blob/use_ctypes/demos/test_ctypes.py