-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_GreatSPN.sh
executable file
·124 lines (99 loc) · 2.62 KB
/
build_GreatSPN.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
#! /bin/bash
set -x
# an IDIR = install folder
if [ ! -d usr/local ];
then
mkdir usr
cd usr
mkdir local
cd ..
fi
export IDIR=$(pwd)/usr/local
export PATH=$IDIR/bin:$PATH
if [ ! -d GreatSPN ];
then
mkdir GreatSPN
fi
cd GreatSPN
if [ ! -f $IDIR/lib/libgmp.a ];
then
wget --progress=dot:mega ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2 ;
tar xjf gmp-6.1.2.tar.bz2 ;
cd gmp-6.1.2 ;
./configure --enable-cxx --prefix=$IDIR/ ;
make -j ; make install ;
cd .. ;
fi
if [ ! -f $IDIR/include/meddly.h ];
then
git clone --depth 1 https://github.com/asminer/meddly.git --branch master --single-branch meddly
cd meddly
./autogen.sh
./configure --prefix=$IDIR/ || cat config.log
make && make install
cd ..
fi
if [ ! -f $IDIR/include/lp_lib.h ];
then
tar xzf ../lp_solve_5.5.2.5_source.tar.gz
cd lp_solve_5.5/lpsolve55
autoreconf -vfi
cat ccc | sed 's/c=cc/c=$CC/g' > ccc2
sh ccc2
mkdir -p $IDIR/lib ; cp bin/ux64/liblpsolve55.* $IDIR/lib/
cd ..
mkdir -p $IDIR/include/ ; cp *.h $IDIR/include/
cd ..
fi
if [ ! -f $IDIR/bin/byacc ];
then
wget --progress=dot:mega https://invisible-island.net/datafiles/release/byacc.tar.gz
tar xzf byacc.tar.gz
rm -f byacc.tar.gz
cd byacc*
./configure --prefix=$IDIR/
make
make install
cp $IDIR/bin/yacc $IDIR/bin/byacc
cd ..
fi
if [ ! -f $IDIR/include/FlexLexer.h ];
then
wget --progress=dot:mega https://github.com/westes/flex/files/981163/flex-2.6.4.tar.gz
tar xzf flex*.tar.gz
rm -f flex*.tar.gz
cd flex*
./configure --prefix=$IDIR/
make
make install
cd ..
fi
git clone --depth 1 https://github.com/yanntm/SOURCES.git --branch master --single-branch SOURCES/
cd SOURCES
# cp -f ../../patches/Makefile .
# hack to avoid regenerating these files, touch order *is* important
touch WN/TRANSL/*.y
cd objects
find . -exec touch {} \;
cd ..
export CFLAGS="-O2 -Wall -Wno-unused-variable -Wno-unused-function -I$IDIR/include"
export CPPFLAGS="-O2 -Wall -Wno-unused-variable -Wno-unused-function -I$IDIR/include"
export LDFLAGS="-O2 -L$IDIR/lib"
export BYACCDIR=$IDIR/bin/
echo "C compiler : $CC C++ compiler : $CXX"
# MinGW : add flags to link SIM branch : WNSIM, WNSYMB
if [ -d /c/ ];
then
cat Makefile | sed 's/WNSIM_LDFLAGS:= -lm/WNSIM_LDFLAGS:= -lm -lws2_32/g' | sed 's/WNSYMB_LDFLAGS:= -lm/WNSYMB_LDFLAGS:= -lm -lws2_32/g' | sed 's/GSPNSIM_LDFLAGS:= -lm/GSPNSIM_LDFLAGS:= -lm -lws2_32/g' > Makefile2
cp -f Makefile2 Makefile
fi
make
if [ -d /Users ];
then
for i in bin/* ; do strip $i ; done ;
else
for i in bin/* ; do strip -s $i ; done ;
fi
tar czf ../../website/greatspn_linux.tar.gz bin/
ls -lah ../../website
cd ../..