enable increment build for build_libtorch (#63074)
authorYi Zhang <zhanyi@microsoft.com>
Fri, 20 Aug 2021 23:28:39 +0000 (16:28 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 20 Aug 2021 23:30:34 +0000 (16:30 -0700)
Summary:
Since issue https://github.com/pytorch/pytorch/issues/59859 is resolved.

rerun_cmake in build_libtorch should not be hardcoded.
build_libtorch is necessary to generate debug version libtorch.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/63074

Reviewed By: VitalyFedyunin, seemethere

Differential Revision: D30306705

Pulled By: malfet

fbshipit-source-id: f2077d334191f4973da0681560937bc8bab730c1

tools/build_libtorch.py

index 800d8eb..c263e50 100644 (file)
@@ -14,7 +14,10 @@ from tools.setup_helpers.cmake import CMake
 if __name__ == '__main__':
     # Placeholder for future interface. For now just gives a nice -h.
     parser = argparse.ArgumentParser(description='Build libtorch')
+    parser.add_argument('--rerun-cmake', action="store_true", help='rerun cmake')
+    parser.add_argument('--cmake-only', action="store_true",
+                        help='Stop once cmake terminates. Leave users a chance to adjust build options')
     options = parser.parse_args()
 
     build_caffe2(version=None, cmake_python_library=None, build_python=False,
-                 rerun_cmake=True, cmake_only=False, cmake=CMake())
+                 rerun_cmake=options.rerun_cmake, cmake_only=options.cmake_only, cmake=CMake())