@@ -209,8 +209,7 @@ endif()
209209option (BUILD_SHARED "Build Charm++ dynamic libraries" OFF )
210210
211211# Other options
212- option (CUDA "Build with CUDA support" OFF )
213-
212+ option (BUILD_CUDA "Build with CUDA support" OFF )
214213option (PXSHM "Build with PXSHM" OFF )
215214
216215# LRTS PMI options
@@ -224,8 +223,6 @@ string(REPLACE ";" " " MY_EXTRA_OPTS "${MY_EXTRA_OPTS}")
224223set (OPTS "${OPTS} ${MY_EXTRA_OPTS} " )
225224set (OPTSATBUILDTIME "${OPTSATBUILDTIME} ${MY_EXTRA_OPTS} " )
226225
227- # We need both BUILD_CUDA and CUDA
228- set (BUILD_CUDA ${CUDA} )
229226
230227# Also build shared Charm++ libraries in lib_so/
231228if (BUILD_SHARED)
@@ -689,7 +686,8 @@ configure_file(src/scripts/conv-config.sh include/ COPYONLY)
689686configure_file (src/arch/${VDIR} /conv-mach.sh include / COPYONLY )
690687
691688set (CUDA_DIR "" )
692- if (CUDA)
689+ if (BUILD_CUDA)
690+
693691 file (GLOB_RECURSE hybridAPI-h-sources ${CMAKE_SOURCE_DIR} /src/arch/cuda/*.h)
694692 file (GLOB_RECURSE hybridAPI-cxx-sources ${CMAKE_SOURCE_DIR} /src/arch/cuda/*.cpp)
695693 foreach (file ${hybridAPI-h-sources })
@@ -995,6 +993,10 @@ if(${TARGET} STREQUAL "charm4py")
995993 target_link_libraries (charm ck converse memory-default threads-default ldb-rand "-Llib/ -standalone -whole-archive -c++stl -shared" )
996994 endif ()
997995
996+ if (${BUILD_CUDA} )
997+ target_link_libraries (charm cudart cudahybridapi)
998+ endif ()
999+
9981000 add_dependencies (charm hwloc)
9991001endif ()
10001002
@@ -1096,6 +1098,7 @@ foreach(l CUDA_DIR BUILD_CUDA CMK_AMPI_WITH_ROMIO CMK_MACOSX CMK_BUILD_PYTHON
10961098endforeach (l)
10971099
10981100# Add options
1101+ set (CUDA ${BUILD_CUDA} ) # need CUDA to match conv-mach file name
10991102foreach (opt SMP OMP TCP PTHREADS SYNCFT PXSHM PERSISTENT OOC CUDA PAPI CXI)
11001103 if (${opt} )
11011104 string (TOLOWER ${opt} optl)
0 commit comments