Unable to build Libtorch v1.0.1 from Source

vanguard478: <p>Hi,<br>
I require libtorch v1.0.1 with cxx11 ABI for a SLAM repo <a href="https://github.com/jiexiong2016/GCNv2_SLAM" rel="noopener nofollow ugc">GCNv2_SLAM</a> I am trying to build.<br>
I tried compiling libtorch from source using the v1.0.1 tag but it always ends with the following error<br>
After doing the</p>
<pre><code class="lang-bash">git clone -b v1.0.1 https://github.com/pytorch/pytorch.git
git submodule update --init --recursive
mkdir build &amp;&amp; cd build
#I am using the following command to build libtorch 
python tools/build_libtorch.py
</code></pre>
<pre><code class="lang-bash">[ 84%] Linking CXX shared library ../lib/libcaffe2.so
CMakeFiles/caffe2.dir/__/aten/src/ATen/native/cpu/UnaryOpsKernel.cpp.DEFAULT.cpp.DEFAULT.cpp.DEFAULT.cpp.AVX2.cpp.AVX2.cpp.o:(.data.rel.local+0x0): multiple definition of `at::native::DispatchStub&lt;void (*)(at::Tensor&amp;, at::Tensor const&amp;), at::native::truncImpl&gt;::AVX2'
.
.
. //similar multiple difinitions errors
.
CMakeFiles/caffe2.dir/__/aten/src/ATen/native/cpu/Activation.cpp.DEFAULT.cpp.o:(.data.rel.local+0x0): multiple definition of `at::native::DispatchStub&lt;void (*)(at::TensorIterator&amp;, c10::Scalar, c10::Scalar), at::native::threshold_stub&gt;::DEFAULT'
CMakeFiles/caffe2.dir/__/aten/src/ATen/native/cpu/Activation.cpp.DEFAULT.cpp.DEFAULT.cpp.DEFAULT.cpp.DEFAULT.cpp.DEFAULT.cpp.o:(.data.rel.local+0x0): first defined here
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/caffe2.dir/build.make:109851: recipe for target 'lib/libcaffe2.so' failed
make[2]: *** [lib/libcaffe2.so] Error 1
CMakeFiles/Makefile2:4795: recipe for target 'caffe2/CMakeFiles/caffe2.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/caffe2.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "../tools/build_libtorch.py", line 30, in &lt;module&gt;
    subprocess.check_call(command, universal_newlines=True, env=my_env)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/developer/internship/dev/code/pytorch_cpp/pytorch/tools/build_pytorch_libs.sh', '--use-cuda', '--use-nnpack', '--use-mkldnn', '--use-qnnpack', 'caffe2']' returned non-zero exit status 2.
</code></pre>
<p>So I tried to download the precompiled libtorch library. The <a href="https://pytorch.org/get-started/previous-versions/" rel="noopener nofollow ugc">link</a> on pytorch website doesn’t have the links for LIBTORCH.<br>
I also tried looking at multiple github issues to find the required link but still haven’t been able to find it. Since the authors of the repo have already mentioned not to use the precompiled version of libtorch I am not very hopefull  about using it even if i get the link. The earliest version I am able to find is mentioned here in this <a href="https://github.com/pytorch/pytorch/issues/17492#issuecomment-524692441" rel="noopener nofollow ugc">issue</a></p>
<p>I have the following system configuration:<br>
CUDA : Cuda compilation tools, release 10.2, V10.2.89<br>
Ubuntu : 18.04<br>
CUDNN : libcudnn8 → 8.0.5.39-1+cuda10.2</p>
<p>Since I am using cudnn version 8 i have already modified the setup helper python script and CMake files to use <code>cudnn_version.h</code> instead of<code> cudnn.h</code> to get the proper version of CUDNN library<br>
Can anyone please help me with the error in the build?</p>