Skip to content

Successful installation but undefined symbol: avcodec_decode_audio4 when running python #1467

Open
@Vriska

Description

@Vriska

When running the python unit tests via python3 waf run_python_tests, I get this

python3 waf run_python_tests
/home/vriska/NEW/essentia/wscript:211: SyntaxWarning: invalid escape sequence '\w'
"""
Running python unit tests using /home/vriska/signal/bin/python3
Traceback (most recent call last):
File "/home/vriska/NEW/essentia/test/src/unittests/all_tests.py", line 27, in
import essentia
File "/home/vriska/NEW/essentia/build/python/essentia/init.py", line 1, in
from . import _essentia
ImportError: /home/vriska/NEW/essentia/build/python/essentia/_essentia.cpython-312-x86_64-linux-gnu.so: undefined symbol: avcodec_decode_audio4

This might be relevant, I had some trouble with the installation -

First, I had this #1411

Manually installing ffmpeg 4.4 seemed to fix the build issues except for one thing -

python3 waf gave me this, but this didn't seem to be a problem when i did sudo python3 waf

[326/348] Compiling src/python/pytypes/vectorstring.cpp
In file included from ../src/python/typedefs.h:27,
from ../src/python/pytypes/vectorinteger.cpp:20:
../src/python/pytypes/vectorinteger.cpp: In static member function ‘static PyObject* VectorInteger::toPythonRef(essentia::RogueVector)’:
../src/python/pytypes/vectorinteger.cpp:30:60: error: ‘PyArray_INT’ was not declared in this scope; did you mean ‘PyArray_Put’?
30 | if (dim > 0) result = PyArray_SimpleNewFromData(1, &dim, PyArray_INT, &((v)[0]));
| ^~~~~~~~~~~
../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:122:46: note: in definition of macro ‘PyArray_SimpleNewFromData’
122 | PyArray_New(&PyArray_Type, nd, dims, typenum, NULL,
| ^~~~~~~
../src/python/pytypes/vectorinteger.cpp:31:52: error: ‘PyArray_INT’ was not declared in this scope; did you mean ‘PyArray_Put’?
31 | else result = PyArray_SimpleNew(1, &dim, PyArray_INT);
| ^~~~~~~~~~~
../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:119:46: note: in definition of macro ‘PyArray_SimpleNew’
119 | PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
| ^~~~~~~
../src/python/pytypes/vectorinteger.cpp:37:16: error: cannot convert ‘PyObject
’ {aka ‘_object
’} to ‘const PyArrayObject*’ {aka ‘const tagPyArrayObject_fields*’}
37 | PyArray_BASE(result) = TO_PYTHON_PROXY(VectorInteger, v);
| ^~~~~~
| |
| PyObject* {aka _object*}
In file included from ../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12:
../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1548:35: note: initializing argument 1 of ‘PyObject* PyArray_BASE(const PyArrayObject*)’
1548 | PyArray_BASE(const PyArrayObject arr)
| ~~~~~~~~~~~~~~~~~~~~~^~~
../src/python/pytypes/vectorinteger.cpp: In static member function ‘static void
VectorInteger::fromPythonRef(PyObject*)’:
../src/python/pytypes/vectorinteger.cpp:51:33: error: ‘PyArray_INT32’ was not declared in this scope; did you mean ‘PyArray_NDIM’?
51 | if (array->descr->type_num != PyArray_INT32) {
| ^~~~~~~~~~~~~
| PyArray_NDIM
../src/python/pytypes/vectorinteger.cpp:58:50: error: cannot convert ‘PyObject*’ {aka ‘_object*’} to ‘const PyArrayObject*’ {aka ‘const tagPyArrayObject_fields*’}
58 | return new RogueVector((int*)PyArray_DATA(obj), PyArray_SIZE(obj));
| ^~~
| |
| PyObject* {aka _object*}
../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1512:35: note: initializing argument 1 of ‘void* PyArray_DATA(const PyArrayObject*)’
1512 | PyArray_DATA(const PyArrayObject arr)
| ~~~~~~~~~~~~~~~~~~~~~^~~
../src/python/pytypes/vectorinteger.cpp:58:69: error: cannot convert ‘PyObject
’ {aka ‘_object*’} to ‘const PyArrayObject*’ {aka ‘const tagPyArrayObject_fields*’}
58 | return new RogueVector((int*)PyArray_DATA(obj), PyArray_SIZE(obj));
| ^~~
| |
| PyObject* {aka _object*}
../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:79:59: note: in definition of macro ‘PyArray_SIZE’
79 | #define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))
| ^
../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1524:35: note: initializing argument 1 of ‘npy_intp* PyArray_DIMS(const PyArrayObject*)’
1524 | PyArray_DIMS(const PyArrayObject arr)
| ~~~~~~~~~~~~~~~~~~~~~^~~
../src/python/pytypes/vectorinteger.cpp:58:69: error: cannot convert ‘PyObject
’ {aka ‘_object*’} to ‘const PyArrayObject*’ {aka ‘const tagPyArrayObject_fields*’}
58 | return new RogueVector((int*)PyArray_DATA(obj), PyArray_SIZE(obj));
| ^~~
| |
| PyObject* {aka _object*}
../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:79:76: note: in definition of macro ‘PyArray_SIZE’
79 | #define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))
| ^
../../../signal/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1506:35: note: initializing argument 1 of ‘int PyArray_NDIM(const PyArrayObject*)’
1506 | PyArray_NDIM(const PyArrayObject *arr)
| ~~~~~~~~~~~~~~~~~~~~~^~~
......(MORE OF THIS STUFF)

Waf: Leaving directory `/home/vriska/NEW/essentia/build'
Build failed
-> task in '_essentia' failed with exit status 1 (run with -v to display more information)

problem went away with sudo

python3 waf run_tests

All basic tests pass weirdly enough

But nothing runs as it fails to import due to the avcodec thing.

This is honestly quite frustrating, any help would be greatly appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions