Logo AND Algorithmique Numérique Distribuée

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