CMakeLists.txt 5.2 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.
7 8
# @copyright 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
#                      Univ. Bordeaux. All rights reserved.
9 10 11 12 13 14 15 16 17 18 19 20
#
###
#
#
#  @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
#  @author Cedric Castagnede
#  @author Emmanuel Agullo
#  @author Mathieu Faverge
#  @date 13-07-2012
#
###
28 29 30
if (CHAMELEON_SIMULATION)
  message(ERROR "testing directory should not be included when simulation is enabled")
endif()
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

# 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})
47
set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};testing_include" CACHE INTERNAL "List of targets of sources")
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

# 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
70 71
    testing_zgels_hqr.c
    testing_zgels_systolic.c
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
    #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
    ##################
88
    testing_zgeadd.c
89
    #testing_zgecfi.c
90
    testing_zgesvd.c
91 92
    #testing_zgetmi.c
    #testing_zheev.c
93
    testing_zheevd.c
94 95 96
    #testing_zhegst.c
    #testing_zhegv.c
    #testing_zhegvd.c
97
    testing_zgeqrf_qdwh.c
98 99 100 101 102 103 104 105 106 107
    )

# 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)
108 109 110
list(APPEND libs_for_tests
  chameleon
  )
111

112 113 114 115 116 117 118
if(CHAMELEON_USE_CUDA)
  list(APPEND libs_for_tests
    cudablas)
endif()
if(CHAMELEON_USE_CUDA)
  link_directories(${CUDA_LIBRARY_DIRS})
endif()
119

120 121 122 123 124 125 126 127
list(APPEND libs_for_tests
  coreblas
  ${LAPACKE_LIBRARIES}
  ${TMG_LIBRARIES}
  ${LAPACK_LIBRARIES}
  ${CBLAS_LIBRARIES}
  ${BLAS_LIBRARIES}
  )
128

129 130 131 132 133
link_directories(${LAPACKE_LIBRARY_DIRS})
link_directories(${TMG_LIBRARY_DIRS})
link_directories(${LAPACK_LIBRARY_DIRS})
link_directories(${CBLAS_LIBRARY_DIRS})
link_directories(${BLAS_LIBRARY_DIRS})
134

135 136 137 138 139
list(APPEND libs_for_tests
  hqr
  ${EXTRA_LIBRARIES}
  )

140 141 142 143 144 145 146 147 148 149 150 151
# 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}")

# 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
# -----------------------------------------------
152
foreach(_precision ${CHAMELEON_PRECISION} )
153 154 155 156 157 158

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

    add_executable(${_precision}testing ${${_precision}SRC_GENERATED})
    add_dependencies(${_precision}testing
159
        chameleon_include
160 161 162 163 164 165 166 167
        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
168
            DESTINATION bin/testing)
169 170 171

endforeach()

172 173 174 175 176 177 178 179 180
# Force generation of sources
# ---------------------------
set(TESTING_SRCS)
foreach(_precision ${CHAMELEON_PRECISION})
    list(APPEND TESTING_SRCS ${${_precision}SRC_GENERATED})
endforeach()
add_custom_target(testing_sources ALL SOURCES ${TESTING_SRCS})
set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};testing_sources" CACHE INTERNAL "List of targets of sources")

181 182
# Copy python scripts to use test drivers
# ---------------------------------------
183 184 185 186 187 188 189 190
# Copy launcher
add_custom_target(testing_launcher ALL
  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 bin/testing )
191

192
#-------- Tests ---------
193 194 195 196 197
include(CTestLists.cmake)

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