You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 3.1 kB

10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. include_directories(${PROJECT_SOURCE_DIR})
  2. include_directories(${PROJECT_BINARY_DIR})
  3. set(LAPACK_SOURCES
  4. getrf/getrf_single.c
  5. potrf/potrf_U_single.c
  6. potrf/potrf_L_single.c
  7. lauum/lauum_U_single.c
  8. lauum/lauum_L_single.c
  9. )
  10. # add a 'z' to filename for complex version
  11. set(LAPACK_MANGLED_SOURCES
  12. getf2/getf2_k.c
  13. lauu2/lauu2_U.c
  14. lauu2/lauu2_L.c
  15. potf2/potf2_U.c
  16. potf2/potf2_L.c
  17. )
  18. # sources that need TRANS set
  19. # this has a 'z' version
  20. set(TRANS_SOURCES
  21. getrs/getrs_single.c
  22. )
  23. # sources that need UNIT set
  24. # these do NOT have a z version
  25. set(UNIT_SOURCES
  26. trtri/trtri_U_single.c
  27. trtri/trtri_L_single.c
  28. )
  29. # these have a 'z' version
  30. set(UNIT_SOURCES2
  31. trti2/trti2_U.c
  32. trti2/trti2_L.c
  33. )
  34. GenerateNamedObjects("${LAPACK_SOURCES}")
  35. GenerateNamedObjects("${LAPACK_MANGLED_SOURCES}" "" "" false "" "" false 3)
  36. GenerateNamedObjects("laswp/generic/laswp_k_4.c" "" "laswp_plus" false "" "" false 3)
  37. GenerateNamedObjects("laswp/generic/laswp_k_4.c" "MINUS" "laswp_minus" false "" "" false 3)
  38. # dynamic_arch laswp needs arch specific code ?
  39. #foreach(TARGET_CORE ${DYNAMIC_CORE})
  40. # set(TSUFFIX "_${TARGET_CORE}")
  41. #
  42. #GenerateNamedObjects("laswp/generic/laswp_k_4.c" "" "laswp_plus" false "" ${TSUFFIX} false 3)
  43. #GenerateNamedObjects("laswp/generic/laswp_k_4.c" "MINUS" "laswp_minus" false "" ${TSUFFIX} false 3)
  44. #endforeach ()
  45. if (USE_THREAD)
  46. if (USE_OPENMP)
  47. set(GETRF_SRC getrf/getrf_parallel_omp.c)
  48. else ()
  49. set(GETRF_SRC getrf/getrf_parallel.c)
  50. endif ()
  51. # these do not have 'z' versions
  52. set(PARALLEL_SOURCES
  53. ${GETRF_SRC}
  54. lauum/lauum_U_parallel.c
  55. lauum/lauum_L_parallel.c
  56. potrf/potrf_U_parallel.c
  57. potrf/potrf_L_parallel.c
  58. )
  59. # this has a z version
  60. list(APPEND TRANS_SOURCES
  61. getrs/getrs_parallel.c
  62. )
  63. # these do NOT have a z version
  64. list(APPEND UNIT_SOURCES
  65. trtri/trtri_U_parallel.c
  66. trtri/trtri_L_parallel.c
  67. )
  68. GenerateNamedObjects("${PARALLEL_SOURCES}")
  69. endif ()
  70. foreach (float_type ${FLOAT_TYPES})
  71. if (${float_type} STREQUAL "COMPLEX" OR ${float_type} STREQUAL "ZCOMPLEX")
  72. foreach (trans_src ${TRANS_SOURCES})
  73. string(REGEX MATCH "[a-z]/([a-z]+_)([a-z]+)" op_name ${trans_src})
  74. string(REPLACE "/" "/z" ztrans_src ${trans_src})
  75. GenerateNamedObjects("${ztrans_src}" "TRANS=1" "${CMAKE_MATCH_1}N_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  76. GenerateNamedObjects("${ztrans_src}" "TRANS=2" "${CMAKE_MATCH_1}T_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  77. GenerateNamedObjects("${ztrans_src}" "TRANS=3" "${CMAKE_MATCH_1}R_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  78. GenerateNamedObjects("${ztrans_src}" "TRANS=4" "${CMAKE_MATCH_1}C_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  79. endforeach ()
  80. else ()
  81. GenerateCombinationObjects("${TRANS_SOURCES}" "TRANS" "N" "" 4 "" false ${float_type})
  82. endif ()
  83. endforeach ()
  84. GenerateCombinationObjects("${UNIT_SOURCES}" "UNIT" "N" "" 4)
  85. GenerateCombinationObjects("${UNIT_SOURCES2}" "UNIT" "N" "" 0 "" "" 3)
  86. add_library(lapack OBJECT ${OPENBLAS_SRC})