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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. include_directories(${CMAKE_SOURCE_DIR})
  2. set(BLAS1_SOURCES
  3. axpy.c swap.c
  4. copy.c scal.c
  5. dot.c
  6. asum.c nrm2.c
  7. rot.c rotg.c rotm.c rotmg.c
  8. axpby.c
  9. )
  10. # TODO: USE_NETLIB_GEMV shoudl switch gemv.c to netlib/*gemv.f
  11. set(BLAS2_SOURCES
  12. gemv.c ger.c
  13. trsv.c trmv.c symv.c
  14. syr.c syr2.c gbmv.c
  15. sbmv.c spmv.c
  16. spr.c spr2.c
  17. tbsv.c tbmv.c
  18. tpsv.c tpmv.c
  19. )
  20. set(BLAS3_SOURCES
  21. gemm.c symm.c
  22. trsm.c syrk.c syr2k.c
  23. omatcopy.c imatcopy.c
  24. )
  25. if (NOT DEFINED NO_FBLAS)
  26. # N.B. The original Makefile passed in -UUSE_MIN and -UUSE_ABS (where appropriate), no way to do that at a source-level in cmake. REMOVE_DEFINITIONS removes a definition for the rest of the compilation.
  27. add_library(AMAX_OBJ OBJECT max.c)
  28. set_target_properties(AMAX_OBJ PROPERTIES COMPILE_DEFINITIONS "USE_ABS")
  29. add_library(AMIN_OBJ OBJECT max.c)
  30. set_target_properties(AMIN_OBJ PROPERTIES COMPILE_DEFINITIONS "USE_ABS;USE_MIN")
  31. add_library(MIN_OBJ OBJECT max.c)
  32. set_target_properties(MIN_OBJ PROPERTIES COMPILE_DEFINITIONS "USE_MIN")
  33. add_library(MAX_OBJ OBJECT max.c)
  34. GenerateNamedObjects("${BLAS1_SOURCES}" "DOUBLE" "")
  35. GenerateNamedObjects("${BLAS2_SOURCES}" "DOUBLE" "")
  36. GenerateNamedObjects("${BLAS3_SOURCES}" "DOUBLE" "")
  37. list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
  38. # trmm is trsm with a compiler flag set
  39. add_library(TRMM_OBJ OBJECT trsm.c)
  40. set_target_properties(TRMM_OBJ PROPERTIES COMPILE_DEFINITIONS "TRMM")
  41. list(APPEND DBLAS_OBJS "AMAX_OBJ;AMIN_OBJ;MIN_OBJ;MAX_OBJ;TRMM_OBJ")
  42. endif ()
  43. if (NOT DEFINED NO_CBLAS)
  44. add_library(ISAMAX_OBJ OBJECT imax.c)
  45. set_target_properties(ISAMAX_OBJ PROPERTIES COMPILE_DEFINITIONS "CBLAS;USE_ABS")
  46. add_library(CDBLAS1_OBJS OBJECT ${BLAS1_SOURCES})
  47. add_library(CDBLAS2_OBJS OBJECT ${BLAS2_SOURCES})
  48. add_library(CDBLAS3_OBJS OBJECT ${BLAS3_SOURCES})
  49. # trmm is trsm with a compiler flag set
  50. add_library(CTRMM_OBJ OBJECT trsm.c)
  51. set_target_properties(CTRMM_OBJ PROPERTIES COMPILE_DEFINITIONS "CBLAS;TRMM")
  52. set_target_properties(CDBLAS1_OBJS PROPERTIES COMPILE_DEFINITIONS "CBLAS")
  53. set_target_properties(CDBLAS2_OBJS PROPERTIES COMPILE_DEFINITIONS "CBLAS")
  54. set_target_properties(CDBLAS3_OBJS PROPERTIES COMPILE_DEFINITIONS "CBLAS")
  55. list(APPEND DBLAS_OBJS "CDBLAS1_OBJS;CDBLAS2_OBJS;CDBLAS3_OBJS;ISAMAX_OBJ;CTRMM_OBJ")
  56. endif ()
  57. if (NOT DEFINED NO_LAPACK)
  58. add_library(DLAPACK_OBJS OBJECT
  59. lapack/getrf.c lapack/getrs.c lapack/potrf.c lapack/getf2.c
  60. lapack/potf2.c lapack/laswp.c lapack/gesv.c lapack/lauu2.c
  61. lapack/lauum.c lapack/trti2.c lapack/trtri.c
  62. )
  63. list(APPEND DBLAS_OBJS "DLAPACK_OBJS")
  64. endif ()
  65. set(DBLAS_OBJS ${DBLAS_OBJS} PARENT_SCOPE) # list append removes the scope from DBLAS_OBJS