-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall_sifdecode_main
executable file
·172 lines (145 loc) · 8.89 KB
/
install_sifdecode_main
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
#!/usr/bin/env bash
# partial build script for sifdecode
# version for Bourne/bash shell
# syntax: ginstall_sifdecode
# N. Gould, D. Orban & Ph. Toint
# ( Last modified 2025-01-02 at 08:10 GMT )
export SIFDECODE=`dirs -l`
export SIFDECODE=`echo $SIFDECODE | $SED 's"/tmp_mnt""'`
if [[ -e $SIFDECODE/versions/$VERSION ]]; then
warning "There is already an installed SIFDECODE version $VERSION"
yesno_default_yes ' Do you wish to proceed ... existing version will be updated'
[[ $? != 1 ]] && exit 4
fi
#echo $CMP
# 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"
echo "$MACHINE ($OPSYS) $COMPUSED" > $SIFDECODE/versions/$VERSION
if [[ ! -e $OBJDIR ]]; then
$MKDIR -p $OBJDIR
fi
if [[ ! -e $MODDIR ]]; then
$MKDIR -p $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'/$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 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
# optionally compile the selected packages
yesno_default_yes ' Would you like to compile SIFDecode ...'
if [[ $? != 0 ]]; then
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
success 'SIFDecode successfully installed'
fi
#exit 0