mortvest / hastl

HaSTL: A fast GPU implementation of STL decomposition with missing values and support for both CUDA and OpenCL
MIT License
10 stars 5 forks source link

ERROR: Could not build wheels for hastl, which is required to install pyproject.toml-based projects #3

Closed pipipercy closed 1 year ago

pipipercy commented 1 year ago

Dear mortvest, I got an error ERROR: Could not build wheels for hastl, which is required to install pyproject.toml-based projects when I done pip install hastl. Do you have any in-depth view on it. Very look forward to hearing from you.

mortvest commented 1 year ago

Hello,

Could you please provide me the following information:

1) What OS are you using? 2) What type of python installation are you using? Is it anaconda? 3) What python version are you running? 4) Have you followed the installation guide from README.md and used a Python virtual environment? 5) Can you copy-paste me the commands that you running and the output of the command line? Start with a clean directory and follow the guide from README.md.

pipipercy commented 1 year ago

Thanks for your replies. Here are the answers to these questions:

  1. Windows 10
  2. Miniconda
  3. Python 3.9.7
  4. Yes
>>>conda create --name hastl python=3.9

>>>conda activate hastl

>>>C:\Users\pjli\miniconda3\envs\hastl\python.exe -m pip install --upgrade pip

Requirement already satisfied: pip in c:\users\pjli\miniconda3\envs\hastl\lib\site-packages (23.1.2)
Collecting pip
Using cached pip-23.2.1-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 23.1.2
Uninstalling pip-23.1.2:
Successfully uninstalled pip-23.1.2
Successfully installed pip-23.2.1

>>>setx HASTL_BACKENDS "opencl multicore c cuda”

SUCCESS: Specified value was saved.

