You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

229 lines
8.9 KiB

  1. ####################################################################
  2. #
  3. # Usage:
  4. # - create a new folder, let's call it cdash
  5. # - in that folder, do:
  6. # ctest -S path/to/eigen/test/testsuite.cmake[,option1=value1[,option2=value2]]
  7. #
  8. # Options:
  9. # - EIGEN_CXX: compiler, eg.: g++-4.2
  10. # default: default c++ compiler
  11. # - EIGEN_SITE: eg, INRIA-Bdx_pc-gael, or the name of the contributor, etc.
  12. # default: hostname
  13. # - EIGEN_BUILD_STRING: a string which identify the system/compiler. It should be formed like that:
  14. # <OS_name>-<OS_version>-<arch>-<compiler-version>
  15. # with:
  16. # <OS_name> = opensuse, debian, osx, windows, cygwin, freebsd, solaris, etc.
  17. # <OS_version> = 11.1, XP, vista, leopard, etc.
  18. # <arch> = i386, x86_64, ia64, powerpc, etc.
  19. # <compiler-version> = gcc-4.3.2, icc-11.0, MSVC-2008, etc.
  20. # - EIGEN_EXPLICIT_VECTORIZATION: novec, SSE2, Altivec
  21. # default: SSE2 for x86_64 systems, novec otherwise
  22. # Its value is automatically appended to EIGEN_BUILD_STRING
  23. # - EIGEN_CMAKE_DIR: path to cmake executable
  24. # - EIGEN_MODE: dashboard model, can be Experimental, Nightly, or Continuous
  25. # default: Nightly
  26. # - EIGEN_WORK_DIR: directory used to download the source files and make the builds
  27. # default: folder which contains this script
  28. # - EIGEN_CMAKE_ARGS: additional arguments passed to cmake
  29. # - EIGEN_GENERATOR_TYPE: allows to overwrite the generator type
  30. # default: nmake (windows
  31. # See http://www.cmake.org/cmake/help/cmake2.6docs.html#section_Generators for a complete
  32. # list of supported generators.
  33. # - EIGEN_NO_UPDATE: allows to submit dash boards from local repositories
  34. # This might be interesting in case you want to submit dashboards
  35. # including local changes.
  36. # - CTEST_SOURCE_DIRECTORY: path to eigen's src (use a new and empty folder, not the one you are working on)
  37. # default: <EIGEN_WORK_DIR>/src
  38. # - CTEST_BINARY_DIRECTORY: build directory
  39. # default: <EIGEN_WORK_DIR>/nightly-<EIGEN_CXX>
  40. #
  41. # Here is an example running several compilers on a linux system:
  42. # #!/bin/bash
  43. # ARCH=`uname -m`
  44. # SITE=`hostname`
  45. # VERSION=opensuse-11.1
  46. # WORK_DIR=/home/gael/Coding/eigen/cdash
  47. # # get the last version of the script
  48. # wget http://bitbucket.org/eigen/eigen/raw/tip/test/testsuite.cmake -o $WORK_DIR/testsuite.cmake
  49. # COMMON="ctest -S $WORK_DIR/testsuite.cmake,EIGEN_WORK_DIR=$WORK_DIR,EIGEN_SITE=$SITE,EIGEN_MODE=$1,EIGEN_BUILD_STRING=$OS_VERSION-$ARCH"
  50. # $COMMON-gcc-3.4.6,EIGEN_CXX=g++-3.4
  51. # $COMMON-gcc-4.0.1,EIGEN_CXX=g++-4.0.1
  52. # $COMMON-gcc-4.3.2,EIGEN_CXX=g++-4.3,EIGEN_EXPLICIT_VECTORIZATION=novec
  53. # $COMMON-gcc-4.3.2,EIGEN_CXX=g++-4.3,EIGEN_EXPLICIT_VECTORIZATION=SSE2
  54. # $COMMON-icc-11.0,EIGEN_CXX=icpc
  55. #
  56. ####################################################################
  57. # process the arguments
  58. set(ARGLIST ${CTEST_SCRIPT_ARG})
  59. while(${ARGLIST} MATCHES ".+.*")
  60. # pick first
  61. string(REGEX MATCH "([^,]*)(,.*)?" DUMMY ${ARGLIST})
  62. SET(TOP ${CMAKE_MATCH_1})
  63. # remove first
  64. string(REGEX MATCHALL "[^,]*,(.*)" DUMMY ${ARGLIST})
  65. SET(ARGLIST ${CMAKE_MATCH_1})
  66. # decompose as a pair key=value
  67. string(REGEX MATCH "([^=]*)(=.*)?" DUMMY ${TOP})
  68. SET(KEY ${CMAKE_MATCH_1})
  69. string(REGEX MATCH "[^=]*=(.*)" DUMMY ${TOP})
  70. SET(VALUE ${CMAKE_MATCH_1})
  71. # set the variable to the specified value
  72. if(VALUE)
  73. SET(${KEY} ${VALUE})
  74. else(VALUE)
  75. SET(${KEY} ON)
  76. endif(VALUE)
  77. endwhile(${ARGLIST} MATCHES ".+.*")
  78. ####################################################################
  79. # Automatically set some user variables if they have not been defined manually
  80. ####################################################################
  81. cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
  82. if(NOT EIGEN_SITE)
  83. site_name(EIGEN_SITE)
  84. endif(NOT EIGEN_SITE)
  85. if(NOT EIGEN_CMAKE_DIR)
  86. SET(EIGEN_CMAKE_DIR "")
  87. endif(NOT EIGEN_CMAKE_DIR)
  88. if(NOT EIGEN_BUILD_STRING)
  89. # let's try to find all information we need to make the build string ourself
  90. # OS
  91. build_name(EIGEN_OS_VERSION)
  92. # arch
  93. set(EIGEN_ARCH ${CMAKE_SYSTEM_PROCESSOR})
  94. if(WIN32)
  95. set(EIGEN_ARCH $ENV{PROCESSOR_ARCHITECTURE})
  96. else(WIN32)
  97. execute_process(COMMAND uname -m OUTPUT_VARIABLE EIGEN_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
  98. endif(WIN32)
  99. set(EIGEN_BUILD_STRING ${EIGEN_OS_VERSION}${EIGEN_ARCH}-${EIGEN_CXX})
  100. endif(NOT EIGEN_BUILD_STRING)
  101. if(DEFINED EIGEN_EXPLICIT_VECTORIZATION)
  102. set(EIGEN_BUILD_STRING ${EIGEN_BUILD_STRING}-${EIGEN_EXPLICIT_VECTORIZATION})
  103. endif(DEFINED EIGEN_EXPLICIT_VECTORIZATION)
  104. if(NOT EIGEN_WORK_DIR)
  105. set(EIGEN_WORK_DIR ${CTEST_SCRIPT_DIRECTORY})
  106. endif(NOT EIGEN_WORK_DIR)
  107. if(NOT CTEST_SOURCE_DIRECTORY)
  108. SET (CTEST_SOURCE_DIRECTORY "${EIGEN_WORK_DIR}/src")
  109. endif(NOT CTEST_SOURCE_DIRECTORY)
  110. if(NOT CTEST_BINARY_DIRECTORY)
  111. SET (CTEST_BINARY_DIRECTORY "${EIGEN_WORK_DIR}/nightly_${EIGEN_CXX}")
  112. endif(NOT CTEST_BINARY_DIRECTORY)
  113. if(NOT EIGEN_MODE)
  114. set(EIGEN_MODE Nightly)
  115. endif(NOT EIGEN_MODE)
  116. ## mandatory variables (the default should be ok in most cases):
  117. if(NOT EIGEN_NO_UPDATE)
  118. SET (CTEST_CVS_COMMAND "hg")
  119. SET (CTEST_CVS_CHECKOUT "${CTEST_CVS_COMMAND} clone http://bitbucket.org/eigen/eigen \"${CTEST_SOURCE_DIRECTORY}\"")
  120. SET(CTEST_BACKUP_AND_RESTORE TRUE) # the backup is CVS related ...
  121. endif(NOT EIGEN_NO_UPDATE)
  122. # which ctest command to use for running the dashboard
  123. SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE} --no-compress-output")
  124. if($ENV{EIGEN_CTEST_ARGS})
  125. SET (CTEST_COMMAND "${CTEST_COMMAND} $ENV{EIGEN_CTEST_ARGS}")
  126. endif($ENV{EIGEN_CTEST_ARGS})
  127. # what cmake command to use for configuring this dashboard
  128. SET (CTEST_CMAKE_COMMAND "${EIGEN_CMAKE_DIR}cmake -DEIGEN_LEAVE_TEST_IN_ALL_TARGET=ON")
  129. ####################################################################
  130. # The values in this section are optional you can either
  131. # have them or leave them commented out
  132. ####################################################################
  133. # this make sure we get consistent outputs
  134. SET($ENV{LC_MESSAGES} "en_EN")
  135. # should ctest wipe the binary tree before running
  136. SET(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
  137. # raise the warning/error limit
  138. set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "33331")
  139. set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "33331")
  140. # this is the initial cache to use for the binary tree, be careful to escape
  141. # any quotes inside of this string if you use it
  142. if(WIN32 AND NOT UNIX)
  143. #message(SEND_ERROR "win32")
  144. if(EIGEN_GENERATOR_TYPE)
  145. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"${EIGEN_GENERATOR_TYPE}\"")
  146. SET (CTEST_INITIAL_CACHE "
  147. CMAKE_BUILD_TYPE:STRING=Release
  148. BUILDNAME:STRING=${EIGEN_BUILD_STRING}
  149. SITE:STRING=${EIGEN_SITE}
  150. ")
  151. else(EIGEN_GENERATOR_TYPE)
  152. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"NMake Makefiles\" -DCMAKE_MAKE_PROGRAM=nmake")
  153. SET (CTEST_INITIAL_CACHE "
  154. MAKECOMMAND:STRING=nmake /i
  155. CMAKE_MAKE_PROGRAM:FILEPATH=nmake
  156. CMAKE_GENERATOR:INTERNAL=NMake Makefiles
  157. CMAKE_BUILD_TYPE:STRING=Release
  158. BUILDNAME:STRING=${EIGEN_BUILD_STRING}
  159. SITE:STRING=${EIGEN_SITE}
  160. ")
  161. endif(EIGEN_GENERATOR_TYPE)
  162. else(WIN32 AND NOT UNIX)
  163. SET (CTEST_INITIAL_CACHE "
  164. BUILDNAME:STRING=${EIGEN_BUILD_STRING}
  165. SITE:STRING=${EIGEN_SITE}
  166. ")
  167. endif(WIN32 AND NOT UNIX)
  168. # set any extra environment variables to use during the execution of the script here:
  169. # setting this variable on windows machines causes trouble ...
  170. if(EIGEN_CXX AND NOT WIN32)
  171. set(CTEST_ENVIRONMENT "CXX=${EIGEN_CXX}")
  172. endif(EIGEN_CXX AND NOT WIN32)
  173. if(DEFINED EIGEN_EXPLICIT_VECTORIZATION)
  174. if(EIGEN_EXPLICIT_VECTORIZATION MATCHES SSE2)
  175. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -DEIGEN_TEST_SSE2=ON")
  176. elseif(EIGEN_EXPLICIT_VECTORIZATION MATCHES SSE3)
  177. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -DEIGEN_TEST_SSE2=ON -DEIGEN_TEST_SSE3=ON")
  178. elseif(EIGEN_EXPLICIT_VECTORIZATION MATCHES SSSE3)
  179. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -DEIGEN_TEST_SSE2=ON -DEIGEN_TEST_SSE3=ON -DEIGEN_TEST_SSSE3=ON")
  180. elseif(EIGEN_EXPLICIT_VECTORIZATION MATCHES SSE4_1)
  181. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -DEIGEN_TEST_SSE2=ON -DEIGEN_TEST_SSE3=ON -DEIGEN_TEST_SSSE3=ON -DEIGEN_TEST_SSE4_1=ON")
  182. elseif(EIGEN_EXPLICIT_VECTORIZATION MATCHES SSE4_2)
  183. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -DEIGEN_TEST_SSE2=ON -DEIGEN_TEST_SSE3=ON -DEIGEN_TEST_SSSE3=ON -DEIGEN_TEST_SSE4_1=ON -DEIGEN_TEST_SSE4_2=ON")
  184. elseif(EIGEN_EXPLICIT_VECTORIZATION MATCHES Altivec)
  185. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -DEIGEN_TEST_ALTIVEC=ON")
  186. elseif(EIGEN_EXPLICIT_VECTORIZATION MATCHES novec)
  187. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -DEIGEN_TEST_NO_EXPLICIT_VECTORIZATION=ON")
  188. else(EIGEN_EXPLICIT_VECTORIZATION MATCHES SSE2)
  189. message(FATAL_ERROR "Invalid value for EIGEN_EXPLICIT_VECTORIZATION (${EIGEN_EXPLICIT_VECTORIZATION}), must be: novec, SSE2, SSE3, Altivec")
  190. endif(EIGEN_EXPLICIT_VECTORIZATION MATCHES SSE2)
  191. endif(DEFINED EIGEN_EXPLICIT_VECTORIZATION)
  192. if(DEFINED EIGEN_CMAKE_ARGS)
  193. set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} ${EIGEN_CMAKE_ARGS}")
  194. endif(DEFINED EIGEN_CMAKE_ARGS)