Skip to content

Commit 96bfc2f

Browse files
cmake parallel jobs (#519)
* cmake parallel jobs
1 parent 5dae6f3 commit 96bfc2f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

utils/command_build_cmake_clib.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ def run(self):
122122
"-DDPNP_BACKEND_TESTS:BOOL=" + enable_tests
123123
]
124124

125+
# didn't find how to add it inside cmake, that is why this is here
126+
import multiprocessing
127+
cpu_count = multiprocessing.cpu_count()
128+
# possible that jobs count must be +-1 against CPUs count
129+
jobs = "-j" + str(cpu_count)
130+
125131
self.spawn(["cmake"] + cmake_args + [backend_directory])
126132
if not self.dry_run:
127-
self.spawn(["cmake", "--build", abs_build_temp_path])
133+
self.spawn(["cmake", "--build", abs_build_temp_path, jobs])
128134
self.spawn(["cmake", "--install", abs_build_temp_path])

0 commit comments

Comments
 (0)