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

28 29 30 31
if ( CHAMELEON_USE_CUDA )
  set( CHAMELEON_COPY_DIAG ON )
else()
  option(CHAMELEON_COPY_DIAG
Philippe Virouleau's avatar
Philippe Virouleau committed
32
    "This options enables the duplication of the diagonal tiles in some algorithm to avoid anti-dependencies on lower/upper triangular parts (Might be useful to StarPU and OpenMP)" ON)
33
endif()
34 35 36 37 38

if ( CHAMELEON_SCHED_QUARK )
  # No need for those extra diagonale tiles
  set( CHAMELEON_COPY_DIAG OFF )
endif()
39 40 41 42
if ( CHAMELEON_SCHED_PARSEC )
  # Actual DIAG can not be used with PaRSEC
  set( CHAMELEON_COPY_DIAG OFF )
endif()
43

44 45
mark_as_advanced(CHAMELEON_COPY_DIAG)

46 47 48
if (CHAMELEON_COPY_DIAG)
  add_definitions(-DCHAMELEON_COPY_DIAG)
endif()
49 50 51

# Define the list of sources
# --------------------------
52
set(CHAMELEON_CONTROL
53 54 55 56 57 58 59
    ../control/async.c
    ../control/auxiliary.c
    ../control/context.c
    ../control/control.c
    ../control/descriptor.c
    ../control/workspace.c
    ../control/tile.c
Mathieu Faverge's avatar
Mathieu Faverge committed
60 61
    ../control/chameleon_f77.c
    ../control/chameleon_mf77.c
Mathieu Faverge's avatar
Mathieu Faverge committed
62 63
    map.c
    pmap.c
64 65
   )

66
set(flags_to_add "")
67
foreach(_prec ${CHAMELEON_PRECISION})
68
    set(flags_to_add "${flags_to_add} -DPRECISION_${_prec}")
69
endforeach()
70
set_source_files_properties(../control/tile.c PROPERTIES COMPILE_FLAGS "${flags_to_add}")
71

Mathieu Faverge's avatar
Mathieu Faverge committed
72
# Generate the chameleon sources for all possible precisions
73
# ------------------------------------------------------
74
set(CHAMELEON_SRCS_GENERATED "")
75 76 77 78 79 80 81 82 83 84 85 86 87 88
set(ZSRC
    ##################
    # BLAS 3
    ##################
    pzgemm.c
    pzhemm.c
    pzher2k.c
    pzherk.c
    pzsymm.c
    pzsyr2k.c
    pzsyrk.c
    pztrmm.c
    pztrsm.c
    pztrsmpl.c
89
    pztradd.c
90
    pzlascal.c
91
    ###
92
    zgeadd.c
93
    zlascal.c
94 95 96 97 98 99 100
    zgemm.c
    zhemm.c
    zher2k.c
    zherk.c
    zsymm.c
    zsyr2k.c
    zsyrk.c
101
    ztradd.c
102 103 104 105 106 107 108
    ztrmm.c
    ztrsm.c
    ztrsmpl.c
    ##################
    # LAPACK
    ##################
    pzgelqf.c
BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
109
    pzgelqf_param.c
110 111 112
    pzgelqfrh.c
    pzgeqrf.c
    pzgeqrfrh.c
113
    pzgeqrf_param.c
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
    pzgetrf_incpiv.c
    pzgetrf_nopiv.c
    pzlacpy.c
    pzlange.c
    pzlansy.c
    pzlaset2.c
    pzlaset.c
    pzlauum.c
    pzplghe.c
    pzplgsy.c
    pzplrnt.c
    pzpotrf.c
    pzsytrf.c
    pztrtri.c
    pzpotrimm.c
    pzunglq.c
130
    pzunglq_param.c
131 132
    pzunglqrh.c
    pzungqr.c
133
    pzungqr_param.c
134 135
    pzungqrrh.c
    pzunmlq.c
136
    pzunmlq_param.c
137 138
    pzunmlqrh.c
    pzunmqr.c
139
    pzunmqr_param.c
140
    pzunmqrrh.c
141
    pztpgqrt.c
142
    pztpqrt.c
143 144
    ###
    zgels.c
145
    zgels_param.c
146
    zgelqf.c
BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
147
    zgelqf_param.c
148
    zgelqs.c
149
    zgelqs_param.c
150
    zgeqrf.c
151
    zgeqrf_param.c
152
    zgeqrs.c
153
    zgeqrs_param.c
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
    #zgesv.c
    zgesv_incpiv.c
    zgesv_nopiv.c
    #zgetrf.c
    zgetrf_incpiv.c
    zgetrf_nopiv.c
    zgetrs_incpiv.c
    zgetrs_nopiv.c
    zlacpy.c
    zlange.c
    zlanhe.c
    zlansy.c
    zlantr.c
    zlaset.c
    zlauum.c
    zplghe.c
    zplgsy.c
    zplrnt.c
    zposv.c
    zsysv.c
    zpotrf.c
    zsytrf.c
    zpotri.c
    zpotrimm.c
    zpotrs.c
    zsytrs.c
    ztrtri.c
BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
181 182
    ztpgqrt.c
    ztpqrt.c
183
    zunglq.c
184
    zunglq_param.c
185
    zungqr.c
186
    zungqr_param.c
187
    zunmlq.c
188
    zunmlq_param.c
189
    zunmqr.c
190
    zunmqr_param.c
191 192 193 194 195 196 197 198 199 200 201 202
    ##################
    # MIXED PRECISION
    ##################
    pzlag2c.c
    ###
    #zcgels.c
    #zcgesv.c
    #zcposv.c
    #zcungesv.c
    ##################
    # OTHERS
    ##################
203 204 205
    pztile2band.c
    #pzgebrd_gb2bd.c
    pzgebrd_ge2gb.c
206 207 208 209
    #pzgetrf_reclap.c
    #pzgetrf_rectil.c
    #pzhegst.c
    #pzherbt.c
210 211
    #pzhetrd_hb2ht.c
    pzhetrd_he2hb.c
212 213 214 215 216 217 218 219 220
    #pzlarft_blgtrd.c
    #pzlaswp.c
    #pzlaswpc.c
    #pztrsmrv.c
    #pzunmqr_blgtrd.c
    #########################
    #zgebrd.c
    #zgecfi.c
    #zgecfi2.c
221
    zgesvd.c
222 223 224 225
    #zgetmi.c
    #zgetri.c
    #zgetrs.c
    #zheev.c
226
    zheevd.c
227 228 229
    #zhegst.c
    #zhegv.c
    #zhegvd.c
230
    zhetrd.c
231 232 233 234 235 236 237 238 239
    #zlaswp.c
    #zlaswpc.c
    #ztrsmrv.c
    ##################
    # CONTROL
    ##################
    #pzshift.c
    #pzpack.c
    ztile.c
240 241 242 243 244 245
    ##################
    # BUILD
    ##################
    zbuild.c
    pzbuild.c
)
246

