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 2.7 kB

10 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. include_directories(${CMAKE_SOURCE_DIR})
  2. set(LAPACK_SOURCES
  3. getrf/getrf_single.c
  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. # TODO: laswp needs arch specific code
  36. GenerateNamedObjects("laswp/generic/laswp_k.c" "" "laswp_plus" false "" "" false 3)
  37. GenerateNamedObjects("laswp/generic/laswp_k.c" "MINUS" "laswp_minus" false "" "" false 3)
  38. if (SMP)
  39. if (USE_OPENMP)
  40. set(GETRF_SRC getrf/getrf_parallel_omp.c)
  41. else ()
  42. set(GETRF_SRC getrf/getrf_parallel.c)
  43. endif ()
  44. # these do not have 'z' versions
  45. set(PARALLEL_SOURCES
  46. ${GETRF_SRC}
  47. lauum/lauum_U_parallel.c
  48. lauum/lauum_L_parallel.c
  49. potrf/potrf_U_parallel.c
  50. potrf/potrf_L_parallel.c
  51. )
  52. # this has a z version
  53. list(APPEND TRANS_SOURCES
  54. getrs/getrs_parallel.c
  55. )
  56. # these do NOT have a z version
  57. list(APPEND UNIT_SOURCES
  58. trtri/trtri_U_parallel.c
  59. trtri/trtri_L_parallel.c
  60. )
  61. GenerateNamedObjects("${PARALLEL_SOURCES}")
  62. endif ()
  63. foreach (float_type ${FLOAT_TYPES})
  64. if (${float_type} STREQUAL "COMPLEX" OR ${float_type} STREQUAL "ZCOMPLEX")
  65. foreach (trans_src ${TRANS_SOURCES})
  66. string(REGEX MATCH "[a-z]/([a-z]+_)([a-z]+)" op_name ${trans_src})
  67. string(REPLACE "/" "/z" ztrans_src ${trans_src})
  68. GenerateNamedObjects("${ztrans_src}" "TRANS=1" "${CMAKE_MATCH_1}N_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  69. GenerateNamedObjects("${ztrans_src}" "TRANS=2" "${CMAKE_MATCH_1}T_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  70. GenerateNamedObjects("${ztrans_src}" "TRANS=3" "${CMAKE_MATCH_1}R_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  71. GenerateNamedObjects("${ztrans_src}" "TRANS=4" "${CMAKE_MATCH_1}C_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  72. endforeach ()
  73. else ()
  74. GenerateCombinationObjects("${TRANS_SOURCES}" "TRANS" "N" "" 4 "" false ${float_type})
  75. endif ()
  76. endforeach ()
  77. GenerateCombinationObjects("${UNIT_SOURCES}" "UNIT" "N" "" 4)
  78. GenerateCombinationObjects("${UNIT_SOURCES2}" "UNIT" "N" "" 0 "" "" 3)
  79. add_library(lapack OBJECT ${OPENBLAS_SRC})