cgohlke / imagecodecs

Image transformation, compression, and decompression codecs
https://pypi.org/project/imagecodecs
BSD 3-Clause "New" or "Revised" License
118 stars 23 forks source link

Build fails: imagecodecs/_avif.c:3955:26: error: storage size of ‘__pyx_v_flags’ isn’t known #20

Closed mcepl closed 3 years ago

mcepl commented 3 years ago

While building imagecodecs package for openSUSE/Tumbleweed (using Python 3.8 or 3.9, numpy 1.20.3) I got this build error:

[   52s] gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-o
[   53s] In file included from /usr/lib64/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes,
[   53s]                  from /usr/lib64/python3.9/site-packages/numpy/core/include/numpy/ndarrayobjec,
[   53s]                  from /usr/lib64/python3.9/site-packages/numpy/core/include/numpy/arrayobject.,
[   53s]                  from imagecodecs/_aec.c:633:
[   53s] /usr/lib64/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: war]
[   53s]    17 | #warning "Using deprecated NumPy API, disable it with " \
[   53s]       |  ^~~~~~~
[   53s] gcc -pthread -shared -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fo
[   55s] building 'imagecodecs._avif' extension
[   55s] gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-o
[   56s] In file included from /usr/lib64/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes,
[   56s]                  from /usr/lib64/python3.9/site-packages/numpy/core/include/numpy/ndarrayobjec,
[   56s]                  from /usr/lib64/python3.9/site-packages/numpy/core/include/numpy/arrayobject.,
[   56s]                  from imagecodecs/_avif.c:636:
[   56s] /usr/lib64/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: war]
[   56s]    17 | #warning "Using deprecated NumPy API, disable it with " \
[   56s]       |  ^~~~~~~
[   56s] imagecodecs/_avif.c: In function ‘__pyx_pf_11imagecodecs_5_avif_4avif_encode’:
[   56s] imagecodecs/_avif.c:3955:26: error: storage size of ‘__pyx_v_flags’ isn’t known
[   56s]  3955 |   enum avifAddImageFlags __pyx_v_flags;
[   56s]       |                          ^~~~~~~~~~~~~
[   56s] imagecodecs/_avif.c:3955:26: warning: unused variable ‘__pyx_v_flags’ [-Wunused-variable]
[   56s] error: command '/var/lib/build/ccache/bin/gcc' failed with exit code 1
[   56s] error: Bad exit status from /var/tmp/rpm-tmp.O5YKOv (%build)

Complete build log with list of all packages used and detailed steps to achieve this result.