Skip to content
This repository was archived by the owner on Jul 14, 2022. It is now read-only.

Commit 2df7934

Browse files
Enable building shared libs with CUDA with VTKm >= 1.7 (#237)
* Enable building shared libs with CUDA with VTKm >= 1.7 * Add CUDA with shared CI test
1 parent 2628a89 commit 2df7934

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

azure-pipelines.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,14 @@ stages:
229229
timeoutInMinutes: 0
230230
strategy:
231231
matrix:
232+
shared_vtkh:
233+
BUILD_SHARED_LIBS: ON
234+
CMAKE_BUILD_TYPE: Release
235+
SPACK_SHARED_VARIANT: +shared
232236
static_vtkh:
233237
BUILD_SHARED_LIBS: OFF
234238
CMAKE_BUILD_TYPE: Release
239+
SPACK_SHARED_VARIANT: ~shared
235240
steps:
236241
- checkout: self
237242
clean: boolean
@@ -266,7 +271,7 @@ stages:
266271
which python
267272
python --version
268273
# setup spack spec (must be static)
269-
export SPACK_SPEC="%gcc+mpi+cuda~openmp~shared"
274+
export SPACK_SPEC="%gcc+mpi+cuda~openmp"
270275
export SPACK_SPEC="${SPACK_SPEC}${SPACK_SHARED_VARIANT} ^vtk-m+cuda${SPACK_SHARED_VARIANT}"
271276
export SPACK_SPEC="${SPACK_SPEC} ^cmake~openssl~ncurses"
272277
echo $SPACK_SPEC

src/CMakeLists.txt

-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ if(NOT ENABLE_SERIAL AND NOT ENABLE_MPI)
6161
"Please set ENABLE_SERIAL, ENABLE_MPI or both to ON")
6262
endif()
6363

64-
65-
if(ENABLE_CUDA AND BUILD_SHARED_LIBS)
66-
message(FATAL_ERROR "Static libraries are required when building with CUDA")
67-
endif()
68-
6964
if(ENABLE_CUDA)
7065
# ask politely a few times for SEPARABLE COMPILATION
7166
set (CMAKE_CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" )

src/cmake/thirdparty/SetupVTKm.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ if(ENABLE_CUDA AND NOT VTKm_ENABLE_CUDA)
6464
message(FATAL_ERROR "VTK-h CUDA support requires VTK-m with CUDA support (ENABLE_CUDA == TRUE, however VTKm_ENABLE_CUDA == FALSE")
6565
endif()
6666

67+
if(ENABLE_CUDA AND BUILD_SHARED_LIBS)
68+
if(VTKm_VERSION VERSION_LESS "1.7.0")
69+
message(FATAL_ERROR "Cannot build shared libs with CUDA when VTKm is < v1.7.0")
70+
endif()
71+
endif()
6772

6873
set(VTKM_FOUND TRUE)
6974

0 commit comments

Comments
 (0)