max icon indicating copy to clipboard operation
max copied to clipboard

[BUG]: max/examples/inference/bert-python-torchscript's run.sh can not work on Arch Linux gcc 14.2.1

Open dlintw opened this issue 1 year ago • 1 comments

Bug description

Just follow the guide https://docs.modular.com/max/get-started. but run.sh stopped on python3 -m pip install -r requirements.txt

Using cached tritonclient-2.44.0-py3-none-manylinux1_x86_64.whl (12.5 MB) Building wheels for collected packages: geventhttpclient Building wheel for geventhttpclient (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [65 lines of output] warning: no previously-included files matching 'pycache' found anywhere in distribution warning: no previously-included files matching '*.py[co]' found anywhere in distribution warning: no files found matching 'LICENSE-MIT' warning: no files found matching 'CHANGELOG' /home/dlin/prj/max/examples/inference/bert-python-torchscript/.magic/envs/default/lib/python3.12/site-packages/setuptools/command/build_py.py:218: _Warning: Package 'geventhttpclient.tests' is absent from the packages configuration. !!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'geventhttpclient.tests' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.
  
          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'geventhttpclient.tests' is explicitly added
          to the `packages` configuration field.
  
          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
  
          You can read more about "package discovery" on setuptools documentation page:
  
          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
  
          If you don't want 'geventhttpclient.tests' to be distributed and are
          already explicitly excluding 'geventhttpclient.tests' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.
  
          You can read more about "package data files" on setuptools documentation page:
  
          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html
  
  
          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************
  
  !!
    check.warn(importable)
  ext/_parser.c: In function ‘on_message_complete’:
  ext/_parser.c:48:32: error: passing argument 1 of ‘PyObject_HasAttrString’ from incompatible pointer type [-Wincompatible-pointer-types]
     48 |     if (PyObject_HasAttrString(self, "_on_message_complete")) {
        |                                ^~~~
        |                                |
        |                                PyHTTPResponseParser *
  In file included from /home/dlin/prj/max/examples/inference/bert-python-torchscript/.magic/envs/default/include/python3.12/Python.h:44,
                   from ext/_parser.c:2:
  /home/dlin/prj/max/examples/inference/bert-python-torchscript/.magic/envs/default/include/python3.12/object.h:409:40: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘PyHTTPResponseParser *’
    409 | PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);
        |                                        ^~~~~~~~~~
  ext/_parser.c:49:53: error: passing argument 1 of ‘PyObject_GetAttrString’ from incompatible pointer type [-Wincompatible-pointer-types]
     49 |         PyObject* callable = PyObject_GetAttrString(self, "_on_message_complete");
        |                                                     ^~~~
        |                                                     |
        |                                                     PyHTTPResponseParser *
  /home/dlin/prj/max/examples/inference/bert-python-torchscript/.magic/envs/default/include/python3.12/object.h:407:47: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘PyHTTPResponseParser *’
    407 | PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);
        |                                               ^~~~~~~~~~
  error: command '/usr/bin/gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for geventhttpclient Running setup.py clean for geventhttpclient Failed to build geventhttpclient ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (geventhttpclient)

$ python --version Python 3.12.5

$ gcc --version gcc (GCC) 14.2.1 20240910

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected. I've also install arch_mojo's https://github.com/Sharktheone/arch-mojo/blob/main/aur/mojo-libs/PKGBUILD which setup these files for run mojo
ls -l ~/.local/lib/arch-mojo/                                                                    (BERT Python Torchscript) 
total 472
-rw-r--r-- 1 dlin dlin 216640 Sep 21 17:13 libedit.so.2
-rw-r--r-- 1 dlin dlin  73072 Sep 21 17:13 libform.so.6
-rw-r--r-- 1 dlin dlin 165808 Sep 21 17:13 libncurses.so.6
-rw-r--r-- 1 dlin dlin  22528 Sep 21 17:13 libpanel.so.6
  • If applicable, add screenshots to help explain the problem.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install MAX on ? 
Arch Linux
- Provide version information for MAX by pasting the output of max -v` 
max 24.5.0 (e8aacb95)
Modular version 24.5.0
- Provide version information for Mojo by pasting the output of mojo -v`
mojo 24.5.0 (e8aacb95)
- Provide Modular CLI version by pasting the output of `modular -v`
magic 0.3.0

dlintw avatar Sep 21 '24 15:09 dlintw