开发者
资源
鲲鹏环境编译wenet 2.0.1报错undefined reference to at::_ops::zeros::call(c10:ArrayRef<long>和`t::_ops::cat::call(c10::ArrayRef解决方法
鲲鹏环境编译wenet 2.0.1报错undefined reference to at::_ops::zeros::call(c10:ArrayRef<long>和`t::_ops::cat::call(c10::ArrayRef解决方法
发表于2023/08/03
7023

【问题描述】

在鲲鹏环境(openEuler 20.03 LTS SP3)编译wenet 2.0.1报undefined reference to `at::_ops::zeros::call(c10:ArrayRef&lt;long&gt;, c10::optional&lt;c10::ScalarType&gt;, c10::optional&lt;c10::Layout&gt;, c10::optional&lt;c10::Device&gt;, c10::optional&lt;bool&gt;)'和undefined reference to `at::_ops::cat::call(c10::ArrayRef&lt;at::Tensor&gt;, long)'错误,详细报错信息如下:

[ 81%] Building CXX object bin/CMakeFiles/websocket_server_main.dir/websocket_server_main.cc.o

[ 82%] Linking CXX executable websocket_server_main

/usr/bin/ld: CMakeFiles/websocket_server_main.dir/websocket_server_main.cc.o: in function `at::zeros(c10::ArrayRef&lt;long&gt;, c10::TensorOptions)':

websocket_server_main.cc:(.text._ZN2at5zerosEN3c108ArrayRefIlEENS0_13TensorOptionsE[_ZN2at5zerosEN3c108ArrayRefIlEENS0_13TensorOptionsE]+0x7c): undefined reference to `at::_ops::zeros::call(c10::ArrayRef&lt;long&gt;, c10::optional&lt;c10::ScalarType&gt;, c10::optional&lt;c10::Layout&gt;, c10::optional&lt;c10::Device&gt;, c10::optional&lt;bool&gt;)'

/usr/bin/ld: ../decoder/libdecoder.a(torch_asr_model.cc.o): in function `at::cat(c10::ArrayRef&lt;at::Tensor&gt;, long)':

torch_asr_model.cc:(.text._ZN2at3catEN3c108ArrayRefINS_6TensorEEEl[_ZN2at3catEN3c108ArrayRefINS_6TensorEEEl]+0x24): undefined reference to `at::_ops::cat::call(c10::ArrayRef&lt;at::Tensor&gt;, long)'

collect2: error: ld returned 1 exit status

gmake[2]: *** [bin/CMakeFiles/websocket_server_main.dir/build.make:97: bin/websocket_server_main] Error 1

gmake[2]: Leaving directory '/root/wenet-2.0.1/runtime/server/x86/build'

gmake[1]: *** [CMakeFiles/Makefile2:2177: bin/CMakeFiles/websocket_server_main.dir/all] Error 2

gmake[1]: Leaving directory '/root/wenet-2.0.1/runtime/server/x86/build'

gmake: *** [Makefile:152: all] Error 2

image.png

【解决方法】

手动下载获取libtorch-shared-with-deps-1.13.0%2Bcpu.zip解压并替换../fc_base/路径下的libtorch-src文件夹

cd ../fc_base/

wget cid:link_0

rm -rf libtorch-src

mv libtorch libtorch-src

然后再次执行cmake --build .编译。

收藏举报
Level 1
0
帖子
0
粉丝
0
获赞