Compiling libtorch for a C++ version of choice and/or an old version of CUDA?

username: Warrior
cooked: <p>I have never used libtorch before so please bear with me and my potentially naive questions.<br>
How can I compile libtorch with a C++ version of my choice? right now I’m thinking to compile it for C++11 but I’m not sure how I can do it. Can someone point me to some step-by-step guidelines for that?<br>
Also, although I don’t need to use GPU for what I’m interested in but in case I want to, I will have to compile a version of libtorch that is compatible with CUDA v 7.5. Would I still be able to compile an old version of libtorch that is compatible with such old version of CUDA? If so, how can I compile it for CUDA 7.5?</p>

username: ptrblck
cooked: <p>For CUDA7.5: no, you won’t be able to build PyTorch/libtorch for CUDA7.5, as the min. required version is CUDA9.2.<br>
Also, based on <a href="https://github.com/pytorch/pytorch#from-source">these</a> instructions, C++14 seems to be required now.</p>

username: Warrior
cooked: <p><a class="mention" href="/u/ptrblck">@ptrblck</a>  So do you mean there is no way to compile libtorch for C++11? Even if I am okay using an older version of libtorch/PyTorch (e.g. v.1.1)?<br>
I’m asking this because I am developing a C++11 project and want to use PyTorch in my C++ code. Does the C++14 requirement mean that I cannot use libtorch in C++11 or do you mean I just need to have C++14 during compilation but can still use the compiled libraries in my C++11 code base?<br>
Also, the instructions link you sent doesn’t seem to have any info on how one can compile PyTorch as a C++ package (libtorch) or maybe I’m missing something?</p>

username: ptrblck
cooked: <p>You might be able to use C++11.<br>
I just checked <a href="https://pytorch.org/tutorials/advanced/cpp_frontend.html">these docs</a>, where it’s claiming:</p>
<blockquote>
<p>The C++ frontend exposes a pure C++11 API that extends this underlying C++ codebase with tools required for machine learning training and inference.</p>
</blockquote>
<p>so I’m unsure why the build instructions name C++14 as the required version.<br>
Also the <a href="https://pytorch.org/get-started/locally/">download</a> supports the Pre-cxx11 ABI and cxx11 ABI in case you want to download it without building.</p>
<p><a href="https://github.com/pytorch/pytorch/blob/master/docs/libtorch.rst">These instructions</a> are also targeting a libtorch-only build. I haven’t used it in a while and am usually building libtorch as part of a complete source build.</p>

username: Warrior
cooked: <p><a class="mention" href="/u/ptrblck">@ptrblck</a>  Thanks for the info. What are Pre-cxx11 ABI and cxx11 ABI? Sorry I am not that expert at C++ … .<br>
So just to make things more clear, I can <a href="https://pytorch.org/get-started/locally/" rel="noopener nofollow ugc">download</a> libtorch which is complied to be used in a C++14 project, or I can <a href="https://github.com/pytorch/pytorch/blob/master/docs/libtorch.rst" rel="noopener nofollow ugc">compile it</a> myself to use it in a C++11 project. I can also compile PyTorch and set the corresponding flag so that the C++ library gets compiled simultaneously. Are these all correct?</p>