bnpr / Malt

Render framework for NPR.
https://malt3d.com
Other
952 stars 75 forks source link

Missing dependencies on Arch Linux #556

Closed magras closed 1 month ago

magras commented 1 month ago

Malt version

release 841b3a7

Blender version

Blender 4.1

OS

arch linux x86_64

Hardware info

irrelevant

Issue description and reproduction steps

The final step of installation

  • Tick the box in the BlenderMalt panel to enable it.

triggers an error message:

addon_utils.disable: BlenderMalt not loaded
Modules Installed (BlenderMalt) from '/home/magras/user/download/BlenderMalt-Linux.zip' into '/home/magras/.config/blender/4.1/scripts/addons'
Exception in module register(): /home/magras/.config/blender/4.1/scripts/addons/BlenderMalt/__init__.py
Traceback (most recent call last):
  File "/usr/share/blender/4.1/scripts/modules/addon_utils.py", line 444, in enable
    mod.register()
  File "/home/magras/.config/blender/4.1/scripts/addons/BlenderMalt/__init__.py", line 210, in register
    for module in get_modules():
                  ^^^^^^^^^^^^^
  File "/home/magras/.config/blender/4.1/scripts/addons/BlenderMalt/__init__.py", line 193, in get_modules
    from . import MaltUtils, MaltTextures, MaltMeshes, MaltLights, MaltProperties, MaltPipeline, MaltMaterial, MaltRenderEngine
  File "/home/magras/.config/blender/4.1/scripts/addons/BlenderMalt/MaltRenderEngine.py", line 2, in <module>
    import xxhash
ModuleNotFoundError: No module named 'xxhash'

I've tried installing required dependencies manually and found out that OpenGL_accelerate fails to compile:

    building 'OpenGL_accelerate.numpy_formathandler' extension
    gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/tmp/pip-install-rjsmdibt/pyopengl-accelerate_546b783a75a74a859703b6e9fe235584/src -I/tmp/pip-install-rjsmdibt/pyopengl-accelerate_546b783a75a74a859703b6e9fe235584 -I/tmp/pip-build-env-hzq8bjz9/overlay/lib/python3.12/site-packages/numpy/core/include -I/home/magras/tmp/11/include -I/usr/include/python3.12 -c src/numpy_formathandler.c -o build/temp.linux-x86_64-cpython-312/src/numpy_formathandler.o
    In file included from /tmp/pip-build-env-hzq8bjz9/overlay/lib/python3.12/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929,
                     from /tmp/pip-build-env-hzq8bjz9/overlay/lib/python3.12/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /tmp/pip-build-env-hzq8bjz9/overlay/lib/python3.12/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                     from src/numpy_formathandler.c:1251:
    /tmp/pip-build-env-hzq8bjz9/overlay/lib/python3.12/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
       17 | #warning "Using deprecated NumPy API, disable it with " \
          |  ^~~~~~~
    src/numpy_formathandler.c: In function ‘__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_c_asArray’:
    src/numpy_formathandler.c:6434:43: error: passing argument 1 of ‘(int (*)(PyArrayObject *, PyObject *))*(PyArray_API + 832)’ from incompatible pointer type [-Wincompatible-pointer-types]
     6434 |     __pyx_v_res = PyArray_FillWithScalar(((PyObject *)__pyx_v_working), __pyx_v_instance);
          |                                          ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                           |
          |                                           PyObject * {aka struct _object *}
    src/numpy_formathandler.c:6434:43: note: expected ‘PyArrayObject *’ {aka ‘struct tagPyArrayObject_fields *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
    src/numpy_formathandler.c: In function ‘__pyx_pymod_exec_numpy_formathandler’:
    src/numpy_formathandler.c:9826:3: error: returning ‘void *’ from a function with return type ‘int’ makes integer from pointer without a cast [-Wint-conversion]
     9826 |   import_array();
          |   ^~~~~~~~~~~~
    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 PyOpenGL_accelerate

I suspect that there was a breaking change in python api. My python version is 3.12.3.

After installing all dependencies except PyOpenGL_accelerate in a venv Blender loaded Malt successfully, but I haven't tested any functionality of Malt yet.

There was similar report but without details here.

Attachments

skip

pragma37 commented 1 month ago

I suspect that there was a breaking change in python api. My python version is 3.12.3.

Your system Python version should not be relevant. Blender ships with its own built-in Python and that's the version that Malt targets.

I know some distros distribute their own Frankenstein builds of Blender, if you're using that then I recommend you to use an official Blender build: https://www.blender.org/download/

If that's not the case, then I'm not sure what could be going on, the xxhash module is certainly there in the BlenderMalt zip.

magras commented 1 month ago

Yes, I'm using system package and as I understand it, arch linux compiles blender without embedded python.

Symlinking .Dependencies-312 to .Dependencies-311 allowed malt to find xxhash but failed later.

Replacing blender with blender-bin from AUR (which uses official binary distribution) allowed to load malt successfully.

Thank you for pointing me in the right direction.