Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Optimisation of pipol.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 22 Jul 2010 13:09:42 +0000 (13:09 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 22 Jul 2010 13:09:42 +0000 (13:09 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8053 48e7efb5-ca39-0410-a469-dd3cf9ba447f

CMakeLists.txt
buildtools/Cmake/Pipol.cmake
buildtools/pipol/cmake.pl [new file with mode: 0644]
buildtools/pipol/liste_install.sh

index 04f6c75..19fb40d 100644 (file)
@@ -9,8 +9,8 @@ set(libgras_version "${release_version}")
 set(libsmpi_version "${release_version}")
 
 ### Find programs and paths
-find_path(GCOV_PATH NAMES gcov PATHS NO_DEFAULT_PATHS)
-find_path(VALGRIND_PATH        NAMES valgrind  PATHS NO_DEFAULT_PATHS)
+FIND_PROGRAM(GCOV_PATH gcov)
+FIND_PROGRAM(VALGRIND_PATH valgrind)
 
 ### SET THE PROJECT_DIRECTORY
 SET(PROJECT_DIRECTORY "${CMAKE_HOME_DIRECTORY}")
index c41cba9..a27458c 100644 (file)
@@ -6,7 +6,7 @@
 # ssh/rsync mandatory 
 IF(pipol_user)
 
-       set(CMAKE_OPTIONS "")
+       set(CMAKE_OPTIONS "     -Wno-dev")
        
        if(custom_flags)
                set(CMAKE_OPTIONS "${CMAKE_OPTIONS}     -Dcustom_flags=${custom_flags}")
@@ -97,6 +97,7 @@ IF(pipol_user)
                                \"sudo chown ${pipol_user} ${CMAKE_HOME_DIRECTORY} \;
                                cd ${CMAKE_HOME_DIRECTORY} \;
                                sh ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/liste_install.sh \;
+                               perl ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/cmake.pl \;
                                cmake -E remove CMakeCache.txt \;
                                cmake ${CMAKE_HOME_DIRECTORY}${CMAKE_OPTIONS} \;
                                make clean \;
diff --git a/buildtools/pipol/cmake.pl b/buildtools/pipol/cmake.pl
new file mode 100644 (file)
index 0000000..d0d62fd
--- /dev/null
@@ -0,0 +1,104 @@
+#!/usr/bin/perl -w
+use strict;
+
+my($my_cmake_version);
+my($cmake);
+my($ctest);
+my($cpack);
+
+$my_cmake_version = `cmake --version`;
+$cmake = `which cmake`;
+$ctest = `which ctest`;
+$cpack = `which cpack`;
+print "$cmake";
+print "$ctest";
+print "$cpack";
+
+chomp $cmake;
+chomp $ctest;
+chomp $cpack;
+
+if ( -f "$cmake" )
+{
+       if($my_cmake_version =~ /.*2.8.[0-9].*$/) 
+       {
+               print "cmake version : $my_cmake_version";
+       }
+       else
+       {
+               if($my_cmake_version =~ /.*2.6.[1-9].*$/) 
+               {
+                       print "version > 2.6.0\n";
+                       system "wget http://www.cmake.org/files/v2.8/cmake-2.8.2.tar.gz";
+                       system "tar zxvf cmake-2.8.2.tar.gz";
+                       chdir("./cmake-2.8.2");
+                       system "cmake .";
+                       system "make";
+                       if (-f "./bin/cmake"){
+                               system "sudo ln -sf `pwd`/bin/cmake $cmake";
+                               system "sudo ln -sf `pwd`/bin/cpack $cpack";
+                               system "sudo ln -sf `pwd`/bin/ctest $ctest";
+                       }
+                       else
+                       {
+                               return;
+                       }
+       
+               }
+               else
+               {
+                       print "version < 2.6.1\n";
+                       system "wget http://www.cmake.org/files/v2.6/cmake-2.6.4.tar.gz";
+                       system "wget http://www.cmake.org/files/v2.8/cmake-2.8.2.tar.gz";
+       
+                       system "tar zxvf cmake-2.6.4.tar.gz";
+                       chdir("./cmake-2.6.4/");
+                       system "cmake .";
+                       system "make";
+                       if (-f "./bin/cmake"){
+                               system "sudo ln -sf `pwd`/bin/cmake $cmake";
+                               system "sudo ln -sf `pwd`/bin/cpack $cpack";
+                               system "sudo ln -sf `pwd`/bin/ctest $ctest";
+                       }
+                       else
+                       {
+                               return;
+                       }
+                       chdir("./..");
+       
+                       $my_cmake_version = `cmake --version`;
+                       print "cmake version : $my_cmake_version";
+                       $cmake = `which cmake`;
+                       $ctest = `which ctest`;
+                       $cpack = `which cpack`;
+                       print "$cmake";
+                       print "$ctest";
+                       print "$cpack";
+                       chomp $cmake;
+                       chomp $ctest;
+                       chomp $cpack;
+       
+                       system "tar zxvf cmake-2.8.2.tar.gz";
+                       chdir("./cmake-2.8.2/");
+                       system "cmake .";
+                       system "make";
+                       if (-f "./bin/cmake"){
+                               system "sudo ln -sf `pwd`/bin/cmake $cmake";
+                               system "sudo ln -sf `pwd`/bin/cpack $cpack";
+                               system "sudo ln -sf `pwd`/bin/ctest $ctest";
+                       }
+                       else
+                       {
+                               return;
+                       }
+               }
+       $my_cmake_version = `cmake --version`;
+       print "cmake version : $my_cmake_version";
+       $cmake = `which cmake`;
+       $ctest = `which ctest`;
+       $cpack = `which cpack`;
+       print "$cmake";
+       print "$ctest";
+       print "$cpack";
+       }
+}
\ No newline at end of file
index 38fbde3..9af267b 100644 (file)
@@ -11,9 +11,10 @@ if [ -e /usr/bin/apt-get ] ; then
     sudo apt-get -y install liblua5.1-dev lua5.1
     sudo apt-get -y install ruby1.8-dev ruby
     sudo apt-get -y install unzip
-    sudo apt-get -y remove cmake
     sudo apt-get -y install cmake
     sudo apt-get -y install wget
+    sudo apt-get -y install perl
+    sudo apt-get -y install graphviz-dev graphviz
 fi
 
 if [ -e /usr/bin/yum ] ; then
@@ -25,9 +26,10 @@ if [ -e /usr/bin/yum ] ; then
     sudo yum -y install lua-devel lua
     sudo yum -y install ruby-devel ruby
     sudo yum -y install unzip
-    sudo yum -y remove cmake
     sudo yum -y install cmake
     sudo yum -y install wget
+    sudo yum -y install perl
+    sudo yum -y install graphviz-dev graphviz
 fi
 
 if [ x$arch = xDarwin ] ; then
@@ -38,9 +40,10 @@ if [ x$arch = xDarwin ] ; then
     sudo fink -y install lua51-dev lua51
     sudo fink -y install ruby18-dev ruby
     sudo fink -y install unzip
-    sudo fink -y remove cmake
     sudo fink -y install cmake
     sudo fink -y install wget
+    sudo fink -y install perl
+    sudo fink -y install graphviz-dev graphviz
 fi
 
 which_svn=`which svn`          #svn necessary
@@ -53,6 +56,7 @@ which_ruby=`which ruby`               #ruby
 which_cmake=`which cmake`      #cmake necessary
 which_unzip=`which unzip`      #unzip for gtnets
 which_wget=`which wget`                #wget for cmake
+which_dot=`which dot`          #dot for cgraph
 echo $which_cmake
 echo $which_unzip
 echo $which_ruby
@@ -62,36 +66,5 @@ echo $which_make
 echo $which_gcc
 echo $which_gpp
 echo $which_svn
-
-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.0" ] ; then
-       if [ "x$which_cmake_version" != "xcmake version 2.8.1" ] ; then
-               if [ "x$which_cmake_version" != "xcmake version 2.8.2" ] ; then
-                       which_cmake=`which cmake`
-                       which_cpack=`which cpack`
-                       which_ctest=`which ctest`
-                       wget http://www.cmake.org/files/v2.8/cmake-2.8.2.tar.gz
-                       if [ -e ./cmake-2.8.2.tar.gz ] ; then
-                               tar zxvf cmake-2.8.2.tar.gz
-                               cd ./cmake-2.8.2/
-                               cmake .
-                               make -j
-                               sudo ln -sf `pwd`/bin/cmake $which_cmake
-                               sudo ln -sf `pwd`/bin/cpack $which_cpack
-                               sudo ln -sf `pwd`/bin/ctest $which_ctest
-                       fi
-                       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
-       fi
-fi
\ No newline at end of file
+echo $which_dot
+echo $which_wget
\ No newline at end of file