forked from NVIDIA/cuda-quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
82 lines (69 loc) · 2.96 KB
/
CMakeLists.txt
File metadata and controls
82 lines (69 loc) · 2.96 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# ============================================================================ #
# Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
# the terms of the Apache License 2.0 which accompanies this distribution. #
# ============================================================================ #
add_subdirectory(spin)
set(LIBRARY_NAME cudaq)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ctad-maybe-unsupported")
set(INTERFACE_POSITION_INDEPENDENT_CODE ON)
# Create the CUDA-Q Library
add_library(${LIBRARY_NAME}
SHARED cudaq.cpp
target_control.cpp
algorithms/draw.cpp
platform/quantum_platform.cpp
qis/execution_manager_c_api.cpp
qis/execution_manager.cpp
qis/remote_state.cpp
qis/state.cpp
utils/cudaq_utils.cpp
utils/tensor.cpp
distributed/mpi_plugin.cpp)
set_property(GLOBAL APPEND PROPERTY CUDAQ_RUNTIME_LIBS ${LIBRARY_NAME})
if (CUDA_FOUND)
enable_language(CUDA)
find_package(CUDAToolkit REQUIRED)
target_include_directories(${LIBRARY_NAME}
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/runtime>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/tpls/eigen>
$<BUILD_INTERFACE:${CUDAToolkit_INCLUDE_DIRS}>
PRIVATE .)
target_link_libraries(${LIBRARY_NAME}
PUBLIC dl cudaq-spin cudaq-operators cudaq-common cudaq-nlopt cudaq-ensmallen
PRIVATE nvqir fmt::fmt-header-only CUDA::cudart_static)
target_compile_definitions(${LIBRARY_NAME} PRIVATE CUDAQ_HAS_CUDA)
else()
target_include_directories(${LIBRARY_NAME}
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/runtime>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/tpls/eigen>
PRIVATE .)
target_link_libraries(${LIBRARY_NAME}
PUBLIC dl cudaq-spin cudaq-operators cudaq-common cudaq-nlopt cudaq-ensmallen
PRIVATE nvqir fmt::fmt-header-only)
endif()
add_subdirectory(qis/managers)
add_subdirectory(algorithms)
add_subdirectory(platform)
add_subdirectory(builder)
add_subdirectory(domains)
add_subdirectory(dynamics)
install(TARGETS ${LIBRARY_NAME} EXPORT cudaq-targets DESTINATION lib)
install(EXPORT cudaq-targets
FILE CUDAQTargets.cmake
NAMESPACE cudaq::
DESTINATION lib/cmake/cudaq)
# Install CUDAQ MPI interface header, reference implementation, and build script
# for manual activation on a local system if needed.
install(
FILES
distributed/distributed_capi.h
distributed/builtin/mpi_comm_impl.cpp
distributed/builtin/activate_custom_mpi.sh
DESTINATION distributed_interfaces
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
)