Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
88dd3e4d
Commit
88dd3e4d
authored
Jan 17, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the number of cores to use for building based on system properties.
parent
0bb79f86
Hide 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
...
@@ -32,7 +32,9 @@ import sys
import
shutil
import
shutil
import
platform
import
platform
import
subprocess
import
subprocess
import
multiprocessing
from
distutils
import
log
from
distutils
import
log
from
math
import
ceil
from
setuptools
import
setup
,
Extension
from
setuptools
import
setup
,
Extension
from
setuptools.command.build_ext
import
build_ext
from
setuptools.command.build_ext
import
build_ext
...
@@ -134,7 +136,9 @@ class CMakeBuild(build_ext):
...
@@ -134,7 +136,9 @@ class CMakeBuild(build_ext):
build_args
+=
[
'--'
,
'/m'
]
build_args
+=
[
'--'
,
'/m'
]
else
:
else
:
cmake_args
+=
[
'-DCMAKE_BUILD_TYPE='
+
cfg
]
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
)
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