forked from BallisticLA/RandLAPACK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (44 loc) · 1.55 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.27)
# Set project without CUDA language by default
project(RandLAPACK LANGUAGES CXX)
# Set optional RequireCUDA flag (defaults to OFF)
option(RequireCUDA "Require CUDA support" OFF)
if (RequireCUDA)
find_package(CUDAToolkit)
if (CUDAToolkit_FOUND)
message(STATUS "CUDA found! Enabling CUDA support.")
enable_language(CUDA)
set(CUDA_VISIBILITY_PRESET hidden)
set(CMAKE_CUDA_STANDARD 20)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_CUDA_VISIBILITY_PRESET hidden)
set(CMAKE_CUDA_ARCHITECTURES native)
# Add general CMake module paths
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
# Include CUDA-specific files or flags
include(compiler_flags)
include(find_cuda)
else()
message(STATUS "CUDA not found. Continuing without CUDA support.")
endif()
else()
message(STATUS "CUDA support not required.")
# Add general CMake module paths
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
endif()
# Configure the build
enable_testing()
include(rl_build_options)
include(rl_version)
# Find dependencies
find_package(lapackpp REQUIRED)
# Configure RandBLAS subproject
add_subdirectory(RandBLAS)
# Compile sources
add_subdirectory(RandLAPACK)
add_subdirectory(test)
# Export the configuration
include(rl_config)