CMakeLists.txt 2.6 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 21 22 23 24 25 26 27
#
###
#
# @file CMakeLists.c
#
#  MORSE example routines
#  MORSE is a software package provided by Inria Bordeaux - Sud-Ouest, LaBRI,
#  University of Bordeaux, Bordeaux INP
#
#  @version 1.0.0
#  @author Florent Pruvost
#  @date 2014-10-13
#
###


include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

# compilation for other sources step1 and >
28
set(LTM_SOURCES
29 30 31 32 33 34
    step1.c
    step2.c
    step3.c
    step4.c
    step5.c
    step6.c
35
    step7.c
36 37 38 39 40 41
   )

# Define what libraries we have to link with
# ------------------------------------------
unset(libs_for_ltm)
list(APPEND libs_for_ltm
42 43 44
  chameleon
  coreblas
  ${LAPACKE_LIBRARIES}
45 46
)

47
# specific compilation for step0 because we potentially want to use
48 49
# multithreaded BLAS and LAPACK libraries for this step
unset(libs_for_step0)
50 51 52 53 54 55 56 57
list(APPEND libs_for_step0
  ${libs_for_ltm}
  ${CBLAS_LIBRARIES}
  )

if(LAPACK_PAR_LIBRARIES)
  list(APPEND libs_for_step0
    ${LAPACK_PAR_LIBRARIES}
58 59
    )
else()
60 61 62 63
  list(APPEND libs_for_step0
    ${LAPACK_SEQ_LIBRARIES}
    )
endif()
64

65 66 67 68 69 70 71 72
if(BLAS_PAR_LIBRARIES)
  list(APPEND libs_for_step0
    ${BLAS_PAR_LIBRARIES}
    )
else()
  list(APPEND libs_for_step0
    ${BLAS_SEQ_LIBRARIES}
    )
73 74
endif()

75 76 77 78 79 80 81 82 83 84 85 86 87 88
list(APPEND libs_for_step0
  ${EXTRA_LIBRARIES}
  )

list(APPEND libs_for_ltm
  ${LAPACK_SEQ_LIBRARIES}
  ${BLAS_SEQ_LIBRARIES}
  ${EXTRA_LIBRARIES}
  )

link_directories(${LAPACKE_LIBRARY_DIRS})
link_directories(${LAPACK_LIBRARY_DIRS})
link_directories(${CBLAS_LIBRARY_DIRS})
link_directories(${BLAS_LIBRARY_DIRS})
89 90

# message(STATUS "libs examples: ${libs_for_ltm}")
91 92 93 94 95 96
foreach(_ltm ${LTM_SOURCES})
    get_filename_component(_name_exe ${_ltm} NAME_WE)
    add_executable(${_name_exe} ${_ltm})
    set_property(TARGET ${_name_exe} PROPERTY LINKER_LANGUAGE Fortran)
    target_link_libraries(${_name_exe} ${libs_for_ltm})
    install(TARGETS ${_name_exe}
97
            DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/chameleon/example/lapack_to_morse)
98 99 100 101 102 103
endforeach()

add_executable(step0 step0.c)
set_property(TARGET step0 PROPERTY LINKER_LANGUAGE Fortran)
target_link_libraries(step0 ${libs_for_step0})
install(TARGETS step0
104
        DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/chameleon/example/lapack_to_morse)
105

106 107 108
#-------- Tests ---------
include(CTestLists.cmake)

109 110 111
###
### END CMakeLists.txt
###