-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakeZiltoidLIB.sh
executable file
·140 lines (111 loc) · 3.14 KB
/
makeZiltoidLIB.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
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
#================================================================
echo " "
echo "BUILDING ZILTOIDLIB"
do_debug=0
CC=gcc
debug_arg="" #default
includeZiltoidLapack=0 # default
for i in `seq 1 $#`
do
if [ "${@:$i:1}" == "--includeZiltoidLAPACK" ]; then
includeZiltoidLapack=1
elif [ "${@:$i:1}" == "--include-lapack" ]; then
includeZiltoidLapack=1
elif [ "${@:$i:1}" == "--debug" ]; then
do_debug=1
debug_arg="-g"
echo "Debugging mode."
elif [ "${@:$i:1}" == "--g++" ]; then
CC=g++
echo "Use g++ compiler."
elif [ "${@:$i:1}" == "--gcc" ]; then
CC=gcc
echo "Use gcc compiler."
fi
done
if [ $includeZiltoidLapack -eq 1 ]; then
echo "LAPACK-dependent functions: included"
else
echo "LAPACK-dependent functions: excluded - to include, run $0 --include-lapack"
fi
echo " "
#================================================================
script=$(readlink -f $0)
scriptpath=`dirname $script`
pushd $scriptpath >/dev/null
rm build -rf
mkdir -p build
pushd build >/dev/null
pushd ../LatticeLIB >/dev/null
./makeLatticeLIB.sh $debug_arg --$CC
popd >/dev/null # BACK TO ZILTOID/BUILD
echo " "
pushd ../Mathematics >/dev/null
./makeZiltoidMathLib.sh $debug_arg --$CC
popd >/dev/null # BACK TO ZILTOID/BUILD
echo " "
pushd ../NumericalMethods >/dev/null
./makeZiltoidNumLib.sh $debug_arg --$CC
popd >/dev/null # BACK TO ZILTOID/BUILD
echo " "
pushd ../StringOperations >/dev/null
./makeZiltoidStringsLib.sh $debug_arg --$CC
popd >/dev/null # BACK TO ZILTOID/BUILD
echo " "
pushd ../ReadTextFiles >/dev/null
./makeZiltoidReadLib.sh $debug_arg --$CC
popd >/dev/null # BACK TO ZILTOID/BUILD
echo " "
pushd ../kMC >/dev/null
./makeZiltoidKMC.sh $debug_arg
popd >/dev/null # BACK TO ZILTOID/BUILD
echo " "
pushd ../Memory >/dev/null
./makeZiltoidMemory.sh $debug_arg
popd >/dev/null # BACK TO ZILTOID/BUILD
echo " "
if [ $includeZiltoidLapack -eq 1 ]
then
echo " "
echo "COMPILING ZILTOIDLAPACK"
pushd ../Mathematics/LinearAlgebra/lapack >/dev/null
${CC} -fPIC -c eigenproblem.c
popd >/dev/null
cp ../Mathematics/LinearAlgebra/lapack/eigenproblem.o lapack_eigenproblem.o
echo " lapack_eigenproblem.o compiled"
echo "FINISHED COMPILING ZILTOIDLAPACK"
echo " "
fi
echo " Extracting modules in build:"
ar x ../kMC/build/libZiltoidKMC.a
ar x ../LatticeLIB/build/libLatticeLIB.a
ar x ../Mathematics/build/libZiltoidMath.a
ar x ../Memory/build/libZiltoidMemory.a
ar x ../NumericalMethods/build/libZiltoidNum.a
ar x ../StringOperations/build/libZiltoidStrings.a
ar x ../ReadTextFiles/build/libZiltoidRead.a
for file in `find *.o`
do
echo " "$file
done
ar rcs libZiltoidLIB.a *.o
popd >/dev/null # BACK TO ZILTOID
cp build/libZiltoidLIB.a .
echo " libZiltoidLIB.a created"
echo " "
pushd Applications >/dev/null
./makeZiltoidApps.sh $debug_arg --$CC
popd >/dev/null # BACK TO ZILTOID
echo " "
echo " adding applications to libZiltoidLIB.a"
pushd build >/dev/null
ar x ../Applications/bin/libZiltoidApps.a
ar rcs libZiltoidLIB.a *.o
popd >/dev/null # BACK TO ZILTOID
cp build/libZiltoidLIB.a .
echo " libZiltoidLIB.a created"
echo " "
popd >/dev/null
echo "FINISHED BUILDING ZILTOIDLIB"
echo " "