Skip to content

Commit

Permalink
[Android] Add -j option to cmake build (#2321)
Browse files Browse the repository at this point in the history
This PR adds the `-j` option to cmake build to parallelize the
build job over CPU cores.
  • Loading branch information
MasterJH5574 authored May 10, 2024
1 parent 3a0b42c commit 2b8aadf
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions android/mlc4j/prepare_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,31 @@ def run_cmake(mlc4j_path: Path):

def run_cmake_build():
logger.info("Running cmake build")
cmd = ["cmake", "--build", ".", "--target", "tvm4j_runtime_packed", "--config", "release"]
cmd = [
"cmake",
"--build",
".",
"--target",
"tvm4j_runtime_packed",
"--config",
"release",
f"-j{os.cpu_count()}",
]
subprocess.run(cmd, check=True, env=os.environ)


def run_cmake_install():
logger.info("Running cmake install")
cmd = ["cmake", "--build", ".", "--target", "install", "--config", "release", "-j"]
cmd = [
"cmake",
"--build",
".",
"--target",
"install",
"--config",
"release",
f"-j{os.cpu_count()}",
]
subprocess.run(cmd, check=True, env=os.environ)


Expand Down

0 comments on commit 2b8aadf

Please sign in to comment.