Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
964facba743ddb3f9b2a27fe949aec7d43da2bd9
[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         FIND_PROGRAM(HAVE_SSH ssh)
10         FIND_PROGRAM(HAVE_RSYNC rsync)
11
12     MESSAGE(STATUS "Pipol user is ${pipol_user}")
13     IF(HAVE_SSH)
14       # get pipol systems
15       EXECUTE_PROCESS(COMMAND 
16         ssh ${pipol_user}@pipol.inria.fr pipol-sub --query=systems 
17         OUTPUT_VARIABLE PIPOL_SYSTEMS OUTPUT_STRIP_TRAILING_WHITESPACE)
18     ENDIF(HAVE_SSH)
19   
20         ADD_CUSTOM_TARGET(pipol_test_list_images
21                 COMMENT "Available images for pipol tests (cmake + make + make test) : "
22                 )
23                 
24         ADD_CUSTOM_TARGET(pipol_experimental_list_images
25                 COMMENT "Available images for ctest (ctest -D Experimental) : "
26                 )
27                 
28         ADD_CUSTOM_TARGET(pipol_kvm_deploy
29                 COMMENT "Deploy all kvm images on pipol (ctest -D Experimental) : "
30                 )
31         ADD_CUSTOM_COMMAND(TARGET pipol_kvm_deploy
32                 POST_BUILD
33                 COMMENT "See results on http://cdash.inria.fr/CDash/index.php?project=Simgrid"
34                 )
35   
36     IF(HAVE_RSYNC)
37               
38               MACRO(PIPOL_TARGET
39                   SYSTEM_PATTERN)
40                                   STRING(REPLACE ".dd.gz" "" SYSTEM_TARGET ${SYSTEM_PATTERN})
41                                 
42                               ADD_CUSTOM_TARGET(
43                                 ${SYSTEM_TARGET}
44                                 COMMENT "PIPOL Build : ${SYSTEM_PATTERN}"
45                                 COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
46                                 COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
47                                 \"sudo mkdir -p \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
48                                 sudo chown ${pipol_user} \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
49                                 cd \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
50                                 sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
51                                 cmake -Denable_print_message=on -Denable_tracing=on -Denable_model-checking=on ${CMAKE_HOME_DIRECTORY} \;
52                                 make clean \;
53                                 make \;
54                                 make check \"
55                                 )
56                               ADD_CUSTOM_TARGET(
57                                 ${SYSTEM_TARGET}_experimental
58                                 COMMENT "PIPOL Build : ${SYSTEM_PATTERN}_experimental"
59                                 COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
60                                 COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
61                                 \"sudo mkdir -p \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
62                                 sudo chown ${pipol_user} \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
63                                 cd \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
64                                 sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
65                                 cmake -Denable_tracing=on -Denable_model-checking=on ${CMAKE_HOME_DIRECTORY} \;
66                                 ctest -D Experimental \"
67                                 )
68                                 
69                               STRING(REGEX MATCH "kvm" make_test "${SYSTEM_TARGET}")
70                               if(make_test)
71                                 STRING(REGEX MATCH "windows" make_test "${SYSTEM_TARGET}")
72                                 if(NOT make_test)
73                                   ADD_CUSTOM_COMMAND(TARGET pipol_kvm_deploy
74                                         COMMENT "PIPOL Build : ${SYSTEM_PATTERN}"
75                                         COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub .
76                                         COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC  
77                                         \"sudo mkdir -p \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
78                                         sudo chown ${pipol_user} \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
79                                         cd \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \;
80                                         sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
81                                         cmake -Denable_tracing=on -Denable_model-checking=on ${CMAKE_HOME_DIRECTORY} \;
82                                         ctest -D Experimental \"
83                                          )
84                                 endif(NOT make_test)
85                               endif(make_test)
86                               
87                               ADD_CUSTOM_COMMAND(TARGET ${SYSTEM_TARGET}_experimental
88                                                                  POST_BUILD
89                                                                  COMMENT "See results on http://cdash.inria.fr/CDash/index.php?project=Simgrid"
90                                                                  )
91                                                                  
92                               ADD_CUSTOM_COMMAND(TARGET pipol_test_list_images
93                                         COMMAND echo ${SYSTEM_TARGET}
94                                         )
95                                   ADD_CUSTOM_COMMAND(TARGET pipol_experimental_list_images
96                                         COMMAND echo "${SYSTEM_TARGET}_experimental"
97                                         )
98       ENDMACRO(PIPOL_TARGET)
99       
100     ENDIF(HAVE_RSYNC)
101     
102 # add a target for each pipol system
103 IF(PIPOL_SYSTEMS)
104   MESSAGE(STATUS "Adding Pipol targets")
105   FOREACH(SYSTEM ${PIPOL_SYSTEMS})
106     PIPOL_TARGET(${SYSTEM})
107   ENDFOREACH(SYSTEM ${PIPOL_SYSTEMS})
108 ENDIF(PIPOL_SYSTEMS)
109
110 ENDIF(pipol_user)