Skip to content

Commit

Permalink
revert build.py changes
Browse files Browse the repository at this point in the history
  • Loading branch information
edgchen1 committed Apr 1, 2024
1 parent e6e1a4e commit 7096d0f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def validate_cuda_home(cuda_home: str | bytes | os.PathLike | None):

def build(
skip_wheel: bool = False,
skip_python: bool = False,
use_cuda: bool | None = None,
use_dml: bool | None = None,
cuda_home: str | bytes | os.PathLike | None = None,
Expand Down Expand Up @@ -126,13 +125,13 @@ def build(

if is_windows():
if not cmake_generator:
command += ["-G", "Visual Studio 17 2022", "-A", "x64"] # this doesn't work for ARM64 Windows
command += ["-G", "Visual Studio 17 2022", "-A", "x64"]
if cuda_home:
toolset = "host=x64" + ",cuda=" + cuda_home
command += ["-T", toolset]
command += [f"-DCMAKE_BUILD_TYPE={config}"]

build_wheel = "OFF" if (skip_python or skip_wheel) else "ON"
build_wheel = "OFF" if skip_wheel else "ON"
build_dir = os.path.abspath(build_dir) if build_dir else os.path.join(os.getcwd(), "build")

command += [
Expand All @@ -145,7 +144,6 @@ def build(
"-DUSE_CUDA=ON" if cuda_home else "-DUSE_CUDA=OFF",
"-DUSE_DML=ON" if use_dml else "-DUSE_DML=OFF",
f"-DBUILD_WHEEL={build_wheel}",
"-DENABLE_PYTHON=" + ("OFF" if skip_python else "ON"),
]

if ort_home:
Expand Down Expand Up @@ -218,7 +216,6 @@ def build(
"Read from CUDA_HOME or CUDA_PATH environment variable if not specified. Not read if --use_cuda is not specified.",
)
parser.add_argument("--skip_wheel", action="store_true", help="Skip building the Python wheel.")
parser.add_argument("--skip_python", action="store_true", help="Skip building the Python API.")
parser.add_argument("--ort_home", default=None, help="Root directory of onnxruntime.")
parser.add_argument("--skip_csharp", action="store_true", help="Skip building the C# API.")
parser.add_argument("--build_dir", default=None, help="Path to output directory.")
Expand All @@ -236,7 +233,6 @@ def build(
update_submodules()
build(
skip_wheel=args.skip_wheel,
skip_python=args.skip_python,
use_cuda=args.use_cuda,
use_dml=args.use_dml,
cuda_home=args.cuda_home,
Expand Down

0 comments on commit 7096d0f

Please sign in to comment.