Under Ubuntu18.04. When I compile the number, there is an error calling the libwarp_perspective.so file

username: huang
cooked: <p>I try to complete the official examples:<br>
<aside class="onebox whitelistedgeneric">
  <header class="source">
      <img src="https://github.githubassets.com/favicon.ico" class="site-icon" width="15" height="15">
      <a href="https://github.com/pytorch/extension-script" target="_blank" rel="nofollow noopener">GitHub</a>
  </header>
  <article class="onebox-body">
    <img src="https://avatars2.githubusercontent.com/u/21003710?s=400&amp;v=4" class="thumbnail onebox-avatar" width="60" height="60">

<h3><a href="https://github.com/pytorch/extension-script" target="_blank" rel="nofollow noopener">pytorch/extension-script</a></h3>

<p>Example repository for custom C++/CUDA operators for TorchScript - pytorch/extension-script</p>


  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
<br>
After compiling, I encountered the following problems when calling the. So file:<br>
OSError: /home/huang/vsopencv/extension-script/example_app/build/warp_perspective/libwarp_perspective.so: undefined symbol: _ZN3c1017RegisterOperators25checkSchemaAndRegisterOp_ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEONS0_7OptionsE</p>
<p>compiling：<br>
(pytorch) huang@huang-ubuntu:<del>/vsopencv/extension-script/example_app/warp_perspective/build$ cmake -DCMAKE_PREFIX_PATH=/home/huang/libtorch1.2.0/libtorch …<br>
– The C compiler identification is GNU 7.4.0<br>
– The CXX compiler identification is GNU 7.4.0<br>
– Check for working C compiler: /usr/bin/cc<br>
– Check for working C compiler: /usr/bin/cc – works<br>
– Detecting C compiler ABI info<br>
– Detecting C compiler ABI info - done<br>
– Detecting C compile features<br>
– Detecting C compile features - done<br>
– Check for working CXX compiler: /usr/bin/c++<br>
– Check for working CXX compiler: /usr/bin/c++ – works<br>
– Detecting CXX compiler ABI info<br>
– Detecting CXX compiler ABI info - done<br>
– Detecting CXX compile features<br>
– Detecting CXX compile features - done<br>
– Looking for pthread.h<br>
– Looking for pthread.h - found<br>
– Performing Test CMAKE_HAVE_LIBC_PTHREAD<br>
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed<br>
– Looking for pthread_create in pthreads<br>
– Looking for pthread_create in pthreads - not found<br>
– Looking for pthread_create in pthread<br>
– Looking for pthread_create in pthread - found<br>
– Found Threads: TRUE<br>
– Found CUDA: /usr/local/cuda-10.0 (found version “10.0”)<br>
– Caffe2: CUDA detected: 10.0<br>
– Caffe2: CUDA nvcc is: /usr/local/cuda-10.0/bin/nvcc<br>
– Caffe2: CUDA toolkit directory: /usr/local/cuda-10.0<br>
– Caffe2: Header version is: 10.0<br>
– Found CUDNN: /usr/local/cuda-10.0/include<br>
– Found cuDNN: v7.6.4 (include: /usr/local/cuda-10.0/include, library: /usr/local/cuda-10.0/lib64/libcudnn.so)<br>
– Autodetected CUDA architecture(s): 7.5<br>
– Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75<br>
– Found torch: /home/huang/libtorch1.2.0/libtorch/lib/libtorch.so<br>
– Pytorch status:<br>
– libraries: torch;torch_library;/home/huang/libtorch1.2.0/libtorch/lib/libc10.so;/usr/lib/x86_64-linux-gnu/libcuda.so;/usr/local/cuda-10.0/lib64/libnvrtc.so;/usr/local/cuda-10.0/lib64/libnvToolsExt.so;/usr/local/cuda-10.0/lib64/libcudart.so;/home/huang/libtorch1.2.0/libtorch/lib/libc10_cuda.so<br>
– Configuring done<br>
– Generating done<br>
– Build files have been written to: /home/huang/vsopencv/extension-script/example_app/warp_perspective/build<br>
(pytorch) huang@huang-ubuntu:</del>/vsopencv/extension-script/example_app/warp_perspective/build$ make<br>
Scanning dependencies of target warp_perspective<br>
[ 50%] Building CXX object CMakeFiles/warp_perspective.dir/op.cpp.o<br>
/home/huang/vsopencv/extension-script/example_app/warp_perspective/op.cpp:11:78: warning: ‘torch::jit::RegisterOperators::RegisterOperators(const string&amp;, Implementation&amp;&amp;) [with Implementation = at::Tensor (*)(at::Tensor, at::Tensor); std::__cxx11::string = std::__cxx11::basic_string]’ is deprecated [-Wdeprecated-declarations]<br>
torch::jit::RegisterOperators(“my_ops::warp_perspective”, &amp;warp_perspective);<br>
^<br>
In file included from /home/huang/libtorch1.2.0/libtorch/include/torch/script.h:5:0,<br>
from /home/huang/vsopencv/extension-script/example_app/warp_perspective/op.cpp:1:<br>
/home/huang/libtorch1.2.0/libtorch/include/torch/csrc/jit/custom_operator.h:28:3: note: declared here<br>
RegisterOperators(const std::string&amp; name, Implementation&amp;&amp; implementation) {<br>
^~~~~~~~~~~~~~~~~<br>
[100%] Linking CXX shared library libwarp_perspective.so<br>
[100%] Built target warp_perspective<br>
(pytorch) huang@huang-ubuntu:~/vsopencv/extension-script/example_app/warp_perspective/build$ cmake -DCMAKE_PREFIX_PATH=/home/huang/libtorch1.2.0/libtorch …</p>