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
89ee7cdb
Commit
89ee7cdb
authored
Feb 12, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure fPIC gets propagated to nvcc in all cases.
parent
9bd418a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
CMakeLists.txt
dlib/CMakeLists.txt
+5
-0
add_python_module
dlib/cmake_utils/add_python_module
+1
-0
No files found.
dlib/CMakeLists.txt
View file @
89ee7cdb
...
@@ -529,6 +529,11 @@ if (NOT TARGET dlib)
...
@@ -529,6 +529,11 @@ if (NOT TARGET dlib)
# magic in the standard C++ header files (since nvcc uses gcc headers on
# magic in the standard C++ header files (since nvcc uses gcc headers on
# linux).
# linux).
list
(
APPEND CUDA_NVCC_FLAGS
"-arch=sm_30;-std=c++11;-D__STRICT_ANSI__;-D_MWAITXINTRIN_H_INCLUDED;-D_FORCE_INLINES;
${
FLAGS_FOR_NVCC
}
"
)
list
(
APPEND CUDA_NVCC_FLAGS
"-arch=sm_30;-std=c++11;-D__STRICT_ANSI__;-D_MWAITXINTRIN_H_INCLUDED;-D_FORCE_INLINES;
${
FLAGS_FOR_NVCC
}
"
)
if
(
CMAKE_POSITION_INDEPENDENT_CODE
)
# sometimes this setting isn't propagated to NVCC, which then causes the
# compile to fail. So make sure it's propagated.
list
(
APPEND CUDA_NVCC_FLAGS
"-Xcompiler -fPIC"
)
endif
()
include
(
cmake_utils/test_for_cudnn/find_cudnn.txt
)
include
(
cmake_utils/test_for_cudnn/find_cudnn.txt
)
...
...
dlib/cmake_utils/add_python_module
View file @
89ee7cdb
...
@@ -132,6 +132,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
...
@@ -132,6 +132,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
# -fPIC for GCC but sometimes it still doesn't get set, so make sure it
# -fPIC for GCC but sometimes it still doesn't get set, so make sure it
# does.
# does.
add_definitions("-fPIC")
add_definitions("-fPIC")
set(CMAKE_POSITION_INDEPENDENT_CODE True)
else()
else()
set(CMAKE_POSITION_INDEPENDENT_CODE True)
set(CMAKE_POSITION_INDEPENDENT_CODE True)
endif()
endif()
...
...
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