From 1017282ca3937e63e018f40f27949bcae8138ff8 Mon Sep 17 00:00:00 2001 From: jjwilke Date: Thu, 22 Sep 2022 10:47:12 -0700 Subject: [PATCH 1/2] check for ninja to determine default CMake generator --- install.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install.py b/install.py index 0f210a7fc..87514eef9 100755 --- a/install.py +++ b/install.py @@ -363,6 +363,12 @@ def validate_path(path): def driver(): + ninja_path = shutil.which("ninja") + if ninja_path is None: + cmake_generator_default = None + else: + cmake_generator_default = "Ninja" + parser = argparse.ArgumentParser(description="Install cuNumeric.") parser.add_argument( "--install-dir", @@ -513,8 +519,8 @@ def driver(): "--cmake-generator", dest="cmake_generator", required=False, - default="Ninja", - choices=["Ninja", "Unix Makefiles"], + default=cmake_generator_default, + choices=["Ninja", "Unix Makefiles", None], help="The CMake makefiles generator", ) parser.add_argument( From c011b665541c9b72a45737a904ec8f12742949b6 Mon Sep 17 00:00:00 2001 From: Manolis Papadakis Date: Tue, 11 Oct 2022 12:15:03 -0700 Subject: [PATCH 2/2] Address PR comments, fix typos --- install.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/install.py b/install.py index 87514eef9..8e64d0e5a 100755 --- a/install.py +++ b/install.py @@ -302,7 +302,7 @@ def validate_path(path): cmake_flags = [] if cmake_generator: - cmake_flags += [f"-G{cmake_generator}"] + cmake_flags += [f"-G'{cmake_generator}'"] if debug or verbose: cmake_flags += ["--log-level=%s" % ("DEBUG" if debug else "VERBOSE")] @@ -363,12 +363,6 @@ def validate_path(path): def driver(): - ninja_path = shutil.which("ninja") - if ninja_path is None: - cmake_generator_default = None - else: - cmake_generator_default = "Ninja" - parser = argparse.ArgumentParser(description="Install cuNumeric.") parser.add_argument( "--install-dir", @@ -519,7 +513,7 @@ def driver(): "--cmake-generator", dest="cmake_generator", required=False, - default=cmake_generator_default, + default=(None if shutil.which("ninja") is None else "Ninja"), choices=["Ninja", "Unix Makefiles", None], help="The CMake makefiles generator", )