Specify build dir as a global variable in BUILD_DIR in the build system.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23318
Test Plan: Imported from OSS
Differential Revision: D16493987
Pulled By: ezyang
fbshipit-source-id: 497e9dd924280f61dde095b4f2b50f5402d9da97