Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
46448e48de3620a12fa47eac5ebbb29ae99abd1d
[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         FIND_PROGRAM(HAVE_SSH ssh)
60         FIND_PROGRAM(HAVE_RSYNC rsync)
61
62     MESSAGE(STATUS "Pipol user is ${pipol_user}")
63     IF(HAVE_SSH)
64       # get pipol systems
65       EXECUTE_PROCESS(COMMAND 
66         ssh ${pipol_user}@pipol.inria.fr pipol-sub --query=systems 
67         OUTPUT_VARIABLE PIPOL_SYSTEMS OUTPUT_STRIP_TRAILING_WHITESPACE)
68     ENDIF(HAVE_SSH)
69   
70         ADD_CUSTOM_TARGET(pipol_test_list_images
71                 COMMENT "Available images for pipol tests (cmake + make + make test) : "
72                 )
73                 
74         ADD_CUSTOM_TARGET(pipol_experimental_list_images
75                 COMMENT "Available images for ctest (ctest -D Experimental) : "
76                 )
77                 
78         ADD_CUSTOM_TARGET(pipol_kvm_deploy
79                 COMMENT "Deploy all kvm images on pipol (ctest -D Experimental) : "
80                 )
81         ADD_CUSTOM_COMMAND(TARGET pipol_kvm_deploy
82                 POST_BUILD
83                 COMMENT "See results on http://cdash.inria.fr/CDash/index.php?project=Simgrid"
84                 )
85   
86     IF(HAVE_RSYNC)
87               
88               MACRO(PIPOL_TARGET
89                   SYSTEM_PATTERN)
90                                   STRING(REPLACE ".dd.gz" "" SYSTEM_TARGET ${SYSTEM_PATTERN})
91                                 
92                               ADD_CUSTOM_TARGET(
93                                 ${SYSTEM_TARGET}
94                                 COMMENT "PIPOL Build : ${SYSTEM_PATTERN}"
95                                 COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
96                                 COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
97                                 \"sudo chown ${pipol_user} ${CMAKE_HOME_DIRECTORY} \;
98                                 cd ${CMAKE_HOME_DIRECTORY} \;
99                                 sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
100                                 perl ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/cmake.pl \;
101                                 cmake -E remove CMakeCache.txt \;
102                                 cmake ${CMAKE_HOME_DIRECTORY}${CMAKE_OPTIONS} \;
103                                 make clean \;
104                                 make \;
105                                 make check \"
106                                 )
107                               ADD_CUSTOM_TARGET(
108                                 ${SYSTEM_TARGET}_experimental
109                                 COMMENT "PIPOL Build : ${SYSTEM_PATTERN}_experimental"
110                                 COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
111                                 COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
112                                 \"sudo chown ${pipol_user} ${CMAKE_HOME_DIRECTORY} \;
113                                 cd ${CMAKE_HOME_DIRECTORY} \;
114                                 sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
115                                 perl ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/cmake.pl \;
116                                 cmake -E remove CMakeCache.txt \;
117                                 cmake ${CMAKE_HOME_DIRECTORY}${CMAKE_OPTIONS} \;
118                                 ctest -D Experimental \"
119                                 )
120                                 
121                               STRING(REGEX MATCH "kvm" make_test "${SYSTEM_TARGET}")
122                               if(make_test)
123                                 STRING(REGEX MATCH "windows" make_test "${SYSTEM_TARGET}")
124                                 if(NOT make_test)
125                                   ADD_CUSTOM_COMMAND(TARGET pipol_kvm_deploy
126                                         COMMENT "PIPOL Build : ${SYSTEM_PATTERN}"
127                                         COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
128                                         COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
129                                         \"sudo chown ${pipol_user} ${CMAKE_HOME_DIRECTORY} \;
130                                         cd ${CMAKE_HOME_DIRECTORY} \;
131                                         sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
132                                         perl ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/cmake.pl \;
133                                         cmake -E remove CMakeCache.txt \;
134                                         cmake ${CMAKE_HOME_DIRECTORY}${CMAKE_OPTIONS} \;
135                                         ctest -D Experimental \"
136                                          )
137                                 endif(NOT make_test)
138                               endif(make_test)
139                               
140                               ADD_CUSTOM_COMMAND(TARGET ${SYSTEM_TARGET}_experimental
141                                                                  POST_BUILD
142                                                                  COMMENT "See results on http://cdash.inria.fr/CDash/index.php?project=Simgrid"
143                                                                  )
144                                                                  
145                               ADD_CUSTOM_COMMAND(TARGET pipol_test_list_images
146                                         COMMAND echo ${SYSTEM_TARGET}
147                                         )
148                                   ADD_CUSTOM_COMMAND(TARGET pipol_experimental_list_images
149                                         COMMAND echo "${SYSTEM_TARGET}_experimental"
150                                         )
151       ENDMACRO(PIPOL_TARGET)
152       
153     ENDIF(HAVE_RSYNC)
154     
155 # add a target for each pipol system
156 IF(PIPOL_SYSTEMS)
157   MESSAGE(STATUS "Adding Pipol targets")
158   FOREACH(SYSTEM ${PIPOL_SYSTEMS})
159     PIPOL_TARGET(${SYSTEM})
160   ENDFOREACH(SYSTEM ${PIPOL_SYSTEMS})
161 ENDIF(PIPOL_SYSTEMS)
162
163 ENDIF(pipol_user)