PyTorch Build from Source in the ARM Cortex A9 failed

chaoren2357: <p>I want to deploy pytorch in a zynq-7020 which have two ARM Cortex-A9. I follow this <a href="https://github.com/manoharvhr/PYNQ-Torch/tree/master/PyTorch_Installation" rel="nofollow noopener">instruction</a>. However, I encounter an error below, what am I missing?</p>
<pre><code class="lang-auto">
[ 66%] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/api/src/serialize/output-archive.cpp.o
[ 66%] Linking CXX shared library ../lib/libtorch_cpu.so
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_get_threads_count':
portable-api.c:(.text+0x1894): multiple definition of `pthreadpool_get_threads_count'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_impl.cc.o:pthreadpool_impl.cc:(.text+0xc0): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_1d':
portable-api.c:(.text+0x18a0): multiple definition of `pthreadpool_parallelize_1d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0x64c): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_1d_tile_1d':
portable-api.c:(.text+0x19c4): multiple definition of `pthreadpool_parallelize_1d_tile_1d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0x774): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_2d':
portable-api.c:(.text+0x1a88): multiple definition of `pthreadpool_parallelize_2d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0x82c): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_2d_tile_1d':
portable-api.c:(.text+0x1b94): multiple definition of `pthreadpool_parallelize_2d_tile_1d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0x91c): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_2d_tile_2d':
portable-api.c:(.text+0x1cd0): multiple definition of `pthreadpool_parallelize_2d_tile_2d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0xa38): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_3d_tile_2d':
portable-api.c:(.text+0x1ff0): multiple definition of `pthreadpool_parallelize_3d_tile_2d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0xb94): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_4d_tile_2d':
portable-api.c:(.text+0x23e8): multiple definition of `pthreadpool_parallelize_4d_tile_2d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0xd60): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_5d_tile_2d':
portable-api.c:(.text+0x2874): multiple definition of `pthreadpool_parallelize_5d_tile_2d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0xf8c): first defined here
../lib/libpthreadpool.a(portable-api.c.o): In function `pthreadpool_parallelize_6d_tile_2d':
portable-api.c:(.text+0x2b20): multiple definition of `pthreadpool_parallelize_6d_tile_2d'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_new_if_impl.c.o:pthreadpool_new_if_impl.c:(.text+0x1210): first defined here
../lib/libpthreadpool.a(pthreads.c.o): In function `pthreadpool_create':
pthreads.c:(.text+0xf0): multiple definition of `pthreadpool_create'
CMakeFiles/torch_cpu.dir/utils/ threadpool/pthreadpool_impl.cc.o:pthreadpool_impl.cc:(.text+0xcc): first defined here
../lib/libpthreadpool.a(pthreads.c.o): In function `pthreadpool_destroy':
pthreads.c:(.text+0x32c): multiple definition of `pthreadpool_destroy'
CMakeFiles/torch_cpu.dir/utils/threadpool/pthreadpool_impl.cc.o:pthreadpool_impl.cc:(.text+0x14c): first defined here
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/torch_cpu.dir/build.make:24888: recipe for target 'lib/libtorch_cpu.so' failed
make[2]: *** [lib/libtorch_cpu.so] Error 1
CMakeFiles/Makefile2:6753: recipe for target 'caffe2/CMakeFiles/torch_cpu.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/torch_cpu.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 734, in &lt;module&gt;
    build_deps()
  File "setup.py", line 316, in build_deps
    cmake=cmake)
  File "/home/xilinx/pytorch/tools/build_pytorch_libs.py", line 62, in build_caffe2
    cmake.build(my_env)
  File "/home/xilinx/pytorch/tools/setup_helpers/cmake.py", line 340, in build
    self.run(build_args, my_env)
  File "/home/xilinx/pytorch/tools/setup_helpers/cmake.py", line 141, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '1']' returned non-zero exit status 2.


</code></pre>

bogoman: <p>hey! did you find a solution to this?</p>