CMakeLists.txt 6.37 KB
Newer Older
1 2 3 4 5
###
#
# @copyright (c) 2009-2014 The University of Tennessee and The University
#                          of Tennessee Research Foundation.
#                          All rights reserved.
6
# @copyright (c) 2012-2016 Inria. All rights reserved.
7
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
8 9 10 11 12 13 14 15 16 17 18 19 20
#
###
#
#  @file CMakeLists.txt
#
#  @project MORSE
#  MORSE is a software package provided by:
#     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 25 26 27 28
#  @author Cedric Castagnede
#  @author Emmanuel Agullo
#  @author Mathieu Faverge
#  @date 13-07-2012
#
###

29 30 31 32 33 34 35 36 37 38 39 40
option(CHAMELEON_COPY_DIAG
  "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)" ON)
mark_as_advanced(CHAMELEON_COPY_DIAG)

if ( CHAMELEON_SCHED_QUARK )
  # No need for those extra diagonale tiles
  set( CHAMELEON_COPY_DIAG OFF )
endif()

if (CHAMELEON_COPY_DIAG)
  add_definitions(-DCHAMELEON_COPY_DIAG)
endif()
41 42 43

# Define the list of sources
# --------------------------
44
set(CHAMELEON_CONTROL
45 46 47 48 49 50 51 52 53 54 55 56
    ../control/async.c
    ../control/auxiliary.c
    ../control/context.c
    ../control/control.c
    ../control/descriptor.c
    ../control/workspace.c
    ../control/tile.c
    ../control/morse_f77.c
    ../control/morse_mf77.c
#    ../control/morsewinthread.c
   )

57
set(flags_to_add "")
58
foreach(_prec ${CHAMELEON_PRECISION})
59
    set(flags_to_add "${flags_to_add} -DPRECISION_${_prec}")
60
endforeach()
61
set_source_files_properties(../control/tile.c PROPERTIES COMPILE_FLAGS "${flags_to_add}")
62 63 64

# Generate the morse sources for all possible precisions
# ------------------------------------------------------
65
set(CHAMELEON_SRCS_GENERATED "")
66 67 68 69 70 71 72 73 74 75 76 77 78 79
set(ZSRC
    ##################
    # BLAS 3
    ##################
    pzgemm.c
    pzhemm.c
    pzher2k.c
    pzherk.c
    pzsymm.c
    pzsyr2k.c
    pzsyrk.c
    pztrmm.c
    pztrsm.c
    pztrsmpl.c
80
    pztradd.c
81
    pzlascal.c
82
    ###
83
    zgeadd.c
84
    zlascal.c
85 86 87 88 89 90 91
    zgemm.c
    zhemm.c
    zher2k.c
    zherk.c
    zsymm.c
    zsyr2k.c
    zsyrk.c
92
    ztradd.c
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
    ztrmm.c
    ztrsm.c
    ztrsmpl.c
    ##################
    # LAPACK
    ##################
    pzgelqf.c
    pzgelqfrh.c
    pzgeqrf.c
    pzgeqrfrh.c
    pzgetrf_incpiv.c
    pzgetrf_nopiv.c
    pzlacpy.c
    pzlange.c
    pzlanhe.c
    pzlansy.c
    pzlantr.c
    pzlaset2.c
    pzlaset.c
    pzlauum.c
    pzplghe.c
    pzplgsy.c
    pzplrnt.c
    pzpotrf.c
    pzsytrf.c
    pztrtri.c
    pzpotrimm.c
    pzunglq.c
    pzunglqrh.c
    pzungqr.c
    pzungqrrh.c
    pzunmlq.c
    pzunmlqrh.c
    pzunmqr.c
    pzunmqrrh.c
    ###
    zgels.c
    zgelqf.c
    zgelqs.c
    zgeqrf.c
    zgeqrs.c
    #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
    zunglq.c
    zungqr.c
    zunmlq.c
    zunmqr.c
    ##################
    # MIXED PRECISION
    ##################
    pzlag2c.c
    ###
    #zcgels.c
    #zcgesv.c
    #zcposv.c
    #zcungesv.c
    ##################
    # OTHERS
    ##################
    #pzgebrd_ge2tb.c
    #pzgebrd_tb2bd.c
    #pzgetmi2.c
    #pzgetrf_reclap.c
    #pzgetrf_rectil.c
    #pzhbcpy_t2bl.c
    #pzhegst.c
    #pzherbt.c
    #pzhetrd_hb2st.c
    #pzhetrd_he2hb.c
    #pzlarft_blgtrd.c
    #pzlaswp.c
    #pzlaswpc.c
    #pztrsmrv.c
    #pzunmqr_blgtrd.c
    #########################
    #zgebrd.c
    #zgecfi.c
    #zgecfi2.c
    #zgesvd.c
    #zgetmi.c
    #zgetri.c
    #zgetrs.c
    #zheev.c
    #zheevd.c
    #zhegst.c
    #zhegv.c
    #zhegvd.c
    #zhetrd.c
    #zlaswp.c
    #zlaswpc.c
    #ztrsmrv.c
    ##################
    # CONTROL
    ##################
    #pzshift.c
    #pzpack.c
    pztile.c
    ztile.c
216 217 218 219 220 221
    ##################
    # BUILD
    ##################
    zbuild.c
    pzbuild.c
)
222

