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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #######################################################################
  2. # This makefile creates the test programs for the BLAS 1 routines.
  3. # The test files are grouped as follows:
  4. # SBLAT1 -- Single precision real test routines
  5. # CBLAT1 -- Single precision complex test routines
  6. # DBLAT1 -- Double precision real test routines
  7. # ZBLAT1 -- Double precision complex test routines
  8. #
  9. # Test programs can be generated for all or some of the four different
  10. # precisions. To create the test programs, enter make followed by one
  11. # or more of the precisions desired. Some examples:
  12. # make single
  13. # make single complex
  14. # make single double complex complex16
  15. # Alternatively, the command
  16. # make
  17. # without any arguments creates all four test programs.
  18. # The executable files which are created are called
  19. # ../xblat1s, ../xblat1d, ../xblat1c, and ../xblat1z
  20. #
  21. # To remove the object files after the executable files have been
  22. # created, enter
  23. # make clean
  24. # To force the source files to be recompiled, enter, for example,
  25. # make single FRC=FRC
  26. #
  27. #######################################################################
  28. macro(add_blas_test name src)
  29. get_filename_component(baseNAME ${src} NAME_WE)
  30. set(TEST_INPUT "${LAPACK_SOURCE_DIR}/BLAS/${baseNAME}.in")
  31. add_executable(${name} ${src})
  32. target_link_libraries(${name} blas)
  33. if(EXISTS "${TEST_INPUT}")
  34. add_test(NAME BLAS-${name} COMMAND "${CMAKE_COMMAND}"
  35. -DTEST=$<TARGET_FILE:${name}>
  36. -DINPUT=${TEST_INPUT}
  37. -DINTDIR=${CMAKE_CFG_INTDIR}
  38. -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
  39. else()
  40. add_test(NAME BLAS-${name} COMMAND "${CMAKE_COMMAND}"
  41. -DTEST=$<TARGET_FILE:${name}>
  42. -DINTDIR=${CMAKE_CFG_INTDIR}
  43. -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
  44. endif()
  45. endmacro()
  46. if(BUILD_SINGLE)
  47. add_blas_test(xblat1s sblat1.f)
  48. add_blas_test(xblat2s sblat2.f)
  49. add_blas_test(xblat3s sblat3.f)
  50. endif()
  51. if(BUILD_DOUBLE)
  52. add_blas_test(xblat1d dblat1.f)
  53. add_blas_test(xblat2d dblat2.f)
  54. add_blas_test(xblat3d dblat3.f)
  55. endif()
  56. if(BUILD_COMPLEX)
  57. add_blas_test(xblat1c cblat1.f)
  58. add_blas_test(xblat2c cblat2.f)
  59. add_blas_test(xblat3c cblat3.f)
  60. endif()
  61. if(BUILD_COMPLEX16)
  62. add_blas_test(xblat1z zblat1.f)
  63. add_blas_test(xblat2z zblat2.f)
  64. add_blas_test(xblat3z zblat3.f)
  65. endif()