(hastl) E:\Desktop\hastl-main>pip install hastl
Collecting hastl
Using cached hastl-0.1.7.tar.gz (2.1 MB)
Preparing metadata ([[setup.py](http://setup.py/)](http://setup.py/)) ... done
Collecting futhark-ffi==0.14.2 (from hastl)
Using cached futhark_ffi-0.14.2-py3-none-any.whl (6.3 kB)
Collecting numpy (from futhark-ffi==0.14.2->hastl)
Obtaining dependency information for numpy from https://files.pythonhosted.org/packages/86/c7/f92afdefa2bccdf0bc357321a931adafb1a999bc84f8877a6ed786a69ccc/numpy-1.25.1-cp39-cp39-win_amd64.whl.metadata
Using cached numpy-1.25.1-cp39-cp39-win_amd64.whl.metadata (5.7 kB)
Collecting cffi (from futhark-ffi==0.14.2->hastl)
Using cached cffi-1.15.1-cp39-cp39-win_amd64.whl (179 kB)
Collecting pycparser (from cffi->futhark-ffi==0.14.2->hastl)
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using cached numpy-1.25.1-cp39-cp39-win_amd64.whl (15.1 MB)
Building wheels for collected packages: hastl
Building wheel for hastl ([[setup.py](http://setup.py/)](http://setup.py/)) ... error
error: subprocess-exited-with-error

× python [[setup.py](http://setup.py/)](http://setup.py/) bdist_wheel did not run successfully.
│ exit code: 1
╰─> [169 lines of output]
Attempting to compile following modules: ['./hastl/build_stl.py:build_stl_cuda', './hastl/build_stl.py:build_stl_multicore', './hastl/build_stl.py:build_stl_c', './hastl/build_stl.py:build_stl_opencl', './hastl/build_stl.py:build_loess_cuda', './hastl/build_stl.py:build_loess_c', './hastl/build_stl.py:build_loess_opencl', './hastl/build_stl.py:build_loess_multicore']
C:\Users\pjli\miniconda3\envs\hastl\lib\site-packages\setuptools\**init**.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

          ********************************************************************************
          Requirements should be satisfied by a PEP 517 installer.
          If you are using pip, you can try `pip install --use-pep517`.
          ********************************************************************************

  !!
    dist.fetch_build_eggs(dist.setup_requires)
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  Detected platform: win32
  Detected backend:  c
  Detected platform: win32
  Detected backend:  opencl
  Detected platform: win32
  Detected backend:  cuda
  Detected platform: win32
  Detected backend:  multicore
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\\lib.win-amd64-cpython-39
  creating build\\lib.win-amd64-cpython-39\\hastl
  copying hastl\\build_stl.py -> build\\lib.win-amd64-cpython-39\\hastl
  copying hastl\\loess.py -> build\\lib.win-amd64-cpython-39\\hastl
  copying hastl\\stl.py -> build\\lib.win-amd64-cpython-39\\hastl
  copying hastl\\__init__.py -> build\\lib.win-amd64-cpython-39\\hastl
  running build_ext
  generating cffi module 'build\\\\temp.win-amd64-cpython-39\\\\Release\\\\hastl._loess_multicore.c'
  creating build\\temp.win-amd64-cpython-39
  creating build\\temp.win-amd64-cpython-39\\Release
  generating cffi module 'build\\\\temp.win-amd64-cpython-39\\\\Release\\\\hastl._loess_opencl.c'
  generating cffi module 'build\\\\temp.win-amd64-cpython-39\\\\Release\\\\hastl._loess_c.c'
  generating cffi module 'build\\\\temp.win-amd64-cpython-39\\\\Release\\\\hastl._loess_cuda.c'
  generating cffi module 'build\\\\temp.win-amd64-cpython-39\\\\Release\\\\hastl._stl_opencl.c'
  generating cffi module 'build\\\\temp.win-amd64-cpython-39\\\\Release\\\\hastl._stl_c.c'
  generating cffi module 'build\\\\temp.win-amd64-cpython-39\\\\Release\\\\hastl._stl_multicore.c'
  generating cffi module 'build\\\\temp.win-amd64-cpython-39\\\\Release\\\\hastl._stl_cuda.c'
  building 'hastl._stl_cuda' extension
  creating build\\temp.win-amd64-cpython-39\\Release\\build
  creating build\\temp.win-amd64-cpython-39\\Release\\build\\temp.win-amd64-cpython-39
  creating build\\temp.win-amd64-cpython-39\\Release\\build\\temp.win-amd64-cpython-39\\Release
  "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\HostX86\\x64\\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\\Users\\pjli\\miniconda3\\envs\\hastl\\include -IC:\\Users\\pjli\\miniconda3\\envs\\hastl\\Include "-IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\include" "-IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\ATLMFC\\include" "-IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include" "-IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22000.0\\ucrt" "-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22000.0\\\\um" "-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22000.0\\\\shared" "-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22000.0\\\\winrt" "-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22000.0\\\\cppwinrt" "-IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\include" "-IC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22000.0\\ucrt" "-IC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22000.0\\um" "-IC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22000.0\\winrt" "-IC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22000.0\\shared" /Tcbuild\\temp.win-amd64-cpython-39\\Release\\hastl._stl_cuda.c /Fobuild\\temp.win-amd64-cpython-39\\Release\\build\\temp.win-amd64-cpython-39\\Release\\hastl._stl_cuda.obj -std=c99
  cl: 命令行 warning D9002 :忽略未知选项“-std=c99”
  hastl._stl_cuda.c
  build\\temp.win-amd64-cpython-39\\Release\\hastl._stl_cuda.c(600): fatal error C1083: 无法打开包括文件: “cuda.h”: No such file or directory
  error: command 'C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Community\\\\VC\\\\Tools\\\\MSVC\\\\14.36.32532\\\\bin\\\\HostX86\\\\x64\\\\cl.exe' failed with exit code 2
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for hastl
Running [[setup.py](http://setup.py/)](http://setup.py/) clean for hastl
Failed to build hastl
ERROR: Could not build wheels for hastl, which is required to install pyproject.toml-based projects

(hastl) E:\Desktop\hastl-main>
mortvest commented 1 year ago

Since you are using Windows, I sadly can not assist you. The library has been tested on various Linux systems and it is probably not going to work on a Windows machine.

pipipercy commented 1 year ago

I have tried to install it within a Linux system os (ubuntu). After I successfully install it. I still cannot use, could you give me some hints about this? Here are the commands I used in the ubuntu,

(env) li@DESKTOP-7PK1TSR:~/env$ pip list
Package                Version
---------------------- -------------
blinker                1.4
cffi                   1.15.1
command-not-found      0.3
cryptography           3.4.8
dbus-python            1.2.18
distro                 1.7.0
distro-info            1.1build1
f90nml                 1.4.3
futhark-ffi            0.14.2
fypp                   3.1
hastl                  0.1.7
httplib2               0.20.2
importlib-metadata     4.6.4
jeepney                0.7.1
keyring                23.5.0
launchpadlib           1.10.16
lazr.restfulclient     0.14.4
lazr.uri               1.0.6
more-itertools         8.10.0
netifaces              0.11.0
numpy                  1.25.1
oauthlib               3.2.0
pip                    23.2.1
pycparser              2.21
PyGObject              3.42.1
PyJWT                  2.3.0
pyparsing              2.4.7
python-apt             2.4.0+ubuntu1
PyYAML                 5.4.1
SecretStorage          3.3.1
setuptools             59.6.0
six                    1.16.0
systemd-python         234
ubuntu-advantage-tools 8001
ufw                    0.36.1
unattended-upgrades    0.1
wadllib                1.3.6
wheel                  0.37.1
zipp                   1.0.0
(env) li@DESKTOP-7PK1TSR:~/env$ python
Python 3.9.17 (main, Jun  6 2023, 20:11:21)
[GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from hastl import STL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'STL' from 'hastl' (unknown location)
>>>

Or could you give me an executable file for hastl? So I can directly use it in my Python script. Thanks for your help in advance.

mortvest commented 1 year ago

Hmm. That's strange. Can you:
1) see if you can run harmonic.py from examples/ 2) tell me what backends you are compiling for (c, opencl, cuda?) 3) show me all commands that you have used for installation and the output on a new virtual environment 4) try importing it again, but from a different (clean) directory?

pipipercy commented 1 year ago

Hi, I reinstalled the ubuntu system os and finally install haslt successfully. However, i got the errors as,

trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
trace: false false false
Traceback (most recent call last):
  File "/home/lip/examples/test.py", line 18, in <module>
    A=stl.fit(random_array, n_p=12*30,q_s=35*30+1,q_t=19*30+1,q_l=13*30+1,n_inner=5,n_outer=0)
  File "/home/lip/env/lib/python3.10/site-packages/hastl/stl.py", line 230, in fit
    raise ValueError("An internal error occurred while running the GPU program") from from_err
ValueError: An internal error occurred while running the GPU program

Besides, Do you think it is feasible to package hastl and its dependencies into a closed Python function for running on Windows. Or can you give me any suggestions to be able to use hastl on windows?

Best,

mortvest commented 1 year ago

The error could be caused by your n_outer, it should be greater than zero. Alternatively it could be a problem with your cuda/opencl installation. What backend are you using? What is your GPU?

Regarding Windows, I sadly can not help you.