LibTorch crashing on xeus-cling Jupyter Notebook

username: 100deep1001
cooked: <p>Downloaded LibTorch from the official site (WSL on Windows → so chose Linux)<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/8/c827e4f5222552ca5f3d2b684e0d142906901294.png" data-download-href="https://discuss.pytorch.org/uploads/default/c827e4f5222552ca5f3d2b684e0d142906901294" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/c/8/c827e4f5222552ca5f3d2b684e0d142906901294_2_689x342.png" alt="image" data-base62-sha1="syEXYAcOVtcmwTavXdybG1wM8kY" width="689" height="342" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/c/8/c827e4f5222552ca5f3d2b684e0d142906901294_2_689x342.png, https://discuss.pytorch.org/uploads/default/optimized/3X/c/8/c827e4f5222552ca5f3d2b684e0d142906901294_2_1033x513.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/c/8/c827e4f5222552ca5f3d2b684e0d142906901294.png 2x" data-dominant-color="F5DEDB"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1195×593 44.7 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Installed xeus-cling using conda<br>
However, running any code cell after the following instantiation code crashes the kernel :</p>
<pre><code class="lang-auto">#pragma cling add_library_path("/mnt/d/pytorch_cpp/libtorch/lib/")
#pragma cling add_include_path("/mnt/d/pytorch_cpp/libtorch/include")
#pragma cling add_include_path("/mnt/d/pytorch_cpp/libtorch/include/torch/csrc/api/include/")
#pragma cling load("libtorch")
#pragma cling load("libtorch_cpu")
#pragma cling load("libc10")
</code></pre>
<p>Even printing"hello world" after the pragma instantiation code cell ends up crashing so I’m pretty sure something is wrong with the linking of the library itself.</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/3/c/3c1759f72e5ef4bca5693a4bf6763ff41b6abc19.png" data-download-href="https://discuss.pytorch.org/uploads/default/3c1759f72e5ef4bca5693a4bf6763ff41b6abc19" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/3/c/3c1759f72e5ef4bca5693a4bf6763ff41b6abc19_2_690x332.png" alt="image" data-base62-sha1="8zAG3SZRe4rnxm1zgD8Eangr05r" width="690" height="332" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/3/c/3c1759f72e5ef4bca5693a4bf6763ff41b6abc19_2_690x332.png, https://discuss.pytorch.org/uploads/default/optimized/3X/3/c/3c1759f72e5ef4bca5693a4bf6763ff41b6abc19_2_1035x498.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/3/c/3c1759f72e5ef4bca5693a4bf6763ff41b6abc19_2_1380x664.png 2x" data-dominant-color="8C8C8D"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1641×791 45.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Could someone please tell me how to properly link the libtorch library to xeus-cling cpp kernel?<br>
<a class="mention" href="/u/krshrimali">@krshrimali</a></p>