PaddleSpeech icon indicating copy to clipboard operation
PaddleSpeech copied to clipboard

paddlespeech r1.4.1 附带的 paddleaudio 构建 wheel 报错

Open xushangning opened this issue 9 months ago • 1 comments

构建时报错信息

# 在 PaddleSpeech/audio 目录下执行该命令
$ python setup.py bdist_wheel
...
[75/84] /usr/bin/c++ -DCOMPILE_WITHOUT_OPENFST -DINCLUDE_KALDI -DINCLUDE_SOX -D_paddleaudio_EXPORTS -I/home/orangepi/Downloads/PaddleSpeech/audio/fc_patch/pybind11/include -I/home/orangepi/miniconda3/envs/mplug_owl/include/python3.10 -I/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/third_party -I/home/orangepi/Downloads/PaddleSpeech/audio -I/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/third_party/sox/../install/include -O3 -DNDEBUG -fPIC -std=gnu++14 -MD -MT paddleaudio/src/CMakeFiles/_paddleaudio.dir/pybind/sox/types.cpp.o -MF paddleaudio/src/CMakeFiles/_paddleaudio.dir/pybind/sox/types.cpp.o.d -o paddleaudio/src/CMakeFiles/_paddleaudio.dir/pybind/sox/types.cpp.o -c /home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.cpp
FAILED: paddleaudio/src/CMakeFiles/_paddleaudio.dir/pybind/sox/types.cpp.o 
/usr/bin/c++ -DCOMPILE_WITHOUT_OPENFST -DINCLUDE_KALDI -DINCLUDE_SOX -D_paddleaudio_EXPORTS -I/home/orangepi/Downloads/PaddleSpeech/audio/fc_patch/pybind11/include -I/home/orangepi/miniconda3/envs/mplug_owl/include/python3.10 -I/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/third_party -I/home/orangepi/Downloads/PaddleSpeech/audio -I/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/third_party/sox/../install/include -O3 -DNDEBUG -fPIC -std=gnu++14 -MD -MT paddleaudio/src/CMakeFiles/_paddleaudio.dir/pybind/sox/types.cpp.o -MF paddleaudio/src/CMakeFiles/_paddleaudio.dir/pybind/sox/types.cpp.o.d -o paddleaudio/src/CMakeFiles/_paddleaudio.dir/pybind/sox/types.cpp.o -c /home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.cpp
In file included from /home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.cpp:3:
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:23:42: error: ‘string’ in namespace ‘std’ does not name a type
   23 | Format get_format_from_string(const std::string& format);
      |                                          ^~~~~~
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:6:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
    5 | #include "paddleaudio/src/optional/optional.hpp"
  +++ |+#include <string>
    6 | 
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:41:6: error: ‘string’ in namespace ‘std’ does not name a type
   41 | std::string to_string(Encoding v);
      |      ^~~~~~
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:41:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
   41 | std::string to_string(Encoding v);
      | ^~~
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:42:59: error: ‘string’ is not a member of ‘std’
   42 | Encoding get_encoding_from_option(const tl::optional<std::string> encoding);
      |                                                           ^~~~~~
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:42:59: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:42:59: error: ‘string’ is not a member of ‘std’
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:42:59: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:42:65: error: template argument 1 is invalid
   42 | Encoding get_encoding_from_option(const tl::optional<std::string> encoding);
      |                                                                 ^
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:53:55: error: ‘int64_t’ was not declared in this scope
   53 | BitDepth get_bit_depth_from_option(const tl::optional<int64_t> bit_depth);
      |                                                       ^~~~~~~
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:6:1: note: ‘int64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    5 | #include "paddleaudio/src/optional/optional.hpp"
  +++ |+#include <cstdint>
    6 | 
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:53:62: error: template argument 1 is invalid
   53 | BitDepth get_bit_depth_from_option(const tl::optional<int64_t> bit_depth);
      |                                                              ^
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:55:6: error: ‘string’ in namespace ‘std’ does not name a type
   55 | std::string get_encoding(sox_encoding_t encoding);
      |      ^~~~~~
/home/orangepi/Downloads/PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h:55:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
   55 | std::string get_encoding(sox_encoding_t encoding);
      | ^~~

修复建议

在 PaddleSpeech/audio/paddleaudio/src/pybind/sox/types.h 中添加 #include <string>可解决。

xushangning avatar Sep 28 '23 07:09 xushangning