I am trying to build libtorch, to make it usable from a cmake project, to get a result like the offical build in here: download pytorch org/libtorch/nightly/cpu/libtorch-shared-with-deps-latest.zip
is what I want to get, but I was unable to get it by following this exactly:

  
      github.com
  
  
    pytorch/pytorch/blob/master/docs/libtorch.rst 29
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
-----------------

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

  
  
    
    
  
  


I used pytorch 1.4.0 tag on ubuntu16.04, and followed the above instructions exactly. What I got in pytorch_build folder is another folder named build, and in it a mess of cmake build “residuals” like the “CMakeFiles” folder, together with the lib, bin and include folders, but without the “share” folder.
Did anyone has success following these instructions?
The discussion I’ve found, here:
discuss pytorch org/t/building-libtorch-c-distribution-from-source/27519/2
triggers this issue:

  
      github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      Official instructions for how to build libtorch don't have same structure as prebuilt binaries 20
    

    
      
        opened 
        
          
        
        May 8, 2019
      
      

        
          closed 
        
          
        
        May 30, 2019
      
        

      
        
          
          ezyang
        
      
    
  



  On Slack, Geoffrey Yu asked:
Are there instructions for building libtorch from source? I feel like I'm missing something since I've tried...



    high priority
    module: binaries
    module: build
    module: cpp
    module: docs
    triaged


  
  
    
    
  
  


which was closed with updated instructions, But I follow them and still do not get anything like the official build.
A similar question have been unanswered here: on question discuss pytorch org/t/how-to-build-libtorch-with-cmake/42723
Sorry for not including the full links, I’m a new user and discuss won’t let me include more than two links
Any ideas?
Should this be an issue to be opened on github?
Thanks