This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
forked from FairRootGroup/FairSoft
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinstall_pluto.sh
124 lines (109 loc) · 3.28 KB
/
install_pluto.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
if [ ! -d $SIMPATH/generators/pluto ];
then
cd $SIMPATH/generators
if [ ! -e $PLUTOVERSION.tar.gz ];
then
echo "*** Downloading pluto sources ***"
download_file $PLUTO_LOCATION/$PLUTOVERSION.tar.gz
fi
untar pluto $PLUTOVERSION.tar.gz
if [ -d $PLUTOVERSION ];
then
ln -s $PLUTOVERSION pluto
fi
fi
if [ "$check" = "1" ];
then
# special settings to compile pluto with gcc 4.0.X
export FRIENDFLAG=""
if [ "$compiler" = "gcc" ];
then
GCC_MAJOR=$(gcc -dumpversion | cut -c 1)
GCC_MINOR=$(gcc -dumpversion | cut -c 3)
if [ "$GCC_MAJOR" = "4" ];
then
if [ "$GCC_MINOR" != "0" ];
then
export FRIENDFLAG="-ffriend-injection"
fi
fi
fi
install_prefix=$SIMPATH_INSTALL
checkfile=$install_prefix/lib/libPluto.so
cd $SIMPATH/generators
if (not_there pluto $checkfile);
then
cd pluto
case $PLUTOVERSION in
*412*) echo Compiling Old Pluto Version
mypatch ../pluto_v412.patch | tee -a $logfile
;;
*5.33*) echo Compiling v5.33 Pluto Version
cp ../Makefile_pluto5 Makefile
cp ../newline.awk .
mypatch ../pluto_v533.patch | tee -a $logfile
;;
*5.36*) echo Compiling v5.36 Pluto Version
cp Makefile.fairsoft Makefile
;;
*5.37*) echo Compiling v5.37 Pluto Version
cp Makefile.fairsoft Makefile
mypatch ../pluto_v537.patch | tee -a $logfile
# needed to compile with Apple LLVM 5.1, shouldn't hurt on other systems
mypatch ../pluto_friend.patch | tee -a $logfile
mypatch ../pluto_v537_root6.patch | tee -a $logfile
;;
*5.4*) echo Compiling v5.4x Pluto Version
cp Makefile.fairsoft Makefile
;;
*CVS*) echo Compiling CVS Pluto Version
cp Makefile.fairsoft Makefile
;;
esac
if [ "$compiler" = "intel" ];
then
mysed 'g++' 'icpc' Makefile
fi
if [ "$compiler" = "Clang" ];
then
mysed 'g++' 'clang++' Makefile
mysed '-rdynamic' '' Makefile
fi
mysed "CXXFLAGS = -Wall" "CXXFLAGS = -Wall ${CXXFLAGS}" Makefile
mysed "SOFLAGS =" "SOFLAGS = ${CXXFLAGS}" Makefile
if [ "$platform" = "macosx" ];
then
mysed '-g -shared -Wl,-soname,$@' ' -dynamiclib -flat_namespace -single_module -undefined dynamic_lookup' Makefile
mysed 'LIBSO = libPluto.so' 'LIBSO = libPluto.dylib' Makefile
fi
if [ "$system" = "64bit" ];
then
mysed 'SOFLAGS =' 'SOFLAGS = -m64' Makefile
mysed 'CXXFLAGS = -Wall' 'CXXFLAGS = -Wall -m64' Makefile
fi
make
# fake make install
mkdir -p $install_prefix/lib
cp libPluto.a $install_prefix/lib
if [ -f lib/PlutoCint_rdict.pcm ]; then
cp lib/PlutoCint_rdict.pcm $install_prefix/lib
fi
mkdir -p $install_prefix/include/pluto
cp src/*.h $install_prefix/include/pluto
find plugins -name "*.h" -exec cp "{}" $install_prefix/include/pluto ";"
if [ "$platform" = "macosx" ];
then
cp libPluto.dylib $install_prefix/lib
cd $install_prefix/lib
create_links dylib so
else
cp libPluto.so $install_prefix/lib
fi
check_all_libraries $install_prefix/lib
check_success Pluto $checkfile
check=$?
fi
fi
cd $SIMPATH
return 1