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
6d281c31
Commit
6d281c31
authored
Sep 30, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
de365031
99a91ce6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
cmake
dlib/cmake
+6
-0
setup.py
setup.py
+5
-1
CMakeLists.txt
tools/python/CMakeLists.txt
+1
-0
No files found.
dlib/cmake
View file @
6d281c31
...
...
@@ -32,10 +32,13 @@ if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF)
if(USE_AVX_INSTRUCTIONS)
add_definitions(-mavx)
message(STATUS "Enabling AVX instructions")
elseif (USE_SSE4_INSTRUCTIONS)
add_definitions(-msse4)
message(STATUS "Enabling SSE4 instructions")
elseif(USE_SSE2_INSTRUCTIONS)
add_definitions(-msse2)
message(STATUS "Enabling SSE2 instructions")
endif()
elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visual Studio
# Use SSE2 by default when using Visual Studio.
...
...
@@ -52,12 +55,14 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
check_type_size( "void*" SIZE_OF_VOID_PTR)
if(USE_AVX_INSTRUCTIONS)
add_definitions(/arch:AVX)
message(STATUS "Enabling AVX instructions")
elseif (USE_SSE4_INSTRUCTIONS)
# Visual studio doesn't have an /arch:SSE2 flag when building in 64 bit modes.
# So only give it when we are doing a 32 bit build.
if (SIZE_OF_VOID_PTR EQUAL 4)
add_definitions(/arch:SSE2)
endif()
message(STATUS "Enabling SSE4 instructions")
add_definitions(-DDLIB_HAVE_SSE2)
add_definitions(-DDLIB_HAVE_SSE3)
add_definitions(-DDLIB_HAVE_SSE41)
...
...
@@ -67,6 +72,7 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
if (SIZE_OF_VOID_PTR EQUAL 4)
add_definitions(/arch:SSE2)
endif()
message(STATUS "Enabling SSE2 instructions")
add_definitions(-DDLIB_HAVE_SSE2)
endif()
endif()
...
...
setup.py
View file @
6d281c31
...
...
@@ -256,7 +256,6 @@ _ON_POSIX = 'posix' in sys.builtin_module_names
def
enqueue_output
(
out
,
queue
):
for
line
in
iter
(
out
.
readline
,
b
''
):
queue
.
put
(
line
)
out
.
close
()
def
_log_buf
(
buf
):
...
...
@@ -298,6 +297,11 @@ def run_process(cmds, timeout=None):
elapsed
=
time
.
time
()
-
_time
if
timeout
and
elapsed
>
timeout
:
break
# Make sure we print all the output from the process.
if
p
.
stdout
:
for
line
in
p
.
stdout
:
_log_buf
(
line
)
p
.
wait
()
except
(
KeyboardInterrupt
,
SystemExit
)
as
e
:
# if user interrupted
pass
...
...
tools/python/CMakeLists.txt
View file @
6d281c31
...
...
@@ -2,6 +2,7 @@
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8.4
)
set
(
USE_SSE4_INSTRUCTIONS ON CACHE BOOL
"Use SSE4 instructions"
)
include
(
../../dlib/add_python_module
)
# Tell cmake to compile all these cpp files into a dlib python module.
...
...
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