wenet安装python报INTTYPES_FORMAT to either C99, BSD, or VC7 and try again

Posted 修炼之路

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了wenet安装python报INTTYPES_FORMAT to either C99, BSD, or VC7 and try again相关的知识,希望对你有一定的参考价值。

错误信息

在使用wenet源码安装python的时候报错,错误信息如下

CMake Error at fc_base/gflags-src/CMakeLists.txt:286 (message):
Do not know how to define a 32-bit integer quantity on your system! Neither
uint32_t, u_int32_t, nor _int32 seem to be available. Set
[GFLAGS]INTTYPES_FORMAT to either C99, BSD, or VC7 and try again.

-- Configuring incomplete, errors occurred!
See also "/mnt/wenet/runtime/server/x86/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/wenet/runtime/server/x86/build/CMakeFiles/CMakeError.log".

解决办法

wenet/runtime/binding/python/fc_base/gflags-src/CMakeLists.txt279-290行注释掉,如下

   279	  #if (HAVE_uint32_t)
   280	  #  gflags_set (INTTYPES_FORMAT C99)
   281	  #elseif (HAVE_u_int32_t)
   282	  #  gflags_set (INTTYPES_FORMAT BSD)
   283	  #elseif (HAVE___int32)
   284	  #  gflags_set (INTTYPES_FORMAT VC7)
   285	  #else ()
   286	  #  gflags_property (INTTYPES_FORMAT ADVANCED FALSE)
   287	  #  message (FATAL_ERROR "Do not know how to define a 32-bit integer quantity on your system!"
   288	  #                       " Neither uint32_t, u_int32_t, nor __int32 seem to be available."
   289	  #                       " Set [GFLAGS_]INTTYPES_FORMAT to either C99, BSD, or VC7 and try again.")
   290	  #endif ()

278行添加如下的代码

gflags_set (INTTYPES_FORMAT C99)

修改完成之后,退回到wenet/runtime/binding/python下,执行以下命令

#删除之前编译失败的信息
rm build -rf
#安装python版的wenetruntime
python setup.py install

安装成功之后会出现如下信息

Searching for torch1.10.0+cu111
Best match: torch 1.10.0+cu111
Adding torch 1.10.0+cu111 to easy-install.pth file
Installing convert-caffe2-to-onnx script to /root/anaconda3/envs/wenet/bin
Installing convert-onnx-to-caffe2 script to /root/anaconda3/envs/wenet/bin
Installing torchrun script to /root/anaconda3/envs/wenet/bin
Using /root/anaconda3/envs/wenet/lib/python3.8/site-packages
Searching for typing-extensions
4.4.0
Best match: typing-extensions 4.4.0
Adding typing-extensions 4.4.0 to easy-install.pth file

Using /root/anaconda3/envs/wenet/lib/python3.8/site-packages
Finished processing dependencies for wenetruntime==1.0.12

注意

如果在安装的过程中出现unrecognized command line option ‘-std=c++14’,需要将gcc进行升级,gcc升级教程

参考

  1. https://github.com/wenet-e2e/wenet/issues/1488
  2. https://www.cnblogs.com/jixiaohua/p/11732225.html

以上是关于wenet安装python报INTTYPES_FORMAT to either C99, BSD, or VC7 and try again的主要内容,如果未能解决你的问题,请参考以下文章

wenet编译报Do not know how to define a 32-bit integer quantity on your system

wenet编译报Do not know how to define a 32-bit integer quantity on your system

为啥.net和dotnet打不开?

解析WeNet云端推理部署代码

[语音识别] wenet

Conformer(运用在WeNet中的理解与分析)