Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Lenny don't have make by default on pipl!!!
[simgrid.git] / buildtools / pipol / install_gtnets.sh
1 SYSTEM=`uname`
2 if [ $SYSTEM = Linux ] ; then
3         if [ x$1 != x ]  ; then
4                 prefix=$1;
5         fi
6         
7         if [ -e $prefix/lib ] ; then
8                 echo -n ""
9         else    
10                 echo "Creating directory $prefix/lib";
11                 mkdir -p $prefix/lib;
12         fi
13         
14         if [ -e $prefix/include/gtnets ] ; then
15                 echo -n "";
16         else    
17                 echo "Creating directory $prefix/include/gtnets";
18                 mkdir -p $prefix/include/gtnets;
19         fi
20         
21         localdir=`pwd`;
22         cd $prefix;
23         prefix=`pwd`;
24         cd $localdir;
25         echo "Install to prefix = $prefix";
26         
27         echo "Downloading GTNetS from SVN SimGrid's repository";
28         svn checkout svn://scm.gforge.inria.fr/svn/simgrid/contrib/trunk/GTNetS/ --quiet
29         cd GTNetS
30         echo "Uncompressing package";
31         unzip gtnets-current.zip > /dev/null
32         tar zxvf gtnets-current-patch.tgz  > /dev/null
33         cd gtnets-current
34         cat ../00*.patch | patch -p1 > /dev/null
35         
36         ARCH_32=`uname -m | cut -d'_' -f2`
37         
38         if [ x$ARCH_32 = x64 ] ; then #only if 64 bit processor family
39         cat ../AMD64-FATAL-Removed-DUL_SIZE_DIFF-Added-fPIC-compillin.patch | patch -p1 > /dev/null
40         fi
41         
42         ln -sf Makefile.linux Makefile
43         echo "Creating dependencies";
44         make -j 3 depend > /dev/null
45         echo "Compiling GTNetS debug libs";
46         make -j 3 debug > /dev/null 2>&1
47         echo "Compiling GTNetS optimal libs";
48         make -j 3 opt > /dev/null 2>&1
49         wait
50         
51         cd ../../
52         
53         echo "Copying files to $prefix/lib";
54         cp -fr ./GTNetS/gtnets-current/*.so $prefix/lib/
55         ln -sf $prefix/lib/libgtsim-opt.so $prefix/lib/libgtnets.so
56         
57         echo "Copying files to $prefix/include/gtnets";
58         cp -fr ./GTNetS/gtnets-current/SRC/*.h $prefix/include/gtnets
59         wait
60         
61         echo "Done with gtnets installation";
62         rm -rf ./GTNetS
63 fi