-
Notifications
You must be signed in to change notification settings - Fork 10
/
.install_cutest.sh
executable file
·314 lines (296 loc) · 17.6 KB
/
.install_cutest.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
#!/bin/bash
# CUTEst installer specialised for Linux CI
# set DRYRUN to 1 to test install scripts without actually installing
DRYRUN=0
#DRYRUN=1
# report build schedule
echo -e '\nBuild schedule:'
echo ' - SIFDecode from'
echo " $SIFDECODE"
echo ' - CUTEst from'
echo " - $CUTEST"
echo
# set top-level directory
topdir=$PWD
# set architecture/compiler
VERSION="pc64.lnx.gfo"
source $ARCHDEFS/system.lnx
source $ARCHDEFS/ccompiler.pc64.lnx.gcc
source $ARCHDEFS/compiler.$VERSION
echo " Version for architecture $VERSION will be installed"
echo ""
# install sifdecode
echo ' Installing SIFDecode ...'
cd $SIFDECODE
# ensure that objects and modules directories exist
if [[ ! -e $SIFDECODE/objects ]]; then
$MKDIR $SIFDECODE/objects
fi
if [[ ! -e $SIFDECODE/modules ]]; then
$MKDIR $SIFDECODE/modules
fi
# create architecture-dependent object and module directories
OBJDIR=$SIFDECODE/objects/$VERSION
MODDIR=$SIFDECODE/modules/$VERSION
echo "$MACHINE ($OPSYS) $COMPUSED" > $SIFDECODE/versions/$VERSION
if [[ ! -e $OBJDIR ]]; then
$MKDIR $OBJDIR
fi
if [[ ! -e $MODDIR ]]; then
$MKDIR $MODDIR
fi
# write out the sifdecode/bin/sys file for this architecture
SYSFILE=$SIFDECODE/bin/sys/$VERSION
echo 'RM="'$RM'"' > $SYSFILE
echo 'MAKE="'$MAKE'"' >> $SYSFILE
echo 'CAT="'$CAT'"' >> $SYSFILE
echo 'SED="'$SED'"' >> $SYSFILE
echo 'MV="'$MV'"' >> $SYSFILE
echo 'LS="'$LS'"' >> $SYSFILE
echo 'LN="'$LN'"' >> $SYSFILE
echo 'GREP="'$GREP'"' >> $SYSFILE
echo 'AWK="'$AWK'"' >> $SYSFILE
echo 'HEAD="'HEAD'"' >> $SYSFILE
echo 'TAIL="'$TAIL'"' >> $SYSFILE
echo 'FORTRAN="'$FORTRAN'"' >> $SYSFILE
MOD='$SIFDECODE/modules/'$VERSION
FFLAGS="$LIBCMD"' '`eval echo $MODCMD`' '"$F90"
echo 'FFLAGS="'$FFLAGS' '$OPENMP'"' >> $SYSFILE
echo 'PROBFLAGS="'$FFLAGS' '$BASIC' '$OPTIMIZATION' '$F77' "' >> $SYSFILE
echo 'BLAS="'$BLAS'"' >> $SYSFILE
echo 'LAPACK="'$LAPACK'"' >> $SYSFILE
# write out the sifdecode/makefile/ file for this architecture
MAKEFILE=$SIFDECODE/makefiles/$VERSION
echo ' ' > $MAKEFILE
echo '# Architecture dependent makefile' >> $MAKEFILE
echo '# (automatically generated by install_sifdecode)' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'VERSION = '$VERSION >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Basic system commands' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'CP = '$CP >> $MAKEFILE
echo 'MV = '$MV >> $MAKEFILE
echo 'RM = '$RM >> $MAKEFILE
echo 'SED = '$SED >> $MAKEFILE
echo 'GREP = '$GREP >> $MAKEFILE
echo 'AR = '$AR >> $MAKEFILE
echo 'ARREPFLAGS = '$ARREPFLAGS >> $MAKEFILE
echo 'RANLIB = '$RANLIB >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Directory for binaries' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'PRECIS = double' >> $MAKEFILE
echo 'OBJ = $(SIFDECODE)/objects/$(VERSION)' >> $MAKEFILE
echo 'MOD = $(SIFDECODE)/modules/$(VERSION)' >> $MAKEFILE
echo 'MVMODS = '"$MVMODS" >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Compiler options' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'FORTRAN = '$FORTRAN >> $MAKEFILE
echo 'BASIC = '$BASIC >> $MAKEFILE
MODTMP="$LIBCMD"' '`echo $MODCMD | $SED 's/MOD/(MOD)/g'`
echo 'MODULES = '$MODTMP >> $MAKEFILE
echo 'OPTIMIZATION = '$OPTIMIZATION >> $MAKEFILE
echo 'NOOPTIMIZATION = '$NOOPTIMIZATION >> $MAKEFILE
echo 'DEBUG = '$DEBUG >> $MAKEFILE
echo 'OPENMP = '$OPENMP >> $MAKEFILE
echo 'F77 = '$F77 >> $MAKEFILE
echo 'F90 = '$F90 >> $MAKEFILE
echo 'F95 = '$F95 >> $MAKEFILE
echo 'NOFMAIN = '$NOFMAIN >> $MAKEFILE
echo 'USUAL = '$USUAL >> $MAKEFILE
echo 'SPECIAL = '$SPECIAL >> $MAKEFILE
echo 'F77SUFFIX = '$F77SUFFIX >> $MAKEFILE
echo 'F95SUFFIX = '$F95SUFFIX >> $MAKEFILE
echo 'TIMER = '$TIMER >> $MAKEFILE
echo 'NOT95 = '$NOT95 >> $MAKEFILE
echo 'NOT64 = '$NOT64 >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'AMPLDIR = '$AMPLLIBDIR >> $MAKEFILE
echo 'CC = '$CC >> $MAKEFILE
echo 'CCBASIC = '$CCBASIC >> $MAKEFILE
echo 'CCISO = '$CCISO >> $MAKEFILE
echo 'CCONDEF = '$CCONDEF >> $MAKEFILE
echo 'CCDEBUG = '$CCDEBUG >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Special flags' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Libraries' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'BLAS = '$BLAS >> $MAKEFILE
echo 'LAPACK = '$LAPACK >> $MAKEFILE
echo 'CUTERUSED = ' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Shell used' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'BINSHELL = '$BINSHELL >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Set directories for optional packages' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'include $(SIFDECODE)/src/makedefs/packages' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Body of makefile' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'include $(PWD)/makemaster' >> $MAKEFILE
# compile the selected packages
cd $SIFDECODE/src/
echo -e "\nInstalling the double precision version"
OPTIONS="-s -f $SIFDECODE/makefiles/$VERSION"
MACROS="PRECIS=double PWD=$SIFDECODE/src SIFDECODE=$SIFDECODE"
if (( $DRYRUN )) ; then
echo "$MAKE $OPTIONS all $MACROS"
else
echo " compiling in $SIFDECODE/src with the comand"
echo " $MAKE $OPTIONS all"
$MAKE $OPTIONS all $MACROS
[[ $? != 0 ]] && exit 2
fi
echo 'SIFDecode successfully installed'
cd $topdir
# install cutest
echo ' Installing CUTEst ...'
cd $CUTEST
# ensure that objects and modules directories exist
if [[ ! -e $CUTEST/objects ]]; then
$MKDIR $CUTEST/objects
fi
if [[ ! -e $CUTEST/modules ]]; then
$MKDIR $CUTEST/modules
fi
# create architecture-dependent object and module directories
OBJDIR=$CUTEST/objects/$VERSION
MODDIR=$CUTEST/modules/$VERSION
PKGDIR=$CUTEST/packages/$VERSION
echo "$MACHINE ($OPSYS) $COMPUSED" > $CUTEST/versions/$VERSION
if [[ ! -e $OBJDIR ]]; then
$MKDIR $OBJDIR
$MKDIR $OBJDIR/double $OBJDIR/single
else
[[ ! -e $OBJDIR/double ]] && $MKDIR $OBJDIR/double
[[ ! -e $OBJDIR/single ]] && $MKDIR $OBJDIR/single
fi
if [[ ! -e $MODDIR ]]; then
$MKDIR $MODDIR
$MKDIR $MODDIR/double $MODDIR/single
else
[[ ! -e $MODDIR/double ]] && $MKDIR $MODDIR/double
[[ ! -e $MODDIR/single ]] && $MKDIR $MODDIR/single
fi
[[ ! -e $PKGDIR ]] && $MKDIR $PKGDIR
[[ ! -e $PKGDIR/double ]] && $MKDIR $PKGDIR/double
[[ ! -e $PKGDIR/single ]] && $MKDIR $PKGDIR/single
# write out the cutest/bin/sys file for this architecture
SYSFILE=$CUTEST/bin/sys/$VERSION
echo 'RM="'$RM'"' > $SYSFILE
echo 'MAKE="'$MAKE'"' >> $SYSFILE
echo 'CAT="'$CAT'"' >> $SYSFILE
echo 'SED="'$SED'"' >> $SYSFILE
echo 'MV="'$MV'"' >> $SYSFILE
echo 'CP="'$CP'"' >> $SYSFILE
echo 'LS="'$LS'"' >> $SYSFILE
echo 'LN="'$LN'"' >> $SYSFILE
echo 'FORTRAN="'$FORTRAN'"' >> $SYSFILE
MOD='$CUTEST/modules/'$VERSION'/$PRECIS'
FFLAGS="$LIBCMD"' '`eval echo $MODCMD`' '"$F90"
echo 'FFLAGS="'$FFLAGS' '$OPENMP'"' >> $SYSFILE
echo 'PROBFLAGS="'$FFLAGS' '$BASIC' '$OPTIMIZATION' '$F77' "' >> $SYSFILE
echo 'BLAS="'$BLAS'"' >> $SYSFILE
echo 'LAPACK="'$LAPACK'"' >> $SYSFILE
# write out the cutest/makefile/ file for this architecture
MAKEFILE=$CUTEST/makefiles/$VERSION
echo ' ' > $MAKEFILE
echo '# Architecture dependent makefile' >> $MAKEFILE
echo '# (automatically generated by install_cutest)' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'VERSION = '$VERSION >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Basic system commands' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'CP = '$CP >> $MAKEFILE
echo 'MV = '$MV >> $MAKEFILE
echo 'RM = '$RM >> $MAKEFILE
echo 'LN = '$LN >> $MAKEFILE
echo 'SED = '$SED >> $MAKEFILE
echo 'GREP = '$GREP >> $MAKEFILE
echo 'AR = '$AR >> $MAKEFILE
echo 'ARREPFLAGS = '$ARREPFLAGS >> $MAKEFILE
echo 'RANLIB = '$RANLIB >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Directory for binaries' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'PRECIS = double' >> $MAKEFILE
echo 'OBJ = $(CUTEST)/objects/$(VERSION)/$(PRECIS)' >> $MAKEFILE
echo 'OBJS = $(CUTEST)/objects/$(VERSION)/single' >> $MAKEFILE
echo 'OBJD = $(CUTEST)/objects/$(VERSION)/double' >> $MAKEFILE
echo 'MOD = $(CUTEST)/modules/$(VERSION)/$(PRECIS)' >> $MAKEFILE
echo 'SEDS = $(CUTEST)/seds/$(PRECIS).sed' >> $MAKEFILE
echo 'MVMODS = '"$MVMODS" >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Compiler options' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'FORTRAN = '$FORTRAN >> $MAKEFILE
echo 'BASIC = '$BASIC >> $MAKEFILE
MODTMP="$LIBCMD"' '`echo $MODCMD | $SED 's/MOD/(MOD)/g'`
echo 'MODULES = '$MODTMP >> $MAKEFILE
echo 'OPTIMIZATION = '$OPTIMIZATION >> $MAKEFILE
echo 'NOOPTIMIZATION = '$NOOPTIMIZATION >> $MAKEFILE
echo 'DEBUG = '$DEBUG >> $MAKEFILE
echo 'OPENMP = '$OPENMP >> $MAKEFILE
echo 'F77 = '$F77 >> $MAKEFILE
echo 'F90 = '$F90 >> $MAKEFILE
echo 'F95 = '$F95 >> $MAKEFILE
echo 'NOFMAIN = '$NOFMAIN >> $MAKEFILE
echo 'USUAL = '$USUAL >> $MAKEFILE
echo 'SPECIAL = '$SPECIAL >> $MAKEFILE
echo 'F77SUFFIX = '$F77SUFFIX >> $MAKEFILE
echo 'F95SUFFIX = '$F95SUFFIX >> $MAKEFILE
echo 'TIMER = '$TIMER >> $MAKEFILE
echo 'NOT95 = '$NOT95 >> $MAKEFILE
echo 'NOT64 = '$NOT64 >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'AMPLDIR = '$AMPLLIBDIR >> $MAKEFILE
echo 'CC = '$CC >> $MAKEFILE
echo 'CCBASIC = '$CCBASIC >> $MAKEFILE
echo 'CCISO = '$CCISO >> $MAKEFILE
echo 'CCONDEF = '$CCONDEF >> $MAKEFILE
echo 'CCDEBUG = '$CCDEBUG >> $MAKEFILE
echo 'CCFFLAGS = '$CCFFLAGS >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Special flags' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Libraries' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'BLAS = '$BLAS >> $MAKEFILE
echo 'LAPACK = '$LAPACK >> $MAKEFILE
echo 'CUTESTUSED = ' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Shell used' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'BINSHELL = '$BINSHELL >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Set directories for optional packages' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'include $(CUTEST)/src/makedefs/packages' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Body of makefile' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'include $(PWD)/makemaster' >> $MAKEFILE
# compile the selected packages
cd $CUTEST/src/
OPTIONS="-s -f $CUTEST/makefiles/$VERSION"
PREC='double'
echo -e "\n Installing the $PREC precision version"
MACROS="PRECIS=$PREC PWD=$CUTEST/src CUTEST=$CUTEST"
if (( $DRYRUN )) ; then
echo "$MAKE $OPTIONS all $MACROS"
else
echo " compiling in $CUTEST/src with the command"
echo " $MAKE $OPTIONS all"
$MAKE $OPTIONS all $MACROS
[[ $? != 0 ]] && exit 2
fi
echo 'CUTEst successfully installed'
cd $topdir