Relationship between CMake build and python setup.py

Sorry to bother everyone again, but I really need to make myself understand the building structure of PyTorch.

  • CMake out-of-source buld: alway can ben done successfully, after my manual configuration.
  • python setup.py build --cmake tried to build PyTorch independelty, which seems to ignore ALL my out-of-source cmake configuration, even if with --cmake configuration. And, it looks python setup.py build --cmake wouldn’t let me manually configure the cmake configurations.

Again, my questions:

  1. Is there any possibility that when I tried to do python setup.py build --cmake, it would force to use cmake out-of-source configuration inside subfolder build ?
  2. Is there a similar command that use ccmake? say: python setup.py build --ccmake ??
  3. I can clearly tell that by using cmake build, I already successfully built out libtorch_python.so. So, how to use PyTorch in python, without building PyTorch by running python setup.py build -cmake and install again? Is it possible? I mean: with libtorch_pytorch.so, can I load torch module from within python script?

Thank you very much…

I got it… Problem solved…
It looks I can do

  1. CMake build FIRST
  2. TORCH_CUDA_ARCH_LIST="8.6" NO_TEST=1 USE_MKLDNN=0 FULL_CAFFE2=1 python setup.py bdist_wheel