Skip to content

Commit 09bc52e

Browse files
committed
parallel
1 parent 181fc96 commit 09bc52e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ def build_extension(self, ext):
160160
# CMake 3.12+ only.
161161
build_args += ["-j{}".format(self.parallel)]
162162
else:
163-
build_args += ["-j4"]
163+
# Automatically set parallel jobs based on CPU core count
164+
cpu_count = os.cpu_count() or 1
165+
build_args += ["-j{}".format(cpu_count)]
164166

165167
if not os.path.exists(self.build_temp):
166168
os.makedirs(self.build_temp)

0 commit comments

Comments
 (0)