-
Notifications
You must be signed in to change notification settings - Fork 125
/
install.sh
executable file
·117 lines (107 loc) · 3.26 KB
/
install.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
#!/bin/bash
buildlibrary ()
{
cd $lib_build
echo "Installing $1"
tar -zxf $lib_src/$1.tar.gz
cd $1
case $1 in
"tbb22_20090809oss")
make;
for i in `find build -name "lib*"`; do cp $i $prefix_dir/lib/; done;
cp -r include/tbb $prefix_dir/include/;
return
;;
"boostinclude")
mv boost $prefix_dir/include/;
return
;;
"mcpp-2.7.2")
./configure CFLAGS=-fPIC --enable-mcpplib --disable-shared --prefix=$prefix_dir
;;
"bzip2-1.0.5")
make
make install PREFIX=$prefix_dir
return
;;
"Ice-3.4.1")
cd cpp;
make
make install
return
;;
*)
./configure --prefix=$prefix_dir $2
;;
esac
make
#make -s check
make install
}
# create local directories
rm -fr build
rm -fr lib
rm -fr man
rm -fr include
rm -fr bin
mkdir build
mkdir lib
mkdir bin
mkdir man
mkdir include
# set paths
prefix_dir=`pwd`
lib_src=$prefix_dir/dependencies
lib_build=$prefix_dir/build
lib_opts=''
#fetch the 3rd party libraries
rm ${lib_src}/*
wget -r --no-check-certificate https://github.com/shravanmn/LDA_ICE/raw/master/Ice-3.4.1.tar.gz -nd -P ${lib_src}
wget -r --no-check-certificate https://github.com/shravanmn/LDA_Dependencies/raw/master/boostinclude.tar.gz -nd -P ${lib_src}
wget -r --no-check-certificate https://github.com/shravanmn/LDA_Dependencies/raw/master/bzip2-1.0.5.tar.gz -nd -P ${lib_src}
wget -r --no-check-certificate https://github.com/shravanmn/LDA_Dependencies/raw/master/cppunit-1.12.1.tar.gz -nd -P ${lib_src}
wget -r --no-check-certificate https://github.com/shravanmn/LDA_Dependencies/raw/master/gflags-1.2.tar.gz -nd -P ${lib_src}
wget -r --no-check-certificate https://github.com/shravanmn/LDA_Dependencies/raw/master/glog-0.3.0.tar.gz -nd -P ${lib_src}
wget -r --no-check-certificate https://github.com/shravanmn/LDA_Dependencies/raw/master/mcpp-2.7.2.tar.gz -nd -P ${lib_src}
wget -r --no-check-certificate https://github.com/shravanmn/LDA_Dependencies/raw/master/protobuf-2.2.0a.tar.gz -nd -P ${lib_src}
wget -r --no-check-certificate https://github.com/shravanmn/LDA_Dependencies/raw/master/tbb22_20090809oss.tar.gz -nd -P ${lib_src}
mkdir /tmp/gflags # fix a known build bug on OS X
buildlibrary gflags-1.2
rm -fr /tmp/gflags # gflags wants to have /tmp/gflags but nobody else wants it ...
buildlibrary glog-0.3.0 --with-gflags=$prefix_dir
buildlibrary protobuf-2.2.0a
buildlibrary cppunit-1.12.1
buildlibrary tbb22_20090809oss
buildlibrary boostinclude
buildlibrary bzip2-1.0.5
buildlibrary mcpp-2.7.2
UNAME=`uname`
MACHINE_TYPE=`uname -m`
if [ $UNAME == "Linux" ];
then
lib_dir=
if [ $MACHINE_TYPE == "x86_64" ];
then
lib_dir=lib64
mv $prefix_dir/lib $prefix_dir/lib64
buildlibrary Ice-3.4.1
mv $prefix_dir/lib64 $prefix_dir/lib
else
lib_dir=lib
buildlibrary Ice-3.4.1
fi;
if [ -d /usr/include/nptl ];
then
cp -r /usr/include/nptl/* $prefix_dir/include
cp -r /usr/${lib_dir}/nptl/* $prefix_dir/lib
fi;
fi;
cd $prefix_dir
#rm -fr $prefix_dir/build;
cp $prefix_dir/create_obj_file_targets.sh bin/
cp $prefix_dir/create_dep_file_targets.sh bin/
cp $prefix_dir/create_dir_file_targets.sh bin/
mkdir -p ut_out;
mkdir -p ut_test;
head -900 test/ydir_1k.txt >ut_out/ydir_1k.txt;
tail -100 test/ydir_1k.txt >ut_test/ydir_1k.tst.txt;