CMakeLists.txt 3.62 KB
Newer Older
1
2
###
#
3
# @copyright (c) 2009-2015 The University of Tennessee and The University
4
5
#                          of Tennessee Research Foundation.
#                          All rights reserved.
6
7
# @copyright (c) 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
#                          Univ. Bordeaux. All rights reserved.
8
9
10
11
12
#
###
#
#  @file CMakeLists.txt
#
13
14
#  @project CHAMELEON
#  CHAMELEON is a software package provided by:
15
16
17
18
19
20
#     Inria Bordeaux - Sud-Ouest,
#     Univ. of Tennessee,
#     King Abdullah Univesity of Science and Technology
#     Univ. of California Berkeley,
#     Univ. of Colorado Denver.
#
21
#  @version 0.9.0
22
23
24
#  @author Cedric Castagnede
#  @author Emmanuel Agullo
#  @author Mathieu Faverge
25
#  @author Florent Pruvost
26
27
28
29
30
#  @date 13-07-2012
#
###
cmake_minimum_required(VERSION 2.8)

31
32
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include )
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/include )
33

34
35
36
37
38
39
40
41
42
# # Generate headers for all possible precisions
# # --------------------------------------------
# set(RUNTIME_HDRS_GENERATED "")
# set(ZHDR
# )
#
# precisions_rules_py(RUNTIME_HDRS_GENERATED "${ZHDR}"
#   PRECISIONS "s;d;c;z;ds;zc"
#   TARGETDIR  "include")
43
44
45
46

# Define the list of headers
# --------------------------
set(RUNTIME_HDRS
47
48
49
50
51
52
53
54
55
  include/chameleon_quark.h
  include/core_blas_dag.h
  )

# # Add generated headers
# # ---------------------
# foreach( hdr_file ${RUNTIME_HDRS_GENERATED} )
#   list(APPEND RUNTIME_HDRS ${CMAKE_CURRENT_BINARY_DIR}/${hdr_file})
# endforeach()
56
57
58

# Force generation of headers
# ---------------------------
59
60
61
add_custom_target(
  runtime_quark_include
  ALL SOURCES ${RUNTIME_HDRS})
62

63
# Installation
64
# ------------
65
66
67
install(
  FILES ${RUNTIME_HDRS}
  DESTINATION include/runtime/quark )
68

69
70
# Generate the Chameleon common for all possible precisions
# ---------------------------------------------------------
71
72
set(RUNTIME_COMMON_GENERATED "")
set(ZSRC
73
74
75
  control/runtime_zprofiling.c
  control/runtime_zlocality.c
  )
76

77
78
79
80
precisions_rules_py(
  RUNTIME_COMMON_GENERATED "${ZSRC}"
  PRECISIONS "${CHAMELEON_PRECISION}"
  TARGETDIR "control")
81
82

set(RUNTIME_COMMON
83
84
85
86
87
88
89
90
91
92
93
94
  control/runtime_async.c
  control/runtime_context.c
  control/runtime_control.c
  control/runtime_descriptor.c
  control/runtime_options.c
  control/runtime_profiling.c
  codelets/codelet_dataflush.c
  ${RUNTIME_COMMON_GENERATED}
  )

# Generate the Chameleon sources for all possible precisions
# ----------------------------------------------------------
95
96
set(RUNTIME_SRCS_GENERATED "")
set(ZSRC
97
98
  ${CODELETS_ZSRC}
  )
99
100

precisions_rules_py(RUNTIME_SRCS_GENERATED "${ZSRC}"
101
102
  PRECISIONS "${CHAMELEON_PRECISION}"
  TARGETDIR "codelets")
103
104
105
106
107
108

set(RUNTIME_SRCS
  ${RUNTIME_COMMON}
  ${RUNTIME_SRCS_GENERATED}
  )

109
110
111
112
113
# Force generation of sources
# ---------------------------
add_custom_target(quark_sources ALL SOURCES ${RUNTIME_SRCS})
set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};runtime_quark_include;quark_sources" CACHE INTERNAL "List of targets of sources")

114
115
# Add library
# -----------
116
117
add_library(chameleon_quark ${RUNTIME_SRCS})
set_property(TARGET chameleon_quark PROPERTY LINKER_LANGUAGE Fortran)
118
set_property(TARGET chameleon_quark PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
119

120
target_link_libraries(chameleon_quark coreblas ${QUARK_LIBRARIES_DEP})
121
if(CHAMELEON_USE_CUDA)
122
  target_link_libraries(chameleon_quark cudablas)
123
endif(CHAMELEON_USE_CUDA)
124

125
126
add_dependencies(chameleon_quark
  chameleon_include
127
128
  control_include
  runtime_quark_include
129
  quark_sources
130
)
131
132
133
if (NOT CHAMELEON_SIMULATION)
    add_dependencies(chameleon_quark coreblas_include)
endif()
134
135
136

# installation
# ------------
137
install(TARGETS chameleon_quark
138
  DESTINATION lib)
139
140
141
142

###
### END CMakeLists.txt
###