Repository navigation
Expand file tree
/
Copy pathInstall.sh
More file actions
99 lines (69 loc) · 2.38 KB
/
Copy pathInstall.sh
File metadata and controls
99 lines (69 loc) · 2.38 KB
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
#!/bin/bash
cwd=$(pwd)
build_dir="$cwd/build"
ntljac2_makefile_libs_dir=".."
gmp_archive="$cwd/gmp-4.2.4.tar.gz"
gmp_folder="$build_dir/gmp-4.2.4"
ntl_archive="$cwd/ntl-5.4.tar.gz"
ntl_folder="$build_dir/ntl-5.4"
ntljac2_archive="$cwd/NTLJac2-0.1-1.tgz"
ntljac2_folder="$build_dir/NTLJac2"
ntljac2_patch_folder="$cwd/NTLJac2-0.1-1-patch"
ntljac2_xp_patch_folder="$cwd/NTLJac2-0.1-1-XP-patch"
makefile_patch_find="FLAGS = -O4 -Wall"
makefile_patch_replace="FLAGS = -I$ntljac2_makefile_libs_dir/include -L$ntljac2_makefile_libs_dir/lib -Wl,-R$ntljac2_makefile_libs_dir/lib -O4 -Wall"
if [ ! -f "$gmp_archive" ]; then
echo "Error: '$gmp_archive' does not exist."
exit -4
fi
if [ ! -f "$ntl_archive" ]; then
echo "Error: '$ntl_archive' does not exist."
exit -5
fi
if [ ! -f "$ntljac2_archive" ]; then
echo "Error: '$ntljac2_archive' does not exist."
exit -6
fi
if [ ! -d "$ntljac2_patch_folder" ]; then
echo "Error: '$ntljac2_patch_folder' does not exist."
exit -7
fi
if [ ! -d "$ntljac2_xp_patch_folder" ]; then
echo "Error: '$ntljac2_xp_patch_folder' does not exist."
exit -8
fi
mkdir $build_dir
echo -e "\n############### Extracting GMP ###############"
tar xvzf "$gmp_archive" -C $build_dir
echo -e "\n############### Extracting NTL ###############"
tar xvzf "$ntl_archive" -C $build_dir
echo -e "\n############### Extracting NTLJac2 ###############"
tar xvzf "$ntljac2_archive" -C $build_dir
echo -e "\n############### Patching NTLJac2 To Fix Build Errors ###############"
cp -a $ntljac2_patch_folder/* $ntljac2_folder
echo -e "\n############### Patching NTLJac2 To Add XP Solver ###############"
cp -a $ntljac2_xp_patch_folder/* $ntljac2_folder
echo -e "\n############### Patching Makefile ###############"
sed -i "s|${makefile_patch_find}|${makefile_patch_replace}|" "$ntljac2_folder/Makefile"
echo -e "\n############### Building GMP ###############"
cd $gmp_folder
./configure --prefix=$build_dir --enable-cxx
make
cd $cwd
echo -e "\n############### Installing GMP ###############"
cd $gmp_folder
make install
cd $cwd
echo -e "\n############### Building NTL ###############"
cd $ntl_folder/src
./configure PREFIX=$build_dir GMP_PREFIX=$build_dir
make
cd $cwd
echo -e "\n############### Installing NTL ###############"
cd $ntl_folder/src
make install
cd $cwd
echo -e "\n############### Building NTLJac2 (with XP Solver Patch) ###############"
cd $ntljac2_folder
make
cd $cwd