223 224
precisions_rules_py(CHAMELEON_SRCS_GENERATED "${ZSRC}"
                    PRECISIONS "${CHAMELEON_PRECISION}")
225 226 227 228 229 230 231 232

set(CONTROL_SRCS_GENERATED "")
set(ZSRC
    ../control/workspace_z.c
    ../control/morse_zf77.c
)

precisions_rules_py(CONTROL_SRCS_GENERATED "${ZSRC}"
233
                    PRECISIONS "${CHAMELEON_PRECISION}"
234 235
                    TARGETDIR "control" )

236 237 238
set(CHAMELEON_SRCS
    ${CHAMELEON_CONTROL}
    ${CHAMELEON_SRCS_GENERATED}
239 240 241 242 243 244
    ${CONTROL_SRCS_GENERATED}
   )

# Generate the morse fortran sources for all possible precisions
# --------------------------------------------------------------
if(HAVE_ISO_C_BINDING)
245
    set(CHAMELEON_SRCS_F_GENERATED "")
246 247 248 249 250
    set(ZSRCF
        ../control/morse_zcf90.F90
        ../control/morse_zf90.F90
        ../control/morse_zf90_wrappers.F90
       )
251 252
    precisions_rules_py(CHAMELEON_SRCS_F_GENERATED "${ZSRCF}"
                        PRECISIONS "${CHAMELEON_PRECISION}"
253 254
                        TARGETDIR "control" )

255
    set(CHAMELEON_SRCSF
256
        ../control/morse_f90.f90
257
        ${CHAMELEON_SRCS_F_GENERATED}
258 259 260 261 262
       )
endif(HAVE_ISO_C_BINDING)

# Compile step
# ------------
263
add_library(chameleon ${CHAMELEON_SRCS} ${CHAMELEON_SRCSF})
264 265
if(CHAMELEON_SCHED_STARPU)
  target_link_libraries(chameleon chameleon_starpu)
266
  list(INSERT CHAMELEON_DEP 0 -lchameleon_starpu)
267 268
elseif(CHAMELEON_SCHED_PARSEC)
  target_link_libraries(chameleon chameleon_parsec)
269
  list(INSERT CHAMELEON_DEP 0 -lchameleon_parsec)
270 271
elseif(CHAMELEON_SCHED_QUARK)
  target_link_libraries(chameleon chameleon_quark)
272
  list(INSERT CHAMELEON_DEP 0 -lchameleon_quark)
273
endif()
274 275 276
if (NOT CHAMELEON_SIMULATION)
    target_link_libraries(chameleon coreblas)
endif()
277
list(INSERT CHAMELEON_DEP 0 -lchameleon)
278

279 280
add_dependencies(chameleon
  chameleon_include
281 282 283
  coreblas_include
  control_include
)
284 285 286
if (NOT CHAMELEON_SIMULATION)
    add_dependencies(chameleon coreblas_include)
endif()
287

288 289
set_property(TARGET chameleon PROPERTY LINKER_LANGUAGE Fortran)
set_property(TARGET chameleon PROPERTY Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
290
set_property(TARGET chameleon PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
291 292 293

# installation
# ------------
294
install(TARGETS chameleon
295 296 297 298 299
        DESTINATION lib)

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