LibTorch installation issues with CMake

ivankrylatskoe: <p>Hello. Could you, please, help me to find out, what causes the problem.</p>
<p>I am following installation tutorial from here: <a href="https://pytorch.org/cppdocs/installing.html" rel="nofollow noopener">https://pytorch.org/cppdocs/installing.html</a></p>
<p>But after command:</p>
<p><code>cmake -DCMAKE_PREFIX_PATH="C:\Program Files (x86)\LibTorch\libtorch-win-shared-with-deps-debug-1.5.1\libtorch" ..</code></p>
<p>… I get the following output:</p>
<p>============================<br>
– Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.<br>
CMake Warning (dev) at C:/Program Files (x86)/LibTorch/libtorch-win-shared-with-deps-debug-1.5.1/libtorch/share/cmake/Torch/TorchConfig.cmake:39 (if):<br>
if given arguments:</p>
<pre><code>"ON"
</code></pre>
<p>An argument named “ON” appears in a conditional statement.  Policy CMP0012<br>
is not set: if() recognizes numbers and boolean constants.  Run “cmake<br>
–help-policy CMP0012” for policy details.  Use the cmake_policy command to<br>
set the policy and suppress this warning.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:3 (find_package)<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning (dev) at C:/Program Files (x86)/LibTorch/libtorch-win-shared-with-deps-debug-1.5.1/libtorch/share/cmake/Torch/TorchConfig.cmake:53 (if):<br>
if given arguments:</p>
<pre><code>"NOT" "ON"
</code></pre>
<p>An argument named “ON” appears in a conditional statement.  Policy CMP0012<br>
is not set: if() recognizes numbers and boolean constants.  Run “cmake<br>
–help-policy CMP0012” for policy details.  Use the cmake_policy command to<br>
set the policy and suppress this warning.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:3 (find_package)<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning (dev) at C:/Program Files (x86)/LibTorch/libtorch-win-shared-with-deps-debug-1.5.1/libtorch/share/cmake/Torch/TorchConfig.cmake:84 (if):<br>
if given arguments:</p>
<pre><code>"ON"
</code></pre>
<p>An argument named “ON” appears in a conditional statement.  Policy CMP0012<br>
is not set: if() recognizes numbers and boolean constants.  Run “cmake<br>
–help-policy CMP0012” for policy details.  Use the cmake_policy command to<br>
set the policy and suppress this warning.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:3 (find_package)<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning (dev) at C:/Program Files (x86)/LibTorch/libtorch-win-shared-with-deps-debug-1.5.1/libtorch/share/cmake/Torch/TorchConfig.cmake:116 (if):<br>
Policy CMP0054 is not set: Only interpret if() arguments as variables or<br>
keywords when unquoted.  Run “cmake --help-policy CMP0054” for policy<br>
details.  Use the cmake_policy command to set the policy and suppress this<br>
warning.</p>
<p>Quoted variables like “MSVC” will no longer be dereferenced when the policy<br>
is set to NEW.  Since the policy is not set the OLD behavior will be used.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:3 (find_package)<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning (dev) in CMakeLists.txt:<br>
No cmake_minimum_required command is present.  A line of code such as</p>
<pre><code>cmake_minimum_required(VERSION 3.18)
</code></pre>
<p>should be added at the top of the file.  The version specified may be lower<br>
if you wish to support older CMake versions for this project.  For more<br>
information run “cmake --help-policy CMP0000”.<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>– Configuring done<br>
– Generating done<br>
– Build files have been written to: F:/Ivan/My Programs/MyChessCpp/build</p>

ivankrylatskoe: <p>Adding <code>-Wno-dev</code> key to cmake command suppresed the output about errors</p>

glaringlee: <p><a class="mention" href="/u/ivankrylatskoe">@ivankrylatskoe</a><br>
Can you please create an issue at here? <a href="https://github.com/pytorch/pytorch/issues" rel="nofollow noopener">https://github.com/pytorch/pytorch/issues</a><br>
We will have people who is working on build to take a look at this. thx</p>

gedoensmax: <p><a class="mention" href="/u/ivankrylatskoe">@ivankrylatskoe</a> Hey did you figure out what the problem with your code was ?</p>

ivankrylatskoe: <p>No, I used another library.</p>