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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. include_directories(${PROJECT_SOURCE_DIR})
  2. include_directories(${PROJECT_BINARY_DIR})
  3. if (${CORE} STREQUAL "PPC440")
  4. set(MEMORY memory_qalloc.c)
  5. else ()
  6. set(MEMORY memory.c)
  7. endif ()
  8. if (USE_THREAD)
  9. if (USE_OPENMP)
  10. set(BLAS_SERVER blas_server_omp.c)
  11. elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
  12. set(BLAS_SERVER blas_server_win32.c)
  13. elseif (${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
  14. set(BLAS_SERVER blas_server_win32.c)
  15. endif ()
  16. if (NOT DEFINED BLAS_SERVER)
  17. set(BLAS_SERVER blas_server.c)
  18. endif ()
  19. set(SMP_SOURCES
  20. ${BLAS_SERVER}
  21. divtable.c # TODO: Makefile has -UDOUBLE
  22. blas_l1_thread.c
  23. blas_server_callback.c
  24. )
  25. if (NOT NO_AFFINITY)
  26. list(APPEND SMP_SOURCES init.c)
  27. endif ()
  28. endif ()
  29. set(COMMON_SOURCES
  30. xerbla.c
  31. openblas_set_num_threads.c
  32. openblas_error_handle.c
  33. openblas_env.c
  34. openblas_get_num_procs.c
  35. openblas_get_num_threads.c
  36. )
  37. # these need to have NAME/CNAME set, so use GenerateNamedObjects, but don't use standard name mangling
  38. GenerateNamedObjects("abs.c" "" "c_abs" 0 "" "" 1 )
  39. GenerateNamedObjects("abs.c" "DOUBLE" "z_abs" 0 "" "" 1)
  40. GenerateNamedObjects("openblas_get_config.c;openblas_get_parallel.c" "" "" 0 "" "" 1)
  41. if (DYNAMIC_ARCH)
  42. if (ARM64)
  43. list(APPEND COMMON_SOURCES dynamic_arm64.c)
  44. elseif (POWER)
  45. list(APPEND COMMON_SOURCES dynamic_power.c)
  46. elseif (RISCV64)
  47. list(APPEND COMMON_SOURCES dynamic_riscv64.c detect_riscv64.c)
  48. elseif (LOONGARCH64)
  49. list(APPEND COMMON_SOURCES dynamic_loongarch64.c)
  50. else ()
  51. list(APPEND COMMON_SOURCES dynamic.c)
  52. endif ()
  53. else ()
  54. list(APPEND COMMON_SOURCES parameter.c)
  55. endif ()
  56. #ifdef EXPRECISION
  57. #COMMONOBJS += x_abs.$(SUFFIX) qlamch.$(SUFFIX) qlamc3.$(SUFFIX)
  58. #endif
  59. #
  60. #ifdef QUAD_PRECISION
  61. #COMMONOBJS += addx.$(SUFFIX) mulx.$(SUFFIX)
  62. #endif
  63. #
  64. #ifdef USE_CUDA
  65. #COMMONOBJS += cuda_init.$(SUFFIX)
  66. #endif
  67. #
  68. #ifdef FUNCTION_PROFILE
  69. #COMMONOBJS += profile.$(SUFFIX)
  70. #endif
  71. #LIBOTHERS = libothers.$(LIBSUFFIX)
  72. #ifeq ($(DYNAMIC_ARCH), 1)
  73. #HPLOBJS = memory.$(SUFFIX) xerbla.$(SUFFIX) dynamic.$(SUFFIX)
  74. #else
  75. #HPLOBJS = memory.$(SUFFIX) xerbla.$(SUFFIX) parameter.$(SUFFIX)
  76. #endif
  77. add_library(driver_others OBJECT ${OPENBLAS_SRC} ${MEMORY} ${SMP_SOURCES} ${COMMON_SOURCES})
  78. if (USE_OPENMP)
  79. target_link_libraries(driver_others OpenMP::OpenMP_C)
  80. endif()