Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
693fdecdaba40d2003f8e25789c14f448e7d54a9
[simgrid.git] / buildtools / Cmake / Pipol.cmake
1 # On a Pipol system, set:
2 # PIPOL_USER
3
4 #SET(PIPOL_USER $ENV{PIPOL_USER})
5
6 # ssh/rsync mandatory 
7 IF(pipol_user)
8
9         set(CMAKE_OPTIONS "     -Wno-dev")
10         
11         if(custom_flags)
12         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Dcustom_flags=${custom_flags}")
13         endif(custom_flags)
14         
15         if(with_context)
16         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Dwith_context=${with_context}")
17         endif(with_context)
18         
19         if(enable_smpi)
20         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_smpi=on")
21         endif(enable_smpi)
22         
23         if(enable_java)
24         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_java=on")
25         endif(enable_java)
26         
27         if(enable_lua)
28         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_lua=on")
29         endif(enable_lua)       
30         
31         if(enable_ruby)
32         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_ruby=on")
33         endif(enable_ruby)      
34         
35         if(enable_compile_optimizations)
36         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_compile_optimizations=on")
37         endif(enable_compile_optimizations)
38         
39         if(enable_compile_warnings)
40         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_compile_warnings=on")
41         endif(enable_compile_warnings)  
42         
43         if(enable_tracing)
44         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_tracing=on")
45         endif(enable_tracing)
46         
47         if(enable_coverage)
48         set(CMAKE_OPTIONS "${CMAKE_OPTION}      -Denable_coverage=on")
49         endif(enable_coverage)  
50         
51         if(enable_print_message)        
52         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_print_message=on")
53         endif(enable_print_message)     
54         
55         if(enable_model-checking)
56         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_model-checking=on")
57         endif(enable_model-checking)
58         
59     if(enable_latency_bound_tracking)
60         set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Denable_latency_bound_tracking=on")
61         endif(enable_latency_bound_tracking)
62
63         FIND_PROGRAM(HAVE_SSH ssh)
64         FIND_PROGRAM(HAVE_RSYNC rsync)
65
66     MESSAGE(STATUS "Pipol user is ${pipol_user}")
67     IF(HAVE_SSH)
68       # get pipol systems
69       EXECUTE_PROCESS(COMMAND 
70         ssh ${pipol_user}@pipol.inria.fr pipol-sub --query=systems 
71         OUTPUT_VARIABLE PIPOL_SYSTEMS OUTPUT_STRIP_TRAILING_WHITESPACE)
72     ENDIF(HAVE_SSH)
73   
74         ADD_CUSTOM_TARGET(pipol_test_list_images
75                 COMMENT "Available images for pipol tests (cmake + make + make test) : "
76                 )
77                 
78         ADD_CUSTOM_TARGET(pipol_experimental_list_images
79                 COMMENT "Available images for ctest (ctest -D Experimental) : "
80                 )
81                 
82         ADD_CUSTOM_TARGET(pipol_kvm_deploy
83                 COMMENT "Deploy all kvm images on pipol (ctest -D Experimental) : "
84                 )
85         ADD_CUSTOM_COMMAND(TARGET pipol_kvm_deploy
86                 POST_BUILD
87                 COMMENT "See results on http://cdash.inria.fr/CDash/index.php?project=Simgrid"
88                 )
89   
90     IF(HAVE_RSYNC)
91               
92               MACRO(PIPOL_TARGET
93                   SYSTEM_PATTERN)
94                                   STRING(REPLACE ".dd.gz" "" SYSTEM_TARGET ${SYSTEM_PATTERN})
95                                 
96                               ADD_CUSTOM_TARGET(
97                                 ${SYSTEM_TARGET}
98                                 COMMENT "PIPOL Build : ${SYSTEM_PATTERN}"
99                                 COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
100                                 COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
101                                 \"sudo chown ${pipol_user} ${CMAKE_HOME_DIRECTORY} \;
102                                 cd ${CMAKE_HOME_DIRECTORY} \;
103                                 sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
104                                 cmake -E remove CMakeCache.txt \;
105                                 cmake ${CMAKE_HOME_DIRECTORY}${CMAKE_OPTIONS} \;
106                                 make clean \;
107                                 make \;
108                                 make check \"
109                                 )
110                               ADD_CUSTOM_TARGET(
111                                 ${SYSTEM_TARGET}_experimental
112                                 COMMENT "PIPOL Build : ${SYSTEM_PATTERN}_experimental"
113                                 COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
114                                 COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
115                                 \"sudo chown ${pipol_user} ${CMAKE_HOME_DIRECTORY} \;
116                                 cd ${CMAKE_HOME_DIRECTORY} \;
117                                 sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
118                                 cmake -E remove CMakeCache.txt \;
119                                 cmake ${CMAKE_HOME_DIRECTORY}${CMAKE_OPTIONS} \;
120                                 ctest -D Experimental \"
121                                 )
122                                 
123                               STRING(REGEX MATCH "kvm" make_test "${SYSTEM_TARGET}")
124                               if(make_test)
125                                 STRING(REGEX MATCH "windows" make_test "${SYSTEM_TARGET}")
126                                 if(NOT make_test)
127                                   ADD_CUSTOM_COMMAND(TARGET pipol_kvm_deploy
128                                         COMMENT "PIPOL Build : ${SYSTEM_PATTERN}"
129                                         COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
130                                         COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
131                                         \"sudo chown ${pipol_user} ${CMAKE_HOME_DIRECTORY} \;
132                                         cd ${CMAKE_HOME_DIRECTORY} \;
133                                         sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
134                                         cmake -E remove CMakeCache.txt \;
135                                         cmake ${CMAKE_HOME_DIRECTORY}${CMAKE_OPTIONS} \;
136                                         ctest -D Experimental \"
137                                          )
138                                 endif(NOT make_test)
139                               endif(make_test)
140                               
141                               ADD_CUSTOM_COMMAND(TARGET ${SYSTEM_TARGET}_experimental
142                                                                  POST_BUILD
143                                                                  COMMENT "See results on http://cdash.inria.fr/CDash/index.php?project=Simgrid"
144                                                                  )
145                                                                  
146                               ADD_CUSTOM_COMMAND(TARGET pipol_test_list_images
147                                         COMMAND echo ${SYSTEM_TARGET}
148                                         )
149                                   ADD_CUSTOM_COMMAND(TARGET pipol_experimental_list_images
150                                         COMMAND echo "${SYSTEM_TARGET}_experimental"
151                                         )
152       ENDMACRO(PIPOL_TARGET)
153       
154     ENDIF(HAVE_RSYNC)
155     
156 # add a target for each pipol system
157 IF(PIPOL_SYSTEMS)
158   MESSAGE(STATUS "Adding Pipol targets")
159   FOREACH(SYSTEM ${PIPOL_SYSTEMS})
160     PIPOL_TARGET(${SYSTEM})
161   ENDFOREACH(SYSTEM ${PIPOL_SYSTEMS})
162 ENDIF(PIPOL_SYSTEMS)
163
164 ADD_CUSTOM_TARGET(pipol_kill_all_jobs
165                 COMMENT "PIPOL delete all jobs"
166                 COMMAND ./pipol-sub --pipol-user=${pipol_user} deleteallmyjobs
167                 )
168
169
170 ENDIF(pipol_user)