NVIDIA / DALI

A GPU-accelerated library containing highly optimized building blocks and an execution engine for data processing to accelerate deep learning training and inference applications.
https://docs.nvidia.com/deeplearning/dali/user-guide/docs/index.html
Apache License 2.0
5.14k stars 620 forks source link

fail to build dali with gcc 14 due to missing cstdint header #5591

Closed hubutui closed 3 months ago

hubutui commented 3 months ago

Version

1.40.0

Describe the bug.

https://github.com/NVIDIA/DALI/blob/v1.40.0/dali/util/uri.h#L51 use uint32_t without including the cstdint header, this leads to compilation failure.

Minimum reproducible example

none

Relevant log output

In file included from /build/python-nvidia-dali/src/python-nvidia-dali/dali/pipeline/workspace/workspace.h:27,
                 from /build/python-nvidia-dali/src/python-nvidia-dali/dali/pipeline/workspace/sample_workspace.cc:15:
/build/python-nvidia-dali/src/python-nvidia-dali/dali/pipeline/data/tensor_list.h:87:34: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
   87 |   DLL_PUBLIC TensorList<Backend>(TensorList<Backend> &&other) noexcept;
      |                                  ^~~~~~~~~~~~~~~~~~~
/build/python-nvidia-dali/src/python-nvidia-dali/dali/pipeline/data/tensor_list.h:87:34: note: remove the ‘< >’
[ 38%] Building CXX object dali/CMakeFiles/dali.dir/util/cufile.cc.o
In file included from /build/python-nvidia-dali/src/python-nvidia-dali/dali/util/uri.cc:15:
/build/python-nvidia-dali/src/python-nvidia-dali/dali/util/uri.h:51:8: error: use of enum ‘ParseOpts’ without previous declaration
   51 |   enum ParseOpts : uint32_t {
      |        ^~~~~~~~~
/build/python-nvidia-dali/src/python-nvidia-dali/dali/util/uri.h:51:20: error: ‘uint32_t’ was not declared in this scope
   51 |   enum ParseOpts : uint32_t {
      |                    ^~~~~~~~
/build/python-nvidia-dali/src/python-nvidia-dali/dali/util/uri.h:24:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   23 | #include "dali/core/api_helper.h"
  +++ |+#include <cstdint>
   24 | 
/build/python-nvidia-dali/src/python-nvidia-dali/dali/util/uri.h:51:29: error: default member initializer for unnamed bit-field
   51 |   enum ParseOpts : uint32_t {
      |                             ^

Other/Misc.

quick fix, add one line to https://github.com/NVIDIA/DALI/blob/v1.40.0/dali/util/uri.h#L17

#include <cstdint>

Check for duplicates

mdabek-nvidia commented 3 months ago

Hi @hubutui, Thank you for reporting the issue. If you would like to contribute to DALI please create a PR or we can do it as well.

hubutui commented 3 months ago

Thanks, I think you could do it.

mdabek-nvidia commented 3 months ago

Thank you @hubutui, the fix is now merged.