True-North-Intelligent-Algorithms / tnia-python

A collection of useful python utilities from True North Intelligent Algorithms
BSD 3-Clause "New" or "Revised" License
28 stars 2 forks source link

Sorry, I can not install clij2-fft properly. #1

Open ZhenhongDu opened 2 years ago

ZhenhongDu commented 2 years ago

I guess the clij2fft.dll file is missed. Could you please give me a compiled DLL file?

The error informations appeared after running cd clij2-fft/python pip install .

DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Requirement already satisfied: numpy in d:\anaconda3\envs\decon\lib\site-packages (from clij2-fft==0.13) (1.21.6)
Requirement already satisfied: dask in d:\anaconda3\envs\decon\lib\site-packages (from clij2-fft==0.13) (2022.2.0)
Requirement already satisfied: dask-image in d:\anaconda3\envs\decon\lib\site-packages (from clij2-fft==0.13) (2021.12.0)
Requirement already satisfied: cloudpickle>=1.1.1 in d:\anaconda3\envs\decon\lib\site-packages (from dask->clij2-fft==0.13) (2.1.0)
Requirement already satisfied: packaging>=20.0 in d:\anaconda3\envs\decon\lib\site-packages (from dask->clij2-fft==0.13) (21.3)
Requirement already satisfied: pyyaml>=5.3.1 in d:\anaconda3\envs\decon\lib\site-packages (from dask->clij2-fft==0.13) (6.0)
Requirement already satisfied: fsspec>=0.6.0 in d:\anaconda3\envs\decon\lib\site-packages (from dask->clij2-fft==0.13) (2022.5.0)
Requirement already satisfied: toolz>=0.8.2 in d:\anaconda3\envs\decon\lib\site-packages (from dask->clij2-fft==0.13) (0.11.2)
Requirement already satisfied: partd>=0.3.10 in d:\anaconda3\envs\decon\lib\site-packages (from dask->clij2-fft==0.13) (1.2.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in d:\anaconda3\envs\decon\lib\site-packages (from packaging>=20.0->dask->clij2-fft==0.13) (3.0.8)
Requirement already satisfied: locket in d:\anaconda3\envs\decon\lib\site-packages (from partd>=0.3.10->dask->clij2-fft==0.13) (1.0.0)
Requirement already satisfied: scipy>=0.19.1 in d:\anaconda3\envs\decon\lib\site-packages (from dask-image->clij2-fft==0.13) (1.7.3)
Requirement already satisfied: pims>=0.4.1 in d:\anaconda3\envs\decon\lib\site-packages (from dask-image->clij2-fft==0.13) (0.5)
Requirement already satisfied: six>=1.8 in d:\anaconda3\envs\decon\lib\site-packages (from pims>=0.4.1->dask-image->clij2-fft==0.13) (1.16.0)
Requirement already satisfied: slicerator>=0.9.8 in d:\anaconda3\envs\decon\lib\site-packages (from pims>=0.4.1->dask-image->clij2-fft==0.13) (1.1.0)
Building wheels for collected packages: clij2-fft
  Building wheel for clij2-fft (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\Anaconda3\envs\decon\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-req-build-qn488ngq\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-req-build-qn488ngq\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\admin\AppData\Local\Temp\pip-wheel-116i4n_k'
       cwd: C:\Users\admin\AppData\Local\Temp\pip-req-build-qn488ngq\
  Complete output (38 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\clij2fft
  copying clij2fft\libs.py -> build\lib\clij2fft
  copying clij2fft\pad.py -> build\lib\clij2fft
  copying clij2fft\richardson_lucy.py -> build\lib\clij2fft
  copying clij2fft\test_padding.py -> build\lib\clij2fft
  copying clij2fft\test_richardson_lucy.py -> build\lib\clij2fft
  copying clij2fft\test_richardson_lucy_dask.py -> build\lib\clij2fft
  copying clij2fft\test_richardson_lucy_nc.py -> build\lib\clij2fft
  copying clij2fft\test_sphere.py -> build\lib\clij2fft
  copying clij2fft\__init__.py -> build\lib\clij2fft
  D:\Anaconda3\envs\decon\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    setuptools.SetuptoolsDeprecationWarning,
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\clij2fft
  copying build\lib\clij2fft\libs.py -> build\bdist.win-amd64\wheel\.\clij2fft
  copying build\lib\clij2fft\pad.py -> build\bdist.win-amd64\wheel\.\clij2fft
  copying build\lib\clij2fft\richardson_lucy.py -> build\bdist.win-amd64\wheel\.\clij2fft
  copying build\lib\clij2fft\test_padding.py -> build\bdist.win-amd64\wheel\.\clij2fft
  copying build\lib\clij2fft\test_richardson_lucy.py -> build\bdist.win-amd64\wheel\.\clij2fft
  copying build\lib\clij2fft\test_richardson_lucy_dask.py -> build\bdist.win-amd64\wheel\.\clij2fft
  copying build\lib\clij2fft\test_richardson_lucy_nc.py -> build\bdist.win-amd64\wheel\.\clij2fft
  copying build\lib\clij2fft\test_sphere.py -> build\bdist.win-amd64\wheel\.\clij2fft
  copying build\lib\clij2fft\__init__.py -> build\bdist.win-amd64\wheel\.\clij2fft
  running install_data
  creating build\bdist.win-amd64\wheel\clij2_fft-0.13.data
  creating build\bdist.win-amd64\wheel\clij2_fft-0.13.data\data
  creating build\bdist.win-amd64\wheel\clij2_fft-0.13.data\data\Library
  creating build\bdist.win-amd64\wheel\clij2_fft-0.13.data\data\Library\bin
  error: can't copy 'lib\win64\clij2fft.dll': doesn't exist or not a regular file
  ----------------------------------------
  ERROR: Failed building wheel for clij2-fft
  Running setup.py clean for clij2-fft
Failed to build clij2-fft
Installing collected packages: clij2-fft
    Running setup.py install for clij2-fft ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Anaconda3\envs\decon\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-req-build-qn488ngq\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-req-build-qn488ngq\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-u6a7kjnw\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Anaconda3\envs\decon\Include\clij2-fft'
         cwd: C:\Users\admin\AppData\Local\Temp\pip-req-build-qn488ngq\
    Complete output (20 lines):
    running install
    D:\Anaconda3\envs\decon\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      setuptools.SetuptoolsDeprecationWarning,
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\clij2fft
    copying clij2fft\libs.py -> build\lib\clij2fft
    copying clij2fft\pad.py -> build\lib\clij2fft
    copying clij2fft\richardson_lucy.py -> build\lib\clij2fft
    copying clij2fft\test_padding.py -> build\lib\clij2fft
    copying clij2fft\test_richardson_lucy.py -> build\lib\clij2fft
    copying clij2fft\test_richardson_lucy_dask.py -> build\lib\clij2fft
    copying clij2fft\test_richardson_lucy_nc.py -> build\lib\clij2fft
    copying clij2fft\test_sphere.py -> build\lib\clij2fft
    copying clij2fft\__init__.py -> build\lib\clij2fft
    running install_lib
    running install_data
    error: can't copy 'lib\win64\clij2fft.dll': doesn't exist or not a regular file
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Anaconda3\envs\decon\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-req-build-qn488ngq\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-req-build-qn488ngq\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-u6a7kjnw\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Anaconda3\envs\decon\Include\clij2-fft' Check the logs for full command output.
ZhenhongDu commented 2 years ago

I've tried both Linux and Windows I tried to build the clij2-fft, it failed

gcc and cmake had been installed in ubuntu18.04

I use this command to install clFFT

(decon) amax@amax:/mnt/dzh/extract_psf/clij2-fft/native$ sudo apt install clfft-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
clfft-client is already the newest version (2.12.2-1build4).
0 upgraded, 0 newly installed, 0 to remove and 381 not upgraded.

And build the cppbuild.sh file in the './native' folder

(decon) amax@amax:/mnt/dzh/extract_psf/clij2-fft/native$ sh cppbuild.sh
cppbuild.sh: 7: [[: not found
cppbuild.sh: 8: [[: not found
cppbuild.sh: 9: [[: not found
cppbuild.sh: 10: [[: not found
cppbuild.sh: 11: [[: not found
cppbuild.sh: 13: Syntax error: "(" unexpected

I did not know how to solve this problem, Could please give me a help?

bnorthan commented 1 year ago

Sorry for the long delay. I missed this somehow.

This notebook shows how to install the clij2fft library https://github.com/True-North-Intelligent-Algorithms/tnia-python/blob/main/notebooks/Deconvolution/Getting-started.ipynb

And the clij2fft code base can be found here https://github.com/clij/clij2-fft. The readme links to more detailed instructions for building the code.

Again sorry for the delay in replying will monitor the github issues more closely moving forward.

Dr2-JMM commented 1 year ago

In the instructions, the command to install clitj2 fft is incomplete, the ¨fft¨ is missing

running :

pip install --index-url https://test.pypi.org/simple/ --no-deps clij2-fft

worked for me