faster-fifo icon indicating copy to clipboard operation
faster-fifo copied to clipboard

Build fails with gcc13

Open mweinelt opened this issue 1 year ago • 1 comments

The build fails with GCC13, but works with GCC12. This is with faster-fifo 1.4.5 on Linux (amd64/arm64) with Python3.11/3.12.

faster-fifo> * Building wheel...
faster-fifo> [1/1] Cythonizing faster_fifo.pyx
faster-fifo> running bdist_wheel
faster-fifo> running build
faster-fifo> running build_py
faster-fifo> creating build
faster-fifo> creating build/lib.linux-x86_64-cpython-311
faster-fifo> creating build/lib.linux-x86_64-cpython-311/cpp_faster_fifo
faster-fifo> copying cpp_faster_fifo/__init__.py -> build/lib.linux-x86_64-cpython-311/cpp_faster_fifo
faster-fifo> creating build/lib.linux-x86_64-cpython-311/faster_fifo_reduction
faster-fifo> copying faster_fifo_reduction/__init__.py -> build/lib.linux-x86_64-cpython-311/faster_fifo_reduction
faster-fifo> creating build/lib.linux-x86_64-cpython-311/cpp_faster_fifo/tests
faster-fifo> copying cpp_faster_fifo/tests/test_faster_fifo.py -> build/lib.linux-x86_64-cpython-311/cpp_faster_fifo/tests
faster-fifo> copying cpp_faster_fifo/tests/comparison_tests.py -> build/lib.linux-x86_64-cpython-311/cpp_faster_fifo/tests
faster-fifo> copying cpp_faster_fifo/tests/__init__.py -> build/lib.linux-x86_64-cpython-311/cpp_faster_fifo/tests
faster-fifo> running build_ext
faster-fifo> building 'faster_fifo' extension
faster-fifo> creating build/temp.linux-x86_64-cpython-311
faster-fifo> creating build/temp.linux-x86_64-cpython-311/cpp_faster_fifo
faster-fifo> creating build/temp.linux-x86_64-cpython-311/cpp_faster_fifo/cpp_lib
faster-fifo> g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/nix/store/fjxs9vk02ldpz0xyd3yh5pnzvhq9gmby-libxcrypt-4.4.36/include -fPIC -Icpp_faster_fifo/cpp_lib -I/nix/store/lpi16513bai8kg2bd841745vzk72475x-python3-3.11.9/include/python3.11 -c cpp_faster_fifo/cpp_lib/faster_fifo.cpp -o build/temp.linux-x86_64-cpython-311/cpp_faster_fifo/cpp_lib/faster_fifo.o -std=c++11
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp: In member function ‘void Queue::circular_buffer_write(uint8_t*, const uint8_t*, size_t)’:
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: error: ‘stderr’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:58:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    58 |         LOG_ASSERT(size <= max_size_bytes, "Combined message size exceeds the size of the queue");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:9:1: note: ‘stderr’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
faster-fifo>     8 | #include "faster_fifo.hpp"
faster-fifo>   +++ |+#include <cstdio>
faster-fifo>     9 | 
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:9: error: ‘fprintf’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |         ^~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:58:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    58 |         LOG_ASSERT(size <= max_size_bytes, "Combined message size exceeds the size of the queue");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: error: ‘stderr’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:59:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    59 |         LOG_ASSERT(tail < max_size_bytes, "Tail pointer points past the buffer boundary");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: note: ‘stderr’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:59:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    59 |         LOG_ASSERT(tail < max_size_bytes, "Tail pointer points past the buffer boundary");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:9: error: ‘fprintf’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |         ^~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:59:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    59 |         LOG_ASSERT(tail < max_size_bytes, "Tail pointer points past the buffer boundary");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp: In member function ‘void Queue::circular_buffer_read(uint8_t*, uint8_t*, size_t, bool)’:
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: error: ‘stderr’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:78:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    78 |         LOG_ASSERT(new_head < max_size_bytes, "Circular buffer head pointer is incorrect");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: note: ‘stderr’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:78:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    78 |         LOG_ASSERT(new_head < max_size_bytes, "Circular buffer head pointer is incorrect");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:9: error: ‘fprintf’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |         ^~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:78:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    78 |         LOG_ASSERT(new_head < max_size_bytes, "Circular buffer head pointer is incorrect");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: error: ‘stderr’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:79:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    79 |         LOG_ASSERT(new_size >= 0 && new_size < max_size_bytes, "New size is incorrect after reading from buffer");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: note: ‘stderr’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:79:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    79 |         LOG_ASSERT(new_size >= 0 && new_size < max_size_bytes, "New size is incorrect after reading from buffer");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:9: error: ‘fprintf’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |         ^~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:79:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>    79 |         LOG_ASSERT(new_size >= 0 && new_size < max_size_bytes, "New size is incorrect after reading from buffer");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp: In function ‘int queue_get(void*, void*, void*, size_t, size_t, size_t, size_t*, size_t*, size_t*, int, float)’:
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: error: ‘stderr’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:239:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>   239 |         LOG_ASSERT(q->size >= sizeof(msg_size) + msg_size, "Queue size is less than message size!");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:17: note: ‘stderr’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |                 ^~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:239:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>   239 |         LOG_ASSERT(q->size >= sizeof(msg_size) + msg_size, "Queue size is less than message size!");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:14:9: error: ‘fprintf’ was not declared in this scope
faster-fifo>    14 |         fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, (msg)); \
faster-fifo>       |         ^~~~~~~
faster-fifo> cpp_faster_fifo/cpp_lib/faster_fifo.cpp:239:9: note: in expansion of macro ‘LOG_ASSERT’
faster-fifo>   239 |         LOG_ASSERT(q->size >= sizeof(msg_size) + msg_size, "Queue size is less than message size!");
faster-fifo>       |         ^~~~~~~~~~
faster-fifo> error: command '/nix/store/8mjb3ziimfi3rki71q4s0916xkm4cm5p-gcc-wrapper-13.2.0/bin/g++' failed with exit code 1
faster-fifo> 
faster-fifo> ERROR Backend subprocess exited when trying to invoke build_wheel

mweinelt avatar May 05 '24 21:05 mweinelt

Same error for me on gcc 13 python 3.9.

aclegg3 avatar May 08 '24 20:05 aclegg3

It should be fixed on main. Will release a new PyPI version soon. In the meantime pip install git+https://github.com/alex-petrenko/faster-fifo.git

klyuchnikova-ana avatar May 15 '24 15:05 klyuchnikova-ana

Should be fixed in PyPI https://pypi.org/project/faster-fifo/1.4.6/

alex-petrenko avatar May 25 '24 08:05 alex-petrenko