CMakeLists.txt 6.88 KB
Newer Older
1 2 3 4 5 6
###
#
# @copyright (c) 2009-2014 The University of Tennessee and The University
#                          of Tennessee Research Foundation.
#                          All rights reserved.
# @copyright (c) 2012-2014 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 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
#  @author Cedric Castagnede
#  @author Emmanuel Agullo
#  @author Mathieu Faverge
#  @date 13-07-2012
#
###


# Check for subdirectories
# ------------------------
#add_subdirectory(lin)

# Generate morse auxiliary testing sources for all possible precisions
# --------------------------------------------------------------------
set(TESTING_HDRS_GENERATED "")
set(ZHDR
  testing_zauxiliary.h
 )

precisions_rules_py(TESTING_HDRS_GENERATED "${ZHDR}"
    PRECISIONS "s;d;c;z;ds;zc" )

add_custom_target(testing_include ALL SOURCES ${TESTING_HDRS_GENERATED})

# Generate morse testing sources for all possible precisions
# ----------------------------------------------------------
set(ZSRC
    testing_zauxiliary.c
    ##################
    # BLAS 3
    ##################
    testing_zgemm.c
    testing_zhemm.c
    testing_zher2k.c
    testing_zherk.c
    testing_zpemv.c
    testing_zsymm.c
    testing_zsyr2k.c
    testing_zsyrk.c
    testing_ztrmm.c
    testing_ztrsm.c
    ##################
    # LAPACK
    ##################
    testing_zgels.c
    #testing_zgesv.c
    testing_zgesv_incpiv.c
    #testing_zgetri.c
    testing_zlange.c
    testing_zposv.c
    testing_zpotri.c
    ##################
    # MIXED PRECISION
    ##################
    #testing_zcgels.c
    #testing_zcgesv.c
    #testing_zcposv.c
    #testing_zcungesv.c
    ##################
    # OTHERS
    ##################
83
    testing_zgeadd.c
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
    #testing_zgecfi.c
    #testing_zgesvd.c
    #testing_zgetmi.c
    #testing_zheev.c
    #testing_zheevd.c
    #testing_zhegst.c
    #testing_zhegv.c
    #testing_zhegvd.c
    )

# Add include and link directories
# --------------------------------
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

# Define what libraries we have to link with
# ------------------------------------------
unset(libs_for_tests)
102
list(APPEND libs_for_tests chameleon)
103

104 105
if(CHAMELEON_SCHED_STARPU)
    if ( CHAMELEON_USE_MPI )
106
        list(APPEND libs_for_tests
107
          chameleon_starpu
108 109 110 111
          ${STARPU_MPI_LIBRARIES}
        )
    else()
        list(APPEND libs_for_tests
112
          chameleon_starpu
113 114 115 116
          ${STARPU_SHM_LIBRARIES}
        )
    endif()
    link_directories(${STARPU_LIBRARY_DIRS})
Mathieu Faverge's avatar
Mathieu Faverge committed
117 118 119 120 121 122
elseif(CHAMELEON_SCHED_PARSEC)
    list(APPEND libs_for_tests
        chameleon_parsec
        ${PARSEC_LIBRARIES_DEP}
      )
    link_directories(${PARSEC_LIBRARY_DIRS_DEP})
123
elseif(CHAMELEON_SCHED_QUARK)
124
    list(APPEND libs_for_tests
125
        chameleon_quark
126 127 128 129 130
        ${QUARK_LIBRARIES}
      )
    link_directories(${QUARK_LIBRARY_DIRS})
endif()

131
if(NOT CHAMELEON_SIMULATION)
132

133 134 135 136 137
    if(CHAMELEON_USE_CUDA OR CHAMELEON_USE_MAGMA)
        list(APPEND libs_for_tests
        cudablas
        )
    endif()
138
    if(CHAMELEON_USE_CUDA)
139 140 141 142 143
        list(APPEND libs_for_tests
        ${CUDA_LIBRARIES}
        )
        link_directories(${CUDA_LIBRARY_DIRS})
    endif()