247 248
precisions_rules_py(CHAMELEON_SRCS_GENERATED "${ZSRC}"
                    PRECISIONS "${CHAMELEON_PRECISION}")
249 250 251 252

set(CONTROL_SRCS_GENERATED "")
set(ZSRC
    ../control/workspace_z.c
Mathieu Faverge's avatar
Mathieu Faverge committed
253
    ../control/chameleon_zf77.c
254 255 256
)

precisions_rules_py(CONTROL_SRCS_GENERATED "${ZSRC}"
257
                    PRECISIONS "${CHAMELEON_PRECISION}"
258 259
                    TARGETDIR "control" )

260 261 262
set(CHAMELEON_SRCS
    ${CHAMELEON_CONTROL}
    ${CHAMELEON_SRCS_GENERATED}
263 264 265
    ${CONTROL_SRCS_GENERATED}
   )

Mathieu Faverge's avatar
Mathieu Faverge committed
266
# Generate the chameleon fortran sources for all possible precisions
267 268
# --------------------------------------------------------------
if(HAVE_ISO_C_BINDING)
269
    set(CHAMELEON_SRCS_F_GENERATED "")
270
    set(ZSRCF
Mathieu Faverge's avatar
Mathieu Faverge committed
271 272 273
        ../control/chameleon_zcf90.F90
        ../control/chameleon_zf90.F90
        ../control/chameleon_zf90_wrappers.F90
274
       )
275 276
    precisions_rules_py(CHAMELEON_SRCS_F_GENERATED "${ZSRCF}"
                        PRECISIONS "${CHAMELEON_PRECISION}"
277 278
                        TARGETDIR "control" )

279
    set(CHAMELEON_SRCSF
Mathieu Faverge's avatar
Mathieu Faverge committed
280
        ../control/chameleon_f90.f90
281
        ${CHAMELEON_SRCS_F_GENERATED}
282 283 284
       )
endif(HAVE_ISO_C_BINDING)

285 286 287 288 289
# Force generation of sources
# ---------------------------
add_custom_target(chameleon_sources ALL SOURCES "${CHAMELEON_SRCS};${CHAMELEON_SRCSF}")
set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};chameleon_sources" CACHE INTERNAL "List of targets of sources")

290 291
# Compile step
# ------------
292
add_library(chameleon ${CHAMELEON_SRCS} ${CHAMELEON_SRCSF})
293 294 295 296 297 298
if(CHAMELEON_SCHED_STARPU)
  target_link_libraries(chameleon chameleon_starpu)
elseif(CHAMELEON_SCHED_PARSEC)
  target_link_libraries(chameleon chameleon_parsec)
elseif(CHAMELEON_SCHED_QUARK)
  target_link_libraries(chameleon chameleon_quark)
Philippe Virouleau's avatar
Philippe Virouleau committed
299 300
elseif(CHAMELEON_SCHED_OPENMP)
  target_link_libraries(chameleon chameleon_openmp)
301
endif()
302
if (NOT CHAMELEON_SIMULATION)
PRUVOST Florent's avatar
PRUVOST Florent committed
303
  # Depends on coreblas only for set_coreblas_gemm3m_enabled() (Maybe we should change that)
PRUVOST Florent's avatar
PRUVOST Florent committed
304
  add_dependencies(chameleon coreblas_include)
305
  target_link_libraries(chameleon coreblas)
306
endif()
307
target_link_libraries(chameleon hqr)
308

309 310
add_dependencies(chameleon
  chameleon_include
311
  control_include
312
  chameleon_sources
313 314
)

315 316
set_property(TARGET chameleon PROPERTY LINKER_LANGUAGE Fortran)
set_property(TARGET chameleon PROPERTY Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
317
set_property(TARGET chameleon PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
318 319 320

# installation
# ------------
321
install(TARGETS chameleon
322 323 324 325 326
        DESTINATION lib)

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