I made a small script to install the MIRA software. It checks if yorick is installed, also optimpack and downloads them and installs them if they are missing.

You can downlad it here

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
315
316
#! /bin/bash
#******************************************************************************
# Install script for MIRA, inspired from the AMBER DRS installation scripts
#
# (c) 2010 F. Millour
#
# $Log: not supported by cvs2svn $
# $Log: installMira.sh,v $
# Revision 1.2 2010/07/27 14:45:29 fmillour
# Add yorickinstallation to the MIRA installation script
# + change to MIRA 0.9.10
#
# Latest versions of the different software needed
####################################################
download_URL=https://cral.univ-lyon1.fr/labo/perso/eric.thiebaut/downloads/
yeti_version=6.3.3
MIRA_version=0.9.10
OptimPack_version=1.3.2
####################################################
yorick_URL=http://downloads.sourceforge.net/project/yorick/yorick
yorick_version=2.1.06
yorick_minus_version=2.1-06
yorick_short_version=2.1
####################################################
 
 
 
# Get root directory
currDir=$PWD
 
# Set log file
logFile=$PWD/mira-install.log
rm -f $logFile
touch $logFile
if [ $? != 0 ]
then
echo "ERROR - could not access log file $logFile"
exit 1
fi
 
# Print usage
function printUsage () {
echo -e "Usage: `basename $0` [-h] [-y] [-C <dir>] [-F <dir>]";
echo -e "\t-h\tprint this help.";
exit 0;
}
 
# Parse command-line parameters
installOpts=""
while getopts "hyC:F:" option
do
case $option in
h ) # Help option
printUsage;
exit 0;;
y ) # Assume yes option
installOpts="$installOpts -$option";;
* ) # Unknown option
echo "Invalid option -- $option"
printUsage;
exit 1;;
esac
done
 
# test first if yorick is installed
echo -e "Checking for the yorick software..." ;
if test `which yorick`;
then
echo "write, Y_SITE; quit;" > /tmp/getY_site.i
INSTALL_DIR=`yorick -batch /tmp/getY_site.i`;
echo -e "yorick found! installation directory is ${INSTALL_DIR}" ;
else
echo -e "yorick not found! checking if INSTALL_DIR has been set..." ;
# Then test if the INSTALL_DIR directory is set by the user
if test ${INSTALL_DIR} ;
then
echo -e "Installation directory is ${INSTALL_DIR}" ;
# If INSTALL_DIR directory is set by the user but do not exist, create it
if test ! -d ${INSTALL_DIR} ;
then
echo " Creating ${INSTALL_DIR} ..."
mkdir ${INSTALL_DIR}
fi
# Download yorick
cd ${INSTALL_DIR}
echo -e "Downloading yorick, version $yorick_version at ${yorick_URL}/${yorick_version}/yorick-${yorick_version}.tgz..."
curl -L -O ${yorick_URL}/${yorick_version}/yorick-${yorick_version}.tgz >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
# Uncompress yorick
echo -e "Uncompressing the yorick package..."
gunzip yorick-${yorick_version}.tgz >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
tar xf yorick-${yorick_version}.tar >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
rm -f yorick-${yorick_version}.tar >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
# Compile yorick
echo -e "Configuring yorick..."
cd yorick-${yorick_short_version}
./configure >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
echo -e "Compiling yorick..."
make relocatable >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
# Install yorick
echo -e "Installing yorick to ${INSTALL_DIR}..."
mv yorick-${yorick_minus_version}.tgz ${INSTALL_DIR}
cd ${INSTALL_DIR}
tar xzf yorick-${yorick_minus_version}.tgz
export PATH=${INSTALL_DIR}/yorick-${yorick_minus_version}/bin:${PATH}
export LD_LIBRARY_PATH=${INSTALL_DIR}/yorick-${yorick_minus_version}/lib:${LD_LIBRARY_PATH}
echo -e "Done!\n"
 
