Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Sudhanshu Sane
VTK-m
Commits
deb4946a
Commit
deb4946a
authored
Dec 13, 2018
by
Robert Maynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure vtk-m libraries under CUDA 8 are always built statically
parent
9c496e5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
5 deletions
+31
-5
CMake/VTKmDeviceAdapters.cmake
CMake/VTKmDeviceAdapters.cmake
+11
-0
CMake/VTKmWrappers.cmake
CMake/VTKmWrappers.cmake
+20
-5
No files found.
CMake/VTKmDeviceAdapters.cmake
View file @
deb4946a
...
...
@@ -134,6 +134,17 @@ if(VTKm_ENABLE_CUDA AND NOT TARGET vtkm::cuda)
add_library
(
vtkm::cuda UNKNOWN IMPORTED GLOBAL
)
endif
()
# Workaround issue with CUDA 8.X where virtual don't work when building
# VTK-m as shared. We don't want to force BUILD_SHARED_LIBS to a specific
# value as that could impact other projects that embed VTK-m. Instead what
# we do is make sure that libraries built by vtkm_library() are static
# if they use cuda
if
(
CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0
)
set_target_properties
(
vtkm::cuda PROPERTIES REQUIRES_STATIC_BUILDS TRUE
)
else
()
set_target_properties
(
vtkm::cuda PROPERTIES REQUIRES_STATIC_BUILDS FALSE
)
endif
()
set_target_properties
(
vtkm::cuda PROPERTIES
INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CUDA>:--expt-relaxed-constexpr>
)
...
...
CMake/VTKmWrappers.cmake
View file @
deb4946a
...
...
@@ -282,16 +282,31 @@ function(vtkm_library)
endif
()
set
(
lib_name
${
VTKm_LIB_NAME
}
)
if
(
VTKm_LIB_STATIC
)
set
(
VTKm_LIB_type STATIC
)
else
()
if
(
VTKm_LIB_SHARED
)
set
(
VTKm_LIB_type SHARED
)
endif
()
#if cuda requires static libaries force
#them no matter what
if
(
TARGET vtkm::cuda
)
get_target_property
(
force_static vtkm::cuda REQUIRES_STATIC_BUILDS
)
if
(
force_static
)
set
(
VTKm_LIB_type STATIC
)
message
(
"Forcing
${
lib_name
}
to be built statically as we are using CUDA 8.X, which doesn't support virtuals sufficiently in dynamic libraries."
)
endif
()
endif
()
endif
()
if
(
TARGET vtkm::cuda
)
vtkm_compile_as_cuda
(
cu_srcs
${
VTKm_LIB_WRAP_FOR_CUDA
}
)
set
(
VTKm_LIB_WRAP_FOR_CUDA
${
cu_srcs
}
)
endif
()
if
(
VTKm_LIB_STATIC
)
set
(
VTKm_LIB_type STATIC
)
elseif
(
VTKm_LIB_SHARED
)
set
(
VTKm_LIB_type SHARED
)
endif
()
add_library
(
${
lib_name
}
${
VTKm_LIB_type
}
...
...
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