forked from trilinos/Trilinos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctest_build_damogran.cmake
162 lines (134 loc) · 5.12 KB
/
ctest_build_damogran.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/Trilinos")
set(CTEST_BINARY_DIRECTORY "$ENV{HOME}/Dashboards/tb2")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_SITE "damogran.kitware")
set(CTEST_BUILD_NAME "MacOSX-make")
set(CTEST_BUILD_FLAGS -j3)
set(ENV{FC} "/Users/davidcole/Dashboards/Support/gfortran/bin/gfortran")
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
include(${CTEST_SCRIPT_DIRECTORY}/TrilinosArrakisCTestConfig.cmake)
set(CTEST_USE_LAUNCHERS 1)
find_package(CVS)
set(CTEST_UPDATE_COMMAND "${CVS_EXECUTABLE}")
message("CTEST_UPDATE_COMMAND='${CTEST_UPDATE_COMMAND}'")
set(Trilinos_PACKAGES
#Pamgen
#ThreadPool
#Teuchos
#Shards
#Kokkos
${CTEST_PROJECT_SUBPROJECTS}
)
set(Trilinos_FAILED_PACKAGES) # store set of failed packages
ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}")
#ctest_start("Experimental")
ctest_start("Nightly")
message("updating...")
ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
message("updated... res='${res}'")
# Tell CDash about the latest subproject dependencies:
#
ctest_submit(FILES "${CTEST_SOURCE_DIRECTORY}/cmake/python/data/CDashSubprojectDependencies.xml"
RETURN_VALUE res)
message("submitted subproject dependencies... res='${res}'")
# loop over all Trilinos packages
message("begin loop")
set(Trilinos_LAST_WORKING_PACKAGE)
foreach(TRIBITS_PACKAGE ${Trilinos_PACKAGES})
set_property(GLOBAL PROPERTY SubProject ${TRIBITS_PACKAGE})
set_property(GLOBAL PROPERTY Label ${TRIBITS_PACKAGE})
message("TRIBITS_PACKAGE='${TRIBITS_PACKAGE}'")
# CONFIGURE STEP
# create CONFIGURE_OPTIONS for this TRIBITS_PACKAGE
set(CONFIGURE_OPTIONS
"-DCTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}"
"-DTrilinos_ENABLE_${TRIBITS_PACKAGE}:BOOL=ON"
"-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON"
"-DTrilinos_ENABLE_TESTS:BOOL=ON")
if(DEFINED Trilinos_LAST_WORKING_PACKAGE)
list(APPEND CONFIGURE_OPTIONS
"-DTrilinos_ENABLE_${Trilinos_LAST_WORKING_PACKAGE}:BOOL=")
set(Trilinos_LAST_WORKING_PACKAGE)
endif()
foreach(FAILED_PACKAGE ${Trilinos_FAILED_PACKAGES})
list(APPEND CONFIGURE_OPTIONS
"-DTrilinos_ENABLE_${FAILED_PACKAGE}:BOOL=OFF")
endforeach(FAILED_PACKAGE)
# new option for ctest_configure OPTIONS a list of command
# line arguments to give to cmake: -D stuff for example
message("Configure TRIBITS_PACKAGE='${TRIBITS_PACKAGE}'")
message("CONFIGURE_OPTIONS = '${CONFIGURE_OPTIONS}'")
ctest_configure(
BUILD "${CTEST_BINARY_DIRECTORY}"
OPTIONS "${CONFIGURE_OPTIONS}"
RETURN_VALUE res
)
# if the configure failed add the package to the list
# of failed packages
if(NOT "${res}" EQUAL "0")
message("${TRIBITS_PACKAGE} FAILED to configure")
list(APPEND Trilinos_FAILED_PACKAGES ${TRIBITS_PACKAGE})
else()
# load target properties and test keywords
ctest_read_custom_files(BUILD "${CTEST_BINARY_DIRECTORY}")
endif()
include(${CTEST_SCRIPT_DIRECTORY}/TrilinosArrakisCTestConfig.cmake)
# submit configure results
ctest_submit( PARTS configure notes ) # submit notes and configure at this point
# If configure failed, move to next iteration:
#
if("${res}" EQUAL "0")
set(CTEST_BUILD_TARGET ${TRIBITS_PACKAGE}_libs)
message("Build: '${CTEST_BUILD_TARGET}'")
ctest_build (
BUILD "${CTEST_BINARY_DIRECTORY}"
RETURN_VALUE res
NUMBER_ERRORS numerrors
APPEND
)
# set this to false
set(build_success FALSE)
# since make -i is used the res might be 0, but
# if there are errors the build should fail, so
# both res and numerrors should be 0 for a good build
# and for the all target to be built and tests run
if("${numerrors}" EQUAL "0" AND "${res}" EQUAL "0")
set(build_success TRUE)
endif()
ctest_submit( PARTS build ) # submit the build
message("return from ctest_build ${res}")
# check to see if the build worked
if(NOT build_success)
message("FAILED: build '${TRIBITS_PACKAGE}'")
list(APPEND Trilinos_FAILED_PACKAGES ${TRIBITS_PACKAGE})
else()
# inside here the build worked
# Now build ALL target, but append the results to the last build.xml
set(CTEST_BUILD_TARGET)
message("build all for '${TRIBITS_PACKAGE}'")
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}"
NUMBER_ERRORS numerrors
RETURN_VALUE res
APPEND
)
# submit the build for all target
ctest_submit( PARTS build )
# now run the tests that match the ${TRIBITS_PACKAGE} name
message("test for '${TRIBITS_PACKAGE}'")
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}"
INCLUDE "^${TRIBITS_PACKAGE}" APPEND
)
#ctest_memcheck(BUILD "${CTEST_BINARY_DIRECTORY}"
# KEYWORDS ${TRIBITS_PACKAGE})
#ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}")
# submit test, memcheck and coverage results
ctest_submit(PARTS Test)
set(Trilinos_LAST_WORKING_PACKAGE "${TRIBITS_PACKAGE}")
endif()
endif()
endforeach(TRIBITS_PACKAGE)
if(Trilinos_FAILED_PACKAGES)
message("Failed packages! ${Trilinos_FAILED_PACKAGES}")
endif()
message("Done with build.")