144
    if(CHAMELEON_USE_MAGMA)
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
        list(APPEND libs_for_tests
        ${MAGMA_LIBRARIES}
        )
        link_directories(${MAGMA_LIBRARY_DIRS})
    endif()

    list(APPEND libs_for_tests
    coreblas
    ${LAPACKE_LIBRARIES}
    ${LAPACK_LIBRARIES}
    ${CBLAS_LIBRARIES}
    ${BLAS_LIBRARIES}
    ${HWLOC_LIBRARIES}
    ${EXTRA_LIBRARIES}
    )

    link_directories(${LAPACKE_LIBRARY_DIRS})
    link_directories(${LAPACK_LIBRARY_DIRS})
    link_directories(${CBLAS_LIBRARY_DIRS})
    link_directories(${BLAS_LIBRARY_DIRS})
165

166 167 168 169
else()

    list(APPEND libs_for_tests
    coreblas
170
    simulapacke
171 172 173 174
    simucblas
    ${HWLOC_LIBRARIES}
    ${EXTRA_LIBRARIES}
    )
175

176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
endif()

link_directories(${HWLOC_LIBRARY_DIRS})

# message("LAPACKE_LIBRARY_DIRS: ${LAPACKE_LIBRARY_DIRS}")
# message("LAPACK_LIBRARY_DIRS: ${LAPACK_LIBRARY_DIRS}")
# message("CBLAS_LIBRARY_DIRS: ${CBLAS_LIBRARY_DIRS}")
# message("BLAS_LIBRARY_DIRS: ${BLAS_LIBRARY_DIRS}")
# message("HWLOC_LIBRARY_DIRS: ${HWLOC_LIBRARY_DIRS}")

# list(APPEND libs_for_tests ${CMAKE_Fortran_FLAGS}  )
# list(APPEND libs_for_tests ${CMAKE_Fortran_LDFLAGS})

# message(STATUS "libs testings: ${libs_for_tests}")

# Create one testing per precision with all files
# -----------------------------------------------
193
foreach(_precision ${CHAMELEON_PRECISION} )
194 195 196 197 198 199

    precisions_rules_py(${_precision}SRC_GENERATED "${ZSRC}"
        PRECISIONS "${_precision}" )

    add_executable(${_precision}testing ${${_precision}SRC_GENERATED})
    add_dependencies(${_precision}testing
200
        chameleon_include
201 202 203 204 205 206 207 208
        coreblas_include
        control_include
        testing_include
      )
    set_property(TARGET ${_precision}testing PROPERTY LINKER_LANGUAGE Fortran)
    target_link_libraries(${_precision}testing ${libs_for_tests})

    install(TARGETS ${_precision}testing
209
            DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/chameleon/testing)
210 211 212

endforeach()

213 214
# Copy python scripts to use test drivers
# ---------------------------------------
215
if(CHAMELEON_SCHED_STARPU)
216 217
    # Copy launcher
    add_custom_target(testing_launcher_starpu ALL
Mathieu Faverge's avatar
Mathieu Faverge committed
218 219 220 221 222 223 224 225 226 227 228 229
                     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/chameleon_testing.py
                                                      ${CMAKE_CURRENT_BINARY_DIR}/chameleon_testing.py)
    # install file
    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/chameleon_testing.py
            DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/chameleon/testing)
endif()

if(CHAMELEON_SCHED_PARSEC)
    # Copy launcher
    add_custom_target(testing_launcher_parsec ALL
                     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/chameleon_testing.py
                                                      ${CMAKE_CURRENT_BINARY_DIR}/chameleon_testing.py)
230
    # install file
Mathieu Faverge's avatar
Mathieu Faverge committed
231
    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/chameleon_testing.py
232
            DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/chameleon/testing)
233 234
endif()

235
if(CHAMELEON_SCHED_QUARK)
236 237
    # Copy launcher
    add_custom_target(testing_launcher_quark ALL
Mathieu Faverge's avatar
Mathieu Faverge committed
238 239
                     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/chameleon_testing.py
                                                      ${CMAKE_CURRENT_BINARY_DIR}/chameleon_testing.py)
240
    # install file
Mathieu Faverge's avatar
Mathieu Faverge committed
241
    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/chameleon_testing.py
242
            DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/chameleon/testing)
243 244
endif()

245
#-------- Tests ---------
246 247 248 249 250
include(CTestLists.cmake)

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