cmake and an anaconda based python install will get pytorch going with all required dependencies.
Optional dependencies are CUDA, CUDNN
More can be read here: https://github.com/pytorch/pytorch#from-source 20 or you can look at the docker image: https://github.com/pytorch/pytorch#docker-image 10
WITH_DISTRIBUTED is not fully fleshed out or supported, we cant spec out the requirements yet.