I have never used libtorch before so please bear with me and my potentially naive questions.
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?
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?
For CUDA7.5: no, you won’t be able to build PyTorch/libtorch for CUDA7.5, as the min. required version is CUDA9.2.
Also, based on these instructions, C++14 seems to be required now.
@ptrblck 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)?
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?
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?
You might be able to use C++11.
I just checked these docs, where it’s claiming:
The C++ frontend exposes a pure C++11 API that extends this underlying C++ codebase with tools required for machine learning training and inference.
so I’m unsure why the build instructions name C++14 as the required version.
Also the download supports the Pre-cxx11 ABI and cxx11 ABI in case you want to download it without building.
These instructions 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.
@ptrblck Thanks for the info. What are Pre-cxx11 ABI and cxx11 ABI? Sorry I am not that expert at C++ … .
So just to make things more clear, I can download libtorch which is complied to be used in a C++14 project, or I can compile it 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?