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.3 kB

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