# test if yorick is installed
echo -e "Checking yorick installed well..." ;
if test `which yorick`;
then
echo "write, Y_SITE; quit;" > /tmp/getY_site.i
INSTALL_DIR=`yorick -batch /tmp/getY_site.i`;
echo -e "yorick found! installation directory is ${INSTALL_DIR}. Please consider adding this path to your PATH variable in your .bashrc or .profile file:\nexport PATH=${INSTALL_DIR}bin/:\$PATH" ;
echo "Press <enter> key when you have understood the above message..."
read touche
case $touche in
*) echo "Continuing..."
;;
esac
else
echo -e "ERROR - yorick not found!"
exit ;
fi
 
else
echo -e "ERROR - INSTALL_DIR variable, defining the installation directory, is not set !\nTry setting it with the following commands:\nbash shell:\nexport INSTALL_DIR=<your installation directory>\ntcsh shell:\nsetenv INSTALL_DIR <replace with your installation directory>"
exit ;
fi
fi
 
 
 
# Get kernel-name and hardware-platform
kernel=`uname -s`
if [ "$kernel" == "Darwin" ];
then
platform=`uname -p`
else
platform=`uname -m`
fi
 
echo -e "Installing the MIRA software on $kernel/$platform...\n"
 
 
 
 
 
####################################################
echo -e "Downloading yeti, version $yeti_version at ${download_URL}yeti-${yeti_version}.tar.bz2..."
curl -O ${download_URL}yorick/yeti-${yeti_version}.tar.bz2 >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
 
####################################################
echo -e "Uncompressing yeti..."
bunzip2 -k yeti-${yeti_version}.tar.bz2 >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
tar xf yeti-${yeti_version}.tar >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
rm -f yeti-${yeti_version}.tar >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
 
####################################################
echo -e "Installing yeti..."
cd yeti-${yeti_version}
yorick -batch ./config.i --with-regex \
--with-fftw --with-fftw-defs="-I/usr/local/include" \
--with-fftw-libs="-L/usr/local/lib -lrfftw -lfftw" \
--with-gsl --with-gsl-defs="-I/usr/local/include" \
--with-gsl-libs="-L/usr/local/lib -lgsl -lgslcblas"
# Tiff library not always installed on target machines
# --with-tiff --with-tiff-libs="-ltiff" >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
make clean >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
make >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
make install >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
echo -e "\nDone..."
cd ..
 
####################################################
echo -e "Downloading OptimPack, version $OptimPack_version at ${download_URL}OptimPack-${OptimPack_version}.tar.bz2..."
curl -O ${download_URL}OptimPack-${OptimPack_version}.tar.bz2 >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
 
####################################################
echo -e "Uncompressing OptimPack..."
bunzip2 -k OptimPack-${OptimPack_version}.tar.bz2 >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
tar xf OptimPack-${OptimPack_version}.tar >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
rm -f OptimPack-${OptimPack_version}.tar >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
 
####################################################
echo -e "Installing OptimPack..."
cd OptimPack-${OptimPack_version}/yorick
yorick -batch make.i >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
make >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
make install >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
cd ../..
echo -e "Done!\n"
 
####################################################
echo -e "Downloading MIRA, version $MIRA_version at ${download_URL}mira-${MIRA_version}.tar.bz2 into ${PWD}..."
curl -O ${download_URL}mira/mira-${MIRA_version}.tar.bz2 >> $logFile 2>&1
if [ $? != 0 ]
then
echo -e "\nERROR - See log file '$logFile' for details."
exit 1;
fi
 
####################################################
echo -e "Uncompressing MIRA..."
echo $PWD
bunzip2 -k mira-${MIRA_version}.tar.bz2 >> $logFile 2>&1
tar xf mira-${MIRA_version}.tar >> $logFile 2>&1
rm -f mira-${MIRA_version}.tar >> $logFile 2>&1
echo -e "Moving MIRA files into yorick directory..."
mv -f -v mira-${MIRA_version}/*.i ${INSTALL_DIR}/i
echo -e "Done!\n"