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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #######################################################################
  2. # This CMakeLists.txt creates the test programs for the CBLAS routines.
  3. #
  4. #######################################################################
  5. macro(add_cblas_test output input target)
  6. set(TEST_INPUT "${LAPACK_SOURCE_DIR}/cblas/testing/${input}")
  7. set(TEST_OUTPUT "${LAPACK_BINARY_DIR}/cblas/testing/${output}")
  8. set(testName "${target}")
  9. if(EXISTS "${TEST_INPUT}")
  10. add_test(NAME CBLAS-${testName} COMMAND "${CMAKE_COMMAND}"
  11. -DTEST=$<TARGET_FILE:${target}>
  12. -DINPUT=${TEST_INPUT}
  13. -DOUTPUT=${TEST_OUTPUT}
  14. -DINTDIR=${CMAKE_CFG_INTDIR}
  15. -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
  16. else()
  17. string(REPLACE "." "_" input_name ${input})
  18. add_test(NAME CBLAS-${testName} COMMAND "${CMAKE_COMMAND}"
  19. -DTEST=$<TARGET_FILE:${target}>
  20. -DOUTPUT=${TEST_OUTPUT}
  21. -DINTDIR=${CMAKE_CFG_INTDIR}
  22. -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
  23. endif()
  24. endmacro(add_cblas_test)
  25. # Object files for single real precision
  26. SET( STESTL1O c_sblas1.c)
  27. SET( STESTL2O c_sblas2.c c_s2chke.c auxiliary.c c_xerbla.c)
  28. SET( STESTL2O c_sblas2.c c_s2chke.c auxiliary.c c_xerbla.c)
  29. SET( STESTL3O c_sblas3.c c_s3chke.c auxiliary.c c_xerbla.c)
  30. # Object files for double real precision
  31. SET( DTESTL1O c_dblas1.c)
  32. SET( DTESTL2O c_dblas2.c c_d2chke.c auxiliary.c c_xerbla.c)
  33. SET( DTESTL3O c_dblas3.c c_d3chke.c auxiliary.c c_xerbla.c)
  34. # Object files for single complex precision
  35. SET( CTESTL1O c_cblat1.f c_cblas1.c)
  36. SET( CTESTL2O c_cblas2.c c_c2chke.c auxiliary.c c_xerbla.c)
  37. SET( CTESTL3O c_cblas3.c c_c3chke.c auxiliary.c c_xerbla.c)
  38. # Object files for double complex precision
  39. SET( ZTESTL1O c_zblas1.c)
  40. SET( ZTESTL2O c_zblas2.c c_z2chke.c auxiliary.c c_xerbla.c)
  41. SET( ZTESTL3O c_zblas3.c c_z3chke.c auxiliary.c c_xerbla.c)
  42. if(BUILD_SINGLE)
  43. add_executable(xscblat1 c_sblat1.f ${STESTL1O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  44. add_executable(xscblat2 c_sblat2.f ${STESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  45. add_executable(xscblat3 c_sblat3.f ${STESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  46. target_link_libraries(xscblat1 cblas ${BLAS_LIBRARIES})
  47. target_link_libraries(xscblat2 cblas ${BLAS_LIBRARIES})
  48. target_link_libraries(xscblat3 cblas ${BLAS_LIBRARIES})
  49. add_cblas_test(stest1.out "" xscblat1)
  50. add_cblas_test(stest2.out sin2 xscblat2)
  51. add_cblas_test(stest3.out sin3 xscblat3)
  52. endif()
  53. if(BUILD_DOUBLE)
  54. add_executable(xdcblat1 c_dblat1.f ${DTESTL1O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  55. add_executable(xdcblat2 c_dblat2.f ${DTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  56. add_executable(xdcblat3 c_dblat3.f ${DTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  57. target_link_libraries(xdcblat1 cblas ${BLAS_LIBRARIES})
  58. target_link_libraries(xdcblat2 cblas ${BLAS_LIBRARIES})
  59. target_link_libraries(xdcblat3 cblas ${BLAS_LIBRARIES})
  60. add_cblas_test(dtest1.out "" xdcblat1)
  61. add_cblas_test(dtest2.out din2 xdcblat2)
  62. add_cblas_test(dtest3.out din3 xdcblat3)
  63. endif()
  64. if(BUILD_COMPLEX)
  65. add_executable(xccblat1 c_cblat1.f ${CTESTL1O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  66. add_executable(xccblat2 c_cblat2.f ${CTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  67. add_executable(xccblat3 c_cblat3.f ${CTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  68. target_link_libraries(xccblat1 cblas ${BLAS_LIBRARIES})
  69. target_link_libraries(xccblat2 cblas ${BLAS_LIBRARIES})
  70. target_link_libraries(xccblat3 cblas ${BLAS_LIBRARIES})
  71. add_cblas_test(ctest1.out "" xccblat1)
  72. add_cblas_test(ctest2.out cin2 xccblat2)
  73. add_cblas_test(ctest3.out cin3 xccblat3)
  74. endif()
  75. if(BUILD_COMPLEX16)
  76. add_executable(xzcblat1 c_zblat1.f ${ZTESTL1O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  77. add_executable(xzcblat2 c_zblat2.f ${ZTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  78. add_executable(xzcblat3 c_zblat3.f ${ZTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
  79. target_link_libraries(xzcblat1 cblas ${BLAS_LIBRARIES})
  80. target_link_libraries(xzcblat2 cblas ${BLAS_LIBRARIES})
  81. target_link_libraries(xzcblat3 cblas ${BLAS_LIBRARIES})
  82. add_cblas_test(ztest1.out "" xzcblat1)
  83. add_cblas_test(ztest2.out zin2 xzcblat2)
  84. add_cblas_test(ztest3.out zin3 xzcblat3)
  85. endif()