Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
88dd3e4d
Commit
88dd3e4d
authored
Jan 16, 2018
by
Davis King
Browse files
Set the number of cores to use for building based on system properties.
parent
0bb79f86
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
setup.py
setup.py
+5
-1
No files found.
setup.py
View file @
88dd3e4d
...
...
@@ -32,7 +32,9 @@ import sys
import
shutil
import
platform
import
subprocess
import
multiprocessing
from
distutils
import
log
from
math
import
ceil
from
setuptools
import
setup
,
Extension
from
setuptools.command.build_ext
import
build_ext
...
...
@@ -134,7 +136,9 @@ class CMakeBuild(build_ext):
build_args
+=
[
'--'
,
'/m'
]
else
:
cmake_args
+=
[
'-DCMAKE_BUILD_TYPE='
+
cfg
]
build_args
+=
[
'--'
,
'-j2'
]
# Do a parallel build
num_cores
=
int
(
ceil
(
multiprocessing
.
cpu_count
()
/
2.0
))
build_args
+=
[
'--'
,
'-j'
+
str
(
num_cores
)]
build_folder
=
os
.
path
.
abspath
(
self
.
build_temp
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment