From 5b83d17d87eb4b7a182abd0e40512ad6811bdcc5 Mon Sep 17 00:00:00 2001 From: navarrop Date: Wed, 21 Jul 2010 09:46:09 +0000 Subject: [PATCH] Add local tests with pipol. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8041 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- CMakeLists.txt | 3 + buildtools/Cmake/Option.cmake | 6 +- buildtools/Cmake/Pipol.cmake | 110 ++++++++++++++++++ buildtools/Cmake/PrintArgs.cmake | 7 ++ buildtools/pipol/liste_install.sh | 183 ++++++------------------------ src/CMakeLists.txt | 3 +- 6 files changed, 163 insertions(+), 149 deletions(-) create mode 100644 buildtools/Cmake/Pipol.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 246eb5a37a..04f6c75cdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,9 @@ include(${PROJECT_DIRECTORY}/buildtools/Cmake/CTestConfig.cmake) ### Setup the distrib include(${PROJECT_DIRECTORY}/buildtools/Cmake/Distrib.cmake) +### Pipol compilation +include(${PROJECT_DIRECTORY}/buildtools/Cmake/Pipol.cmake) + ### Print ARGS include(${PROJECT_DIRECTORY}/buildtools/Cmake/PrintArgs.cmake) diff --git a/buildtools/Cmake/Option.cmake b/buildtools/Cmake/Option.cmake index 11acfac604..89b82fb59a 100644 --- a/buildtools/Cmake/Option.cmake +++ b/buildtools/Cmake/Option.cmake @@ -17,13 +17,15 @@ if(NOT with_context) set(with_context "auto" CACHE TYPE INTERNAL FORCE) endif(NOT with_context) +set(pipol_user ${pipol_user} CACHE TYPE INTERNAL FORCE) + if(CMAKE_SYSTEM_NAME MATCHES "Darwin") option(enable_smpi "This variable set smpi lib." off) #for the moment it doesn't compil with MacOS else(CMAKE_SYSTEM_NAME MATCHES "Darwin") option(enable_smpi "This variable set smpi lib." on) endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") option(enable_gtnets "This variable set the gtnets context." on) -option(enable_java "This variable set the java context." off) +option(enable_java "This variable set the java context." on) option(enable_lua "This variable set lua use." on) option(enable_ruby "This variable set ruby use." on) option(enable_doc "Setting true this variable enable making the simgrid documentation." off) @@ -48,6 +50,8 @@ if(enable_supernovae AND enable_model-checking) message("\n\nWith supernovae mode the model checking must be disable.!!!\n\n") endif(enable_supernovae AND enable_model-checking) +mark_as_advanced(HAVE_SSH) +mark_as_advanced(HAVE_RSYNC) mark_as_advanced(enable_coverage) mark_as_advanced(enable_memcheck) #mark_as_advanced(enable_print_message) diff --git a/buildtools/Cmake/Pipol.cmake b/buildtools/Cmake/Pipol.cmake new file mode 100644 index 0000000000..575d52be60 --- /dev/null +++ b/buildtools/Cmake/Pipol.cmake @@ -0,0 +1,110 @@ +# On a Pipol system, set: +# PIPOL_USER + +#SET(PIPOL_USER $ENV{PIPOL_USER}) + +# ssh/rsync mandatory +IF(pipol_user) + + FIND_PROGRAM(HAVE_SSH ssh) + FIND_PROGRAM(HAVE_RSYNC rsync) + + MESSAGE(STATUS "Pipol user is ${pipol_user}") + IF(HAVE_SSH) + # get pipol systems + EXECUTE_PROCESS(COMMAND + ssh ${pipol_user}@pipol.inria.fr pipol-sub --query=systems + OUTPUT_VARIABLE PIPOL_SYSTEMS OUTPUT_STRIP_TRAILING_WHITESPACE) + ENDIF(HAVE_SSH) + + ADD_CUSTOM_TARGET(pipol_test_list_images + COMMENT "Available images for pipol tests (cmake + make + make test) : " + ) + + ADD_CUSTOM_TARGET(pipol_experimental_list_images + COMMENT "Available images for ctest (ctest -D Experimental) : " + ) + + ADD_CUSTOM_TARGET(pipol_kvm_deploy + COMMENT "Deploy all kvm images on pipol (ctest -D Experimental) : " + ) + ADD_CUSTOM_COMMAND(TARGET pipol_kvm_deploy + POST_BUILD + COMMENT "See results on http://cdash.inria.fr/CDash/index.php?project=Simgrid" + ) + + IF(HAVE_RSYNC) + + MACRO(PIPOL_TARGET + SYSTEM_PATTERN) + STRING(REPLACE ".dd.gz" "" SYSTEM_TARGET ${SYSTEM_PATTERN}) + + ADD_CUSTOM_TARGET( + ${SYSTEM_TARGET} + COMMENT "PIPOL Build : ${SYSTEM_PATTERN}" + COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub . + COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC + \"sudo mkdir -p \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + sudo chown ${pipol_user} \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + cd \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \; + cmake -Denable_print_message=on -Denable_tracing=on -Denable_model-checking=on ${CMAKE_HOME_DIRECTORY} \; + make clean \; + make \; + make check \" + ) + ADD_CUSTOM_TARGET( + ${SYSTEM_TARGET}_experimental + COMMENT "PIPOL Build : ${SYSTEM_PATTERN}_experimental" + COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub . + COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC + \"sudo mkdir -p \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + sudo chown ${pipol_user} \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + cd \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \; + cmake -Denable_tracing=on -Denable_model-checking=on ${CMAKE_HOME_DIRECTORY} \; + ctest -D Experimental \" + ) + + STRING(REGEX MATCH "kvm" make_test "${SYSTEM_TARGET}") + if(make_test) + STRING(REGEX MATCH "windows" make_test "${SYSTEM_TARGET}") + if(NOT make_test) + ADD_CUSTOM_COMMAND(TARGET pipol_kvm_deploy + COMMENT "PIPOL Build : ${SYSTEM_PATTERN}" + COMMAND rsync ${pipol_user}@pipol.inria.fr:/usr/local/bin/pipol-sub . + COMMAND ./pipol-sub --pipol-user=${pipol_user} ${SYSTEM_PATTERN} 02:00 --verbose=1 --export=${CMAKE_HOME_DIRECTORY} --rsynco=-aC + \"sudo mkdir -p \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + sudo chown ${pipol_user} \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + cd \\\$$PIPOL_WDIR/${pipol_user}/${PROJECT_NAME} \; + sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \; + cmake -Denable_tracing=on -Denable_model-checking=on ${CMAKE_HOME_DIRECTORY} \; + ctest -D Experimental \" + ) + endif(NOT make_test) + endif(make_test) + + ADD_CUSTOM_COMMAND(TARGET ${SYSTEM_TARGET}_experimental + POST_BUILD + COMMENT "See results on http://cdash.inria.fr/CDash/index.php?project=Simgrid" + ) + + ADD_CUSTOM_COMMAND(TARGET pipol_test_list_images + COMMAND echo ${SYSTEM_TARGET} + ) + ADD_CUSTOM_COMMAND(TARGET pipol_experimental_list_images + COMMAND echo "${SYSTEM_TARGET}_experimental" + ) + ENDMACRO(PIPOL_TARGET) + + ENDIF(HAVE_RSYNC) + +# add a target for each pipol system +IF(PIPOL_SYSTEMS) + MESSAGE(STATUS "Adding Pipol targets") + FOREACH(SYSTEM ${PIPOL_SYSTEMS}) + PIPOL_TARGET(${SYSTEM}) + ENDFOREACH(SYSTEM ${PIPOL_SYSTEMS}) +ENDIF(PIPOL_SYSTEMS) + +ENDIF(pipol_user) \ No newline at end of file diff --git a/buildtools/Cmake/PrintArgs.cmake b/buildtools/Cmake/PrintArgs.cmake index b7e9f03170..81acba73cd 100644 --- a/buildtools/Cmake/PrintArgs.cmake +++ b/buildtools/Cmake/PrintArgs.cmake @@ -132,6 +132,11 @@ if(enable_print_message) message("") message("libcgraph : ${HAVE_CGRAPH_LIB}") message("cgraph.h : ${HAVE_CGRAPH_H}") + if(pipol_user) + message("") + message("ssh: ${HAVE_SSH}") + message("rsync: ${HAVE_RSYNC}") + endif(pipol_user) message("________________________________________________________________________________") message("________________________________________________________________________________ DEBUG END") message("") @@ -174,4 +179,6 @@ message(" INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") exec_program("${CMAKE_COMMAND} -E make_directory ${simgrid_BINARY_DIR}/Testing/Notes/" OUTPUT_VARIABLE OKIDOKI) file(WRITE ${simgrid_BINARY_DIR}/Testing/Notes/Build "SVN version : ${SVN_VERSION}\n") file(APPEND ${simgrid_BINARY_DIR}/Testing/Notes/Build "Release : simgrid-${release_version}\n") +file(APPEND ${simgrid_BINARY_DIR}/Testing/Notes/Build "Pipol user : $ENV{PIPOL_USER}\n") +file(APPEND ${simgrid_BINARY_DIR}/Testing/Notes/Build "Pipol image : $ENV{PIPOL_IMAGE}\n") diff --git a/buildtools/pipol/liste_install.sh b/buildtools/pipol/liste_install.sh index 90daa775bf..83e2edb956 100644 --- a/buildtools/pipol/liste_install.sh +++ b/buildtools/pipol/liste_install.sh @@ -2,166 +2,55 @@ arch=`uname` -if [ -e /usr/bin/yum ] ; then - sudo yum -y update -fi - -which_svn=`which svn` #svn necessary -echo $which_svn -if [ x$which_svn = x ] ; then - echo "Try to install svn" - if [ -e /usr/bin/apt-get ] ; then +if [ -e /usr/bin/apt-get ] ; then sudo apt-get -y install subversion - fi - if [ -e /usr/bin/yum ] ; then - sudo yum -y install subversion - fi - if [ x$arch = xDarwin ] ; then - sudo fink -y install svn - fi + sudo apt-get -y install gcc + sudo apt-get -y install g++ + sudo apt-get -y install make + sudo apt-get -y install openjdk-6-jdk + sudo apt-get -y install lua5.1 liblua5.1-dev + sudo apt-get -y install ruby1.8-dev ruby + sudo apt-get -y install unzip + sudo apt-get -y install cmake fi -which_gcc=`which gcc` #gcc gcc necessary -which_gpp=`which g++` #gcc g++ necessary -echo $which_gcc -echo $which_gpp -if [ x$which_gcc = x ] ; then - echo "Try to install gcc" - if [ -e /usr/bin/apt-get ] ; then - sudo apt-get -y install gcc g++ - fi - if [ -e /usr/bin/yum ] ; then +if [ -e /usr/bin/yum ] ; then + sudo yum -y install subversion sudo yum -y install gcc - fi - if [ x$arch = xDarwin ] ; then - sudo fink -y install gcc42 - fi -fi - -which_make=`which make` #make necessary -echo $which_make -if [ x$which_make = x ] ; then - echo "Try to install make" - if [ -e /usr/bin/apt-get ] ; then - sudo apt-get -y install make - fi - if [ -e /usr/bin/yum ] ; then sudo yum -y install make - fi - if [ x$arch = xDarwin ] ; then - sudo fink -y install make - fi -fi - -which_java=`which java` #java optional -echo $which_java -if [ x$which_java = x ] ; then - echo "Try to install java" - if [ -e /usr/bin/apt-get ] ; then - sudo apt-get -y install openjdk-6-jdk - fi - if [ -e /usr/bin/yum ] ; then sudo yum -y install java-1.6.0-openjdk - fi - if [ x$arch = xDarwin ] ; then - sudo fink -y install java-1.6.0-openjdk - fi -fi - -if [ x$arch = xDarwin ] ; then - which_lua=`which lua` #lua -else - which_lua=`which lua` #lua -fi - -echo $which_lua -if [ x$which_lua = x ] ; then - echo "Try to install lua" - if [ -e /usr/bin/apt-get ] ; then - sudo apt-get -y install lua5.1 liblua5.1-dev - fi - if [ -e /usr/bin/yum ] ; then sudo yum -y install lua-devel - fi - if [ x$arch = xDarwin ] ; then - sudo fink -y install lua51-dev lua51 - fi + sudo yum -y install ruby-devel ruby + sudo yum -y install unzip + sudo yum -y install cmake fi if [ x$arch = xDarwin ] ; then - which_ruby=`which ruby` #lua -else - which_ruby=`which ruby` #lua -fi - -echo $which_ruby -if [ x$which_ruby = x ] ; then - echo "Try to install ruby" - if [ -e /usr/bin/apt-get ] ; then - sudo apt-get -y install ruby1.8-dev ruby - fi - if [ -e /usr/bin/yum ] ; then - sudo yum -y install ruby-devel ruby - fi - if [ x$arch = xDarwin ] ; then + sudo fink -y install svn + sudo fink -y install gcc42 + sudo fink -y install make + sudo fink -y install java-1.6.0-openjdk + sudo fink -y install lua51-dev lua51 sudo fink -y install ruby18-dev ruby - fi -fi - - which_unzip=`which unzip` #unzip for gtnets - -echo $which_unzip -if [ x$which_unzip = x ] ; then - echo "Try to install unzip" - if [ -e /usr/bin/apt-get ] ; then - sudo apt-get -y install unzip - fi - if [ -e /usr/bin/yum ] ; then - sudo yum -y install unzip - fi - if [ x$arch = xDarwin ] ; then sudo fink -y install unzip - fi + sudo fink -y install cmake fi +which_svn=`which svn` #svn necessary +which_gcc=`which gcc` #gcc gcc necessary +which_gpp=`which g++` #gcc g++ necessary +which_make=`which make` #make necessary +which_java=`which java` #java optional +which_lua=`which lua` #lua +which_ruby=`which ruby` #ruby which_cmake=`which cmake` #cmake necessary +which_unzip=`which unzip` #unzip for gtnets echo $which_cmake -if [ x$which_cmake = x ] ; then - echo "Try to install cmake" - if [ -e /usr/bin/apt-get ] ; then - sudo apt-get -y remove cmake - sudo apt-get -y install cmake - fi - if [ -e /usr/bin/yum ] ; then - sudo yum -y install cmake - fi - if [ x$arch = xDarwin ] ; then - sudo fink -y install cmake - fi -fi - -which_cmake_version=`cmake --version` -which_cpack_version=`cpack --version` -which_ctest_version=`ctest --version` -echo "current version of cmake : $which_cmake_version" -echo "current version of cpack : $which_cpack_version" -echo "current version of ctest : $which_ctest_version" -if [ "x$which_cmake_version" != "xcmake version 2.8.1" ] ; then - which_cmake=`which cmake` - which_cpack=`which cpack` - which_ctest=`which ctest` - cp -rf ~/cmake-2.8.1/ ./ - cd ./cmake-2.8.1/ - cmake . > /dev/null - make -j > /dev/null 2>&1 - sudo ln -sf `pwd`/bin/cmake $which_cmake - sudo ln -sf `pwd`/bin/cpack $which_cpack - sudo ln -sf `pwd`/bin/ctest $which_ctest - which_cmake_version=`cmake --version` - which_cpack_version=`cpack --version` - which_ctest_version=`ctest --version` - echo "new version of cmake : $which_cmake_version" - echo "new version of cpack : $which_cpack_version" - echo "new version of ctest : $which_ctest_version" - cd .. -fi +echo $which_unzip +echo $which_ruby +echo $which_lua +echo $which_java +echo $which_make +echo $which_gcc +echo $which_gpp +echo $which_svn \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d6db69dd5d..876654bf87 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 2.6) -#set(EXECUTABLE_OUTPUT_PATH "${PROJECT_DIRECTORY}/src/") +set(EXECUTABLE_OUTPUT_PATH "${PROJECT_DIRECTORY}/src/") + set(USE_TEST_UNITS ${TEST_UNITS} ${PROJECT_DIRECTORY}/src/simgrid_units_main.c -- 2.20.1