Hello!
I am trying to build libtorch on an HPC with very limited python support (no dependencies). Since I am trying to utilize the C++ frontend only and

  

      github.com
  

  
    pytorch/pytorch/blob/master/docs/libtorch.rst 2


    libtorch (C++-only)
===================

The core of pytorch does not depend on Python. A
CMake-based build system compiles the C++ source code into a shared
object, libtorch.so.

Building libtorch using Python
------------------------------

You can use a python script/module located in tools package to build libtorch
::
   cd <pytorch_root>

   # Make a new folder to build in to avoid polluting the source directories
   mkdir build_libtorch && cd build_libtorch

   # You might need to export some required environment variables here.
   Normally setup.py sets good default env variables, but you'll have to do
   that manually.



  This file has been truncated. show original

  

  
    
    
  

  


states that I don’t need python to build libtorch, I am wondering if anybody managed to do it without any python installation before. When I try to configure cmake, I get the following error:
File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/raid/projects/pytorch/tools/codegen/gen.py", line 3, in <module>
    from typing_extensions import Literal
ModuleNotFoundError: No module named 'typing_extensions'

I see that cmake is actually checking my python directories, which is super weird since I don’t want to do anything with python. This is the cmake command that I tried in my build directory:
cmake -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Release -DPYTHON_LIBRARY='' -DCMAKE_INSTALL_PREFIX:PATH=../pytorch-install -DBUILD_PYTHON:BOOL=OFF -DBUILD_TEST=OFF ../pytorch

Any help would be much appreciated. Thanks!