Index: streamexecutor/CMakeLists.txt =================================================================== --- streamexecutor/CMakeLists.txt +++ streamexecutor/CMakeLists.txt @@ -2,10 +2,18 @@ option(STREAM_EXECUTOR_UNIT_TESTS "enable unit tests" ON) option(STREAM_EXECUTOR_ENABLE_DOXYGEN "enable StreamExecutor doxygen" ON) -option(STREAM_EXECUTOR_ENABLE_CONFIG_TOOL "enable building streamexecutor-config tool" ON) -option(STREAM_EXECUTOR_ENABLE_CUDA_PLATFORM "enable building the CUDA StreamExecutor platform" OFF) - -configure_file("include/streamexecutor/PlatformOptions.h.in" "include/streamexecutor/PlatformOptions.h") +option( + STREAM_EXECUTOR_ENABLE_CONFIG_TOOL + "enable building streamexecutor-config tool" + ON) +option(STREAM_EXECUTOR_ENABLE_CUDA_PLATFORM + "enable building the CUDA StreamExecutor platform \ +(see CMake's 'FindCUDA' documentation for info on specifying the CUDA path)" + OFF) + +configure_file( + "include/streamexecutor/PlatformOptions.h.in" + "include/streamexecutor/PlatformOptions.h") # First find includes relative to the streamexecutor top-level source path. include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include) Index: streamexecutor/lib/CMakeLists.txt =================================================================== --- streamexecutor/lib/CMakeLists.txt +++ streamexecutor/lib/CMakeLists.txt @@ -4,21 +4,20 @@ endmacro(add_se_library) if(STREAM_EXECUTOR_ENABLE_CUDA_PLATFORM) - set( - CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - "${CMAKE_CURRENT_SOURCE_DIR}/platforms/cuda/cmake/modules/") - - find_package(Libcuda REQUIRED) - include_directories(${LIBCUDA_INCLUDE_DIRS}) - + find_package(CUDA REQUIRED) + include_directories(${CUDA_INCLUDE_DIRS}) + find_library(CUDA_DRIVER_LIBRARY cuda) + if(NOT CUDA_DRIVER_LIBRARY) + message(FATAL_ERROR + "could not find libcuda, \ +is the CUDA driver is installed on your system?") + endif() set( STREAM_EXECUTOR_CUDA_PLATFORM_TARGET_OBJECT $) - set( STREAM_EXECUTOR_LIBCUDA_LIBRARIES - ${LIBCUDA_LIBRARIES}) + ${CUDA_DRIVER_LIBRARY}) endif(STREAM_EXECUTOR_ENABLE_CUDA_PLATFORM) add_subdirectory(platforms) Index: streamexecutor/lib/platforms/cuda/cmake/modules/FindLibcuda.cmake =================================================================== --- streamexecutor/lib/platforms/cuda/cmake/modules/FindLibcuda.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# - Try to find the libcuda library -# Once done this will define -# LIBCUDA_FOUND - System has libcuda -# LIBCUDA_INCLUDE_DIRS - The libcuda include directories -# LIBCUDA_LIBRARIES - The libraries needed to use libcuda - -# TODO(jhen): Allow users to specify a search path. -find_path(LIBCUDA_INCLUDE_DIR cuda.h /usr/local/cuda/include) -# TODO(jhen): Use the library that goes with the headers. -find_library(LIBCUDA_LIBRARY cuda) - -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set LIBCUDA_FOUND to TRUE if -# all listed variables are TRUE -find_package_handle_standard_args( - LIBCUDA DEFAULT_MSG LIBCUDA_INCLUDE_DIR LIBCUDA_LIBRARY) - -mark_as_advanced(LIBCUDA_INCLUDE_DIR LIBCUDA_LIBRARY) - -set(LIBCUDA_LIBRARIES ${LIBCUDA_LIBRARY}) -set(LIBCUDA_INCLUDE_DIRS ${LIBCUDA_INCLUDE_DIR})