fix python interpreter can not be found (#10543)
Summary:
Custom python installation, which have no aliases to `python` or `python3` can't be found by cmake `findPythonInterp` without extra cmake argument.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/10543
Differential Revision: D9378844
Pulled By: ezyang
fbshipit-source-id: 022e20aab7e27a5a56b8eb91b6026151116193c7
diff --git a/tools/build_pytorch_libs.sh b/tools/build_pytorch_libs.sh
index c2d22ec..a9726a5 100755
--- a/tools/build_pytorch_libs.sh
+++ b/tools/build_pytorch_libs.sh
@@ -257,6 +257,7 @@
${CMAKE_VERSION} $BASE_DIR \
${CMAKE_GENERATOR} \
+ -DPYTHON_EXECUTABLE=$PYTORCH_PYTHON \
-DBUILDING_WITH_TORCH_LIBS=ON \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_CAFFE2=$FULL_CAFFE2 \