Skip to content

Update build_locally.py for Windows support and compilation mode selection #754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions scripts/build_locally.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,22 @@

def run(
use_oneapi=True,
build_type="Release",
c_compiler=None,
cxx_compiler=None,
level_zero=True,
compiler_root=None,
cmake_executable=None,
):
IS_LIN = False
build_system = None

if "linux" in sys.platform:
IS_LIN = True
build_system = "Unix Makefiles"
elif sys.platform in ["win32", "cygwin"]:
pass
build_system = "Ninja"
else:
assert False, sys.platform + " not supported"

if not IS_LIN:
raise RuntimeError(
"This scripts only supports coverage collection on Linux"
)
setup_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
cmake_args = [
sys.executable,
Expand All @@ -37,8 +34,8 @@ def run(
cmake_args += [
"--",
"-G",
"Unix Makefiles",
"-DCMAKE_BUILD_TYPE=Debug",
build_system,
"-DCMAKE_BUILD_TYPE=" + build_type,
"-DCMAKE_C_COMPILER:PATH=" + c_compiler,
"-DCMAKE_CXX_COMPILER:PATH=" + cxx_compiler,
"-DDPCTL_ENABLE_LO_PROGRAM_CREATION=" + ("ON" if level_zero else "OFF"),
Expand Down Expand Up @@ -70,6 +67,13 @@ def run(
dest="oneapi",
action="store_true",
)
driver.add_argument(
"--debug",
default="Release",
const="Debug",
action="store_const",
help="Set the compilation mode to debugging",
)
driver.add_argument(
"--compiler-root", type=str, help="Path to compiler home directory"
)
Expand All @@ -86,7 +90,7 @@ def run(

if args.oneapi:
args.c_compiler = "icx"
args.cxx_compiler = "icpx"
args.cxx_compiler = "icpx" if "linux" in sys.platform else "icx"
args.compiler_root = None
else:
args_to_validate = [
Expand All @@ -107,6 +111,7 @@ def run(

run(
use_oneapi=args.oneapi,
build_type=args.debug,
c_compiler=args.c_compiler,
cxx_compiler=args.cxx_compiler,
level_zero=args.level_zero,
Expand Down