1 | #!/bin/ksh |
---|
2 | # mbuild - script for compiling the PALM code and its utility programs |
---|
3 | # $Id: mbuild 740 2011-08-17 14:54:23Z raasch $ |
---|
4 | |
---|
5 | # Procedure to compile code on local and remote hosts using the |
---|
6 | # make-mechanism. The source code must be provided on the local host. |
---|
7 | |
---|
8 | # Last changes: |
---|
9 | # 06/05/02 - Siggi - start development |
---|
10 | # 12/06/02 - Siggi - first version finished |
---|
11 | # 12/09/02 - Siggi - ibmh (hanni.hlrn.de) included |
---|
12 | # 19/12/02 - Siggi - ibmb included |
---|
13 | # 05/02/03 - Siggi - hostname nobela included |
---|
14 | # 04/03/03 - Siggi - host nech included |
---|
15 | # 06/03/03 - Siggi - make_call_string is echoed without '' to |
---|
16 | # file LAST_MAKE_CALL (otherwise error on NEC, because |
---|
17 | # '' are part of compiler options |
---|
18 | # 16/03/03 - Siggi - Two underscores are placed in front of every define |
---|
19 | # string, in case that palm.f90 version contains |
---|
20 | # such strings |
---|
21 | # 16/04/03 - Siggi - First extensions for linux machines |
---|
22 | # 24/06/03 - Siggi - host orkan included |
---|
23 | # 17/07/03 - Siggi - IP adress set to new "cross" machine at DKRZ |
---|
24 | # 24/07/03 - Siggi - host maestro admitted |
---|
25 | # 06/08/03 - Siggi - host gregale admitted |
---|
26 | # 05/11/03 - Siggi - hosts irifi and quanero are now belonging to lcmuk |
---|
27 | # 19/11/03 - Heiko - on lcmuk, mbuild does not tar the *.i files |
---|
28 | # 08/01/04 - Siggi - additional preprocessor directive for ibm included |
---|
29 | # (-D$OMP=OMP) in order to avoid problems with |
---|
30 | # OMP_NUM_THREADS |
---|
31 | # 09/01/04 - Siggi - action above cancelled |
---|
32 | # 28/01/04 - Siggi - action above re-cancelled |
---|
33 | # 08/03/04 - Siggi - host scirocco admitted |
---|
34 | # 26/03/04 - Siggi - .o and .mod files are also deleted in depository, if |
---|
35 | # the respective .f90 file is not listed in the makefile |
---|
36 | # and deletion is demanded by the user |
---|
37 | # 12/04/04 - Siggi - scp2 instead of scp used for transfer from decalpha |
---|
38 | # due to error in ssh installation (otherwise a prompt |
---|
39 | # for the password appears) |
---|
40 | # 23/07/04 - Siggi - changes due to the new berni configuration |
---|
41 | # (federation switch) |
---|
42 | # 08/09/04 - Siggi - hanni IP address changed to 130.75.4.10 |
---|
43 | # 23/09/04 - Joerg - correction of IP-Address for 'cross' (DKRZ) |
---|
44 | # 09/03/05 - Siggi - on nech, mbuild does not tar the *.i files |
---|
45 | # 31/03/05 - Siggi - mbuild does not tar *.i files any more |
---|
46 | # 24/04/05 - Siggi - netcdf support on lcmuk |
---|
47 | # 25/04/05 - Siggi - netcdf support on gfdl3 (decalpha) |
---|
48 | # 12/05/05 - Siggi - netcdf support on ibm |
---|
49 | # set OBJECT_MODE=64 for compiling on ibmb, ibmh |
---|
50 | # 18/05/05 - Siggi - netcdf support on nec |
---|
51 | # 19/05/05 - Siggi - IP addres 134.75.155.74 changed to 165.132.26.56 |
---|
52 | # 23/05/05 - Siggi - netcdf support on ibms |
---|
53 | # 01/06/05 - Siggi - reset of cpp_options to "" on lcmuk |
---|
54 | # 30/06/05 - Siggi - netcdf support on bora |
---|
55 | # 20/10/05 - Siggi - update of netcdf-version on decalpha (gfdl3) |
---|
56 | # 04/11/05 - Siggi - netcdf 3.6.0-p1 on ibmh/ibmb |
---|
57 | # 30/12/05 - Siggi - change of IP adresses in subnet 130.75.105 |
---|
58 | # host gfdl5 (ibmy) admitted |
---|
59 | # 10/01/06 - Siggi - cpp directive for NetCDF 64bit support |
---|
60 | # 20/01/06 - Siggi - cpp directive for ibmy |
---|
61 | # 09/02/06 - Marcus- compile only once on lcmuk (as on ibmh/ibmb) |
---|
62 | # 10/02/06 - Siggi - modifications for scp on decalpha |
---|
63 | # 13/04/06 - Siggi - ostria admitted |
---|
64 | # 19/04/06 - Siggi - preprocessor directive -D$OMP=OMP for ibm removed |
---|
65 | # 23/05/05 - Siggi - lctit (SUN Fire X4600) admitted |
---|
66 | # 29/05/05 - Siggi - atmos (lcide) admitted |
---|
67 | # 23/08/06 - Siggi - netcdf support for scirocco (notebook) |
---|
68 | # 24/11/06 - Siggi - breva and levanto admitted |
---|
69 | # 07/02/07 - Siggi - adapted for RIAM (neck) |
---|
70 | # 10/02/07 - Siggi - all hpmuk-related code removed |
---|
71 | # 02/03/07 - Siggi - compilation of utility programs and transfer of |
---|
72 | # scripts to remote hosts added (option -u) |
---|
73 | # 14/03/07 - Siggi - fimm admitted, revision number added to terminal |
---|
74 | # output |
---|
75 | # 16/03/07 - Siggi - adjustments (netcdf) for lctit |
---|
76 | # adjustments for running under pdksh, local ip-addres |
---|
77 | # is not determined any more |
---|
78 | # 30/03/07 - Siggi - cpp-directives/options + netcdf-options are read |
---|
79 | # from configuration file |
---|
80 | # host identifier (local_host) is read from config file |
---|
81 | # 10/10/07 - Siggi - bugfix: handling of comment lines |
---|
82 | # 18/07/08 - Siggi - adapted for lcsgih |
---|
83 | # 21/07/08 - Siggi - mainprog (executable) is added to the tar-file |
---|
84 | # ({mainprog}_current_version) |
---|
85 | # 02/10/08 - Siggi - adapted for lcxt4 |
---|
86 | # 14/11/08 - Siggi - update mechanism completely revised: source tarfile |
---|
87 | # remains in source directory, one depository per block |
---|
88 | # (given in the config-file) is created, allways all |
---|
89 | # files from the source directory are copied to the |
---|
90 | # respective depository, no additional file checks are |
---|
91 | # done any more (version 2.1) |
---|
92 | # 13/01/09 - Marcus- re-enable compilation more than once on lcmuk (as on |
---|
93 | # other machines) |
---|
94 | # 21/03/09 - Siggi - -u copies also copies process_dvr_output and |
---|
95 | # .dvrserver.config |
---|
96 | # 21/04/09 - Siggi - adjustments for new IBM at DKRZ, which is now ibmh |
---|
97 | # 25/08/09 - BjornM- adapted for lck |
---|
98 | # 01/12/09 - BjornM- re-adjustments for lcxt4 |
---|
99 | # 01/02/10 - Siggi - adjustments for lcxt5m |
---|
100 | # 03/02/10 - Siggi - make options (mopts) to be set by configuration file |
---|
101 | # implemented, remoted mode option -r completely |
---|
102 | # removed, t3e related parts removed |
---|
103 | # 26/02/10 - BjornM- re-adjustments for lcxt4 (new modules) |
---|
104 | # 01/03/10 - Siggi - mpilib replaced by modules: explicit module settings |
---|
105 | # removed; modules should now be given in the |
---|
106 | # configuration file |
---|
107 | # 02/03/10 - Siggi - utility programs are created separately for each |
---|
108 | # block in the configuration file, |
---|
109 | # parallel make for utility programs |
---|
110 | # 12/03/10 - Siggi - bugfix: remode_md was given a wrong value |
---|
111 | # 16/08/10 - BjornM- bugfix: call of modules on local host, new workaround |
---|
112 | # for lcxt4 |
---|
113 | # 07/09/10 - Siggi - bugfix for wrong netcdf/3.6.3 module on lcsgi |
---|
114 | # 08/12/10 - Siggi - initialization of the module command changed for |
---|
115 | # SGI-ICE/lcsgi |
---|
116 | # adjustments for Kyushu Univ. (lcrte, ibmku) |
---|
117 | # 14/12/10 - Siggi - adjustments for new Tsubame system at Tokyo |
---|
118 | # institute of technology (lctit) |
---|
119 | # 04/03/11 - BjornM- re-adjustments for lcxt4 |
---|
120 | # 06/03/11 - Siggi - adjustments for ibmkisti |
---|
121 | # 03/04/11 - Micha - added lckordi |
---|
122 | # 17/08/11 - Siggi - HLRN access via hicegate0 (130.75.4.101) |
---|
123 | |
---|
124 | |
---|
125 | |
---|
126 | # VARIABLE DECLARATIONS + DEFAULT VALUES |
---|
127 | compile_utility_programs=false |
---|
128 | config_file=.mrun.config |
---|
129 | fimm=false |
---|
130 | host=all |
---|
131 | host_found=false |
---|
132 | locat=normal |
---|
133 | makefile="" |
---|
134 | module_calls="" |
---|
135 | scirocco=false |
---|
136 | silent=false |
---|
137 | suf=f90 |
---|
138 | update=false |
---|
139 | working_directory=`pwd` |
---|
140 | |
---|
141 | typeset -i ih ihost=0 |
---|
142 | |
---|
143 | typeset -R30 calltime |
---|
144 | typeset -L20 column1 |
---|
145 | typeset -L50 column2 |
---|
146 | typeset -L70 column3 |
---|
147 | typeset -L40 version="MBUILD 2.1 Rev$Rev: 740 $" |
---|
148 | |
---|
149 | # ERROR HANDLING |
---|
150 | # IN CASE OF EXIT: |
---|
151 | trap 'rm -rf $working_directory/tmp_mbuild |
---|
152 | if [[ $locat != normal ]] |
---|
153 | then |
---|
154 | printf "\n\n +++ mbuild killed \n\n" |
---|
155 | else |
---|
156 | printf "\n\n *** mbuild finished \n\n" |
---|
157 | fi' exit |
---|
158 | |
---|
159 | |
---|
160 | # IN CASE OF TERMINAL-BREAK: |
---|
161 | trap 'rm -rf $working_directory/tmp_mbuild |
---|
162 | printf "\n\n +++ mbuild killed by \"^C\" \n\n" |
---|
163 | exit |
---|
164 | ' 2 |
---|
165 | |
---|
166 | |
---|
167 | tmp_mbuild=${working_directory}/tmp_mbuild |
---|
168 | |
---|
169 | # READ SHELLSCRIPT-OPTIONS |
---|
170 | while getopts :c:h:m:s:u option |
---|
171 | do |
---|
172 | case $option in |
---|
173 | (c) config_file=$OPTARG;; |
---|
174 | (h) host=$OPTARG;; |
---|
175 | (m) makefile=$OPTARG;; |
---|
176 | (s) suf=$OPTARG;; |
---|
177 | (u) compile_utility_programs=true;; |
---|
178 | (\?) printf "\n +++ unknown option $OPTARG \n"; |
---|
179 | locat=parameter; exit;; |
---|
180 | esac |
---|
181 | done |
---|
182 | |
---|
183 | |
---|
184 | |
---|
185 | # CHECK, IF CONFIGURATION-FILE EXISTS |
---|
186 | if [[ ! -f $config_file ]] |
---|
187 | then |
---|
188 | printf "\n +++ configuration file: " |
---|
189 | printf "\n $config_file" |
---|
190 | printf "\n does not exist" |
---|
191 | locat=configuration; exit |
---|
192 | fi |
---|
193 | |
---|
194 | |
---|
195 | |
---|
196 | # DETERMINE THE LOCAL HOST |
---|
197 | local_host_real_name=$(hostname) |
---|
198 | # local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}') |
---|
199 | |
---|
200 | |
---|
201 | |
---|
202 | # DETERMINE HOST-IDENTIFIER (local_host) FROM THE CONFIG-FILE |
---|
203 | line="" |
---|
204 | grep "%host_identifier" $config_file > $tmp_mbuild |
---|
205 | while read line |
---|
206 | do |
---|
207 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
208 | then |
---|
209 | HOSTNAME=`echo $line | cut -d" " -s -f2` |
---|
210 | host_identifier=`echo $line | cut -d" " -s -f3` |
---|
211 | if [[ $local_host_real_name = $HOSTNAME ]] |
---|
212 | then |
---|
213 | local_host=$host_identifier |
---|
214 | break |
---|
215 | fi |
---|
216 | fi |
---|
217 | done < $tmp_mbuild |
---|
218 | |
---|
219 | if [[ "$local_host" = "" ]] |
---|
220 | then |
---|
221 | printf "\n +++ no host identifier found in configuration file \"$config_file\"" |
---|
222 | printf "\n for local host \"$local_host_real_name\"." |
---|
223 | printf "\n Please add line" |
---|
224 | printf "\n \"\%host_identifier $local_host_real_name <identifier>\"" |
---|
225 | printf "\n to the configuration file." |
---|
226 | locat=local_host; exit |
---|
227 | fi |
---|
228 | |
---|
229 | |
---|
230 | |
---|
231 | [[ $local_host_real_name = scirocco ]] && scirocco=true |
---|
232 | [[ $local_host_real_name = fimm.bccs.uib.no ]] && fimm=true |
---|
233 | |
---|
234 | |
---|
235 | |
---|
236 | if [[ $local_host != ibms ]] |
---|
237 | then |
---|
238 | config_file=$PWD/$config_file |
---|
239 | else |
---|
240 | config_file=`pwd`/$config_file |
---|
241 | fi |
---|
242 | |
---|
243 | |
---|
244 | |
---|
245 | # DETERMINE USER NAME ON LOCAL HOST FROM THE CONFIG-FILE |
---|
246 | line="" |
---|
247 | grep " $local_host" $config_file | grep "%remote_username" > $tmp_mbuild |
---|
248 | while read line |
---|
249 | do |
---|
250 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
251 | then |
---|
252 | local_username=`echo $line | cut -d" " -s -f2` |
---|
253 | fi |
---|
254 | done < $tmp_mbuild |
---|
255 | |
---|
256 | |
---|
257 | if [[ "$local_username" = "" ]] |
---|
258 | then |
---|
259 | printf "\n +++ no user name found in configuration file" |
---|
260 | printf "\n for local host \"$local_host\" " |
---|
261 | locat=config_file; exit |
---|
262 | fi |
---|
263 | |
---|
264 | |
---|
265 | # DETERMINE LOCAL SOURCE-CODE PATH. |
---|
266 | # FIRST CHECK, IF A GLOBAL SOURCE-CODE PATH HAS BEEN DECLARED FOR ALL HOSTS. |
---|
267 | # THEREFORE, FIRST SET ALL GLOBAL VARIABLES DECLARED IN THE CONFIG-FILE, |
---|
268 | # BECAUSE THEY MAY BE USED AS PART OF THE PATH NAME. |
---|
269 | line="" |
---|
270 | grep "%" $config_file > $tmp_mbuild |
---|
271 | while read line |
---|
272 | do |
---|
273 | if [[ "$line" != "" && "$(echo $line | cut -d" " -s -f3)" = "" && $(echo $line | cut -c1) != "#" ]] |
---|
274 | then |
---|
275 | var=`echo $line | cut -d" " -s -f1 | cut -c2-` |
---|
276 | value=`echo $line | cut -d" " -s -f2` |
---|
277 | eval export $var=\$value |
---|
278 | fi |
---|
279 | done < $tmp_mbuild |
---|
280 | |
---|
281 | # NOW CHECK, IF A GLOBAL SOURCE-CODE-PATH HAS BEEN DECLARED |
---|
282 | line="" |
---|
283 | grep "%source_path" $config_file > $tmp_mbuild |
---|
284 | while read line |
---|
285 | do |
---|
286 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
287 | then |
---|
288 | if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]] |
---|
289 | then |
---|
290 | global_source_path=`echo $line | cut -d" " -s -f2` |
---|
291 | fi |
---|
292 | fi |
---|
293 | done < $tmp_mbuild |
---|
294 | |
---|
295 | line="" |
---|
296 | grep " $local_host" $config_file | grep "%source_path" > $tmp_mbuild |
---|
297 | while read line |
---|
298 | do |
---|
299 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
300 | then |
---|
301 | local_source_path=`echo $line | cut -d" " -s -f2` |
---|
302 | fi |
---|
303 | done < $tmp_mbuild |
---|
304 | |
---|
305 | if [[ "$local_source_path" = "" ]] |
---|
306 | then |
---|
307 | if [[ "$global_source_path" != "" ]] |
---|
308 | then |
---|
309 | local_source_path=$global_source_path |
---|
310 | else |
---|
311 | printf "\n +++ no source path found in configuration file" |
---|
312 | printf "\n for local host \"$local_host\" " |
---|
313 | printf "\n please set \"\%source_path\" in configuration file" |
---|
314 | locat=config_file; exit |
---|
315 | fi |
---|
316 | fi |
---|
317 | eval local_source_path=$local_source_path |
---|
318 | eval local_source_path=$local_source_path |
---|
319 | |
---|
320 | |
---|
321 | |
---|
322 | # DETERMINE GLOBAL DEPOSITORY-PATH |
---|
323 | line="" |
---|
324 | grep "%depository_path" $config_file > $tmp_mbuild |
---|
325 | while read line |
---|
326 | do |
---|
327 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
328 | then |
---|
329 | if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]] |
---|
330 | then |
---|
331 | global_depository_path=`echo $line | cut -d" " -s -f2` |
---|
332 | fi |
---|
333 | fi |
---|
334 | done < $tmp_mbuild |
---|
335 | |
---|
336 | |
---|
337 | |
---|
338 | # CHECK, IF A MAIN PROGRAM HAS BEEN DEFINED IN THE CONFIG-FILE |
---|
339 | if [[ $(grep -c "%mainprog" $config_file) != 1 ]] |
---|
340 | then |
---|
341 | printf "\n +++ no main program or more than one main program defined" |
---|
342 | printf "\n in configuration file" |
---|
343 | locat=configuration; exit |
---|
344 | else |
---|
345 | line=`grep "%mainprog" $config_file` |
---|
346 | if [[ "$line" = "" || $(echo $line | cut -c1) = "#" ]] |
---|
347 | then |
---|
348 | printf "\n +++ no main program defined in configuration file" |
---|
349 | locat=configuration; exit |
---|
350 | fi |
---|
351 | mainprog=`echo $line | cut -d" " -s -f2 | cut -d"." -f1` |
---|
352 | fi |
---|
353 | |
---|
354 | |
---|
355 | |
---|
356 | # CHECK IF MAKEFILE EXITS |
---|
357 | [[ "$makefile" = "" ]] && makefile=$local_source_path/Makefile |
---|
358 | if [[ ! -f $makefile ]] |
---|
359 | then |
---|
360 | printf "\n +++ makefile: " |
---|
361 | printf "\n $makefile" |
---|
362 | printf "\n does not exist" |
---|
363 | locat=makefile; exit |
---|
364 | fi |
---|
365 | |
---|
366 | |
---|
367 | # HEADER-OUTPUT (PART1: MESSAGES CONCERNING THE LOCAL HOST) |
---|
368 | calltime=$(date) |
---|
369 | printf "\n" |
---|
370 | printf "#------------------------------------------------------------------------# \n" |
---|
371 | printf "| $version$calltime | \n" |
---|
372 | printf "| | \n" |
---|
373 | column1="called on:"; column2=$local_host_real_name |
---|
374 | printf "| $column1$column2 | \n" |
---|
375 | column1="local username:"; column2=$local_username |
---|
376 | printf "| $column1$column2 | \n" |
---|
377 | column1="local IP-addres:"; column2=$local_addres |
---|
378 | printf "| $column1$column2 | \n" |
---|
379 | column1="config file:"; column2=$config_file |
---|
380 | printf "| $column1$column2 | \n" |
---|
381 | column1="makefile:"; column2=$makefile |
---|
382 | printf "| $column1$column2 | \n" |
---|
383 | column1="local source path:"; column2=$local_source_path |
---|
384 | printf "| $column1$column2 | \n" |
---|
385 | printf "#------------------------------------------------------------------------# \n" |
---|
386 | |
---|
387 | # printf "| | \n" |
---|
388 | |
---|
389 | |
---|
390 | if [[ $compile_utility_programs = false ]] |
---|
391 | then |
---|
392 | |
---|
393 | # IN ANY CASE, GIVE ALL FILES WRITE-PERMIT, IN ORDER TO AVOID PROBLEMS |
---|
394 | # WITH OVERWRITING FILES ON THE REMOTE HOST |
---|
395 | cd $local_source_path |
---|
396 | printf "\n\n *** tar of makefile and source files in $local_source_path" |
---|
397 | tar -cf ${mainprog}_sources.tar Makefile *.$suf |
---|
398 | printf "\n" |
---|
399 | |
---|
400 | fi |
---|
401 | |
---|
402 | |
---|
403 | |
---|
404 | # GET CONFIRMATION TO CONTINUE |
---|
405 | if [[ $host = all ]] |
---|
406 | then |
---|
407 | printf "\n *** updates will be made for ALL hosts found in" |
---|
408 | printf "\n the configuration file" |
---|
409 | else |
---|
410 | printf "\n *** update will be made for host \"$host\" " |
---|
411 | fi |
---|
412 | |
---|
413 | if [[ $silent = false ]] |
---|
414 | then |
---|
415 | answer=dummy |
---|
416 | printf "\n\n" |
---|
417 | while [[ "$answer" != y && "$answer" != Y && "$answer" != n && "$answer" != N ]] |
---|
418 | do |
---|
419 | printf " >>> continue (y/n) ? " |
---|
420 | read answer |
---|
421 | done |
---|
422 | if [[ $answer = n || $answer = N ]] |
---|
423 | then |
---|
424 | locat=user_abort; exit |
---|
425 | fi |
---|
426 | fi |
---|
427 | |
---|
428 | |
---|
429 | |
---|
430 | |
---|
431 | # GENERIERUNG DER AKTUELLEN MODELLVERSION FUER ALLE RECHNER-/UEBERSETZUNGS- |
---|
432 | # VERSIONEN, DIE IN DER KONFIGURATIONSDATEI GEFUNDEN WERDEN |
---|
433 | printf "\n *** scanning configuration file for host(s) ..." |
---|
434 | |
---|
435 | grep %fopts $config_file > $tmp_mbuild |
---|
436 | while read line |
---|
437 | do |
---|
438 | # KOMMENTARZEILEN UEBERSPRINGEN |
---|
439 | [[ $(echo $line | cut -c1) = "#" ]] && continue |
---|
440 | (( ihost = ihost + 1 )) |
---|
441 | hostline[$ihost]="$line" |
---|
442 | done < $tmp_mbuild |
---|
443 | |
---|
444 | |
---|
445 | while (( ih < ihost )) |
---|
446 | do |
---|
447 | |
---|
448 | (( ih = ih + 1 )) |
---|
449 | |
---|
450 | # REMOTE-RECHNER UND UEBERSETZUNGS-VERSION FESTSTELLEN |
---|
451 | # NUR WEITERMACHEN, WENN ENTSPRECHENDER REMOTE-RECHNER MITTELS |
---|
452 | # SHELLSCRIPT-OPTION AUCH AUSGEWAEHLT WURDE |
---|
453 | remote_host_string=`echo ${hostline[$ih]} | cut -d" " -s -f3-` |
---|
454 | remote_host=`echo $remote_host_string | cut -d" " -f1` |
---|
455 | if [[ $host != all ]] |
---|
456 | then |
---|
457 | [[ $remote_host != $host ]] && continue |
---|
458 | fi |
---|
459 | host_found=true |
---|
460 | condition1=`echo $remote_host_string | cut -d" " -s -f2` |
---|
461 | if [[ $condition1 = $remote_host ]] |
---|
462 | then |
---|
463 | condition1="" |
---|
464 | else |
---|
465 | condition2=`echo $remote_host_string | cut -d" " -s -f3` |
---|
466 | fi |
---|
467 | |
---|
468 | modules="" |
---|
469 | netcdf_inc="" |
---|
470 | netcdf_lib="" |
---|
471 | |
---|
472 | # IP-ADRESSE DES REMOTE-RECHNERS BESTIMMEN |
---|
473 | case $remote_host in |
---|
474 | (lckordi) remote_adress=210.219.61.8;; |
---|
475 | (lcmuk) remote_addres=130.75.105.2;; |
---|
476 | (lcrte) remote_addres=133.5.185.60;; |
---|
477 | (lcsgib) remote_addres=130.73.232.102;; |
---|
478 | (lcsgih) remote_addres=130.75.4.101;; |
---|
479 | (lck) remote_addres=165.132.26.61;; |
---|
480 | (lctit) remote_addres=10.1.6.170;; |
---|
481 | (lcxt4) remote_addres=129.177.20.113;; |
---|
482 | (lcxt5m) remote_addres=193.166.211.144;; |
---|
483 | (decalpha) remote_addres=165.132.26.56;; |
---|
484 | (ibmh) remote_addres=136.172.40.15;; |
---|
485 | (ibmkisti) remote_addres=150.183.146.24;; |
---|
486 | (ibmku) remote_addres=133.5.4.129;; |
---|
487 | (ibms) remote_addres=150.183.5.101;; |
---|
488 | (ibmy) remote_addres=165.132.26.58;; |
---|
489 | (nech) remote_addres=136.172.44.192;; |
---|
490 | (neck) remote_addres=133.5.178.11;; |
---|
491 | (ground.yonsei.ac.kr) remote_addres=134.75.155.33;; |
---|
492 | (*) if [[ $local_host != $remote_host ]] |
---|
493 | then |
---|
494 | printf "\n +++ remote host \"$remote_host\" unknown"; |
---|
495 | printf "\n please inform PALM group support!" |
---|
496 | fi;; |
---|
497 | esac |
---|
498 | |
---|
499 | |
---|
500 | # REMOTE-USERNAMEN ERMITTELN |
---|
501 | line="" |
---|
502 | found=false |
---|
503 | grep "$remote_host_string" $config_file | grep "%remote_username" > $tmp_mbuild |
---|
504 | while read line1 |
---|
505 | do |
---|
506 | |
---|
507 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
508 | then |
---|
509 | line="$line1" |
---|
510 | fi |
---|
511 | |
---|
512 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
513 | then |
---|
514 | remote_username=`echo $line | cut -d" " -s -f2` |
---|
515 | found=true |
---|
516 | fi |
---|
517 | |
---|
518 | done < $tmp_mbuild |
---|
519 | |
---|
520 | if [[ $found = false ]] |
---|
521 | then |
---|
522 | printf "\n +++ no remote username found in configuration file" |
---|
523 | printf "\n for \"$remote_host_string\" " |
---|
524 | locat=config_file; exit |
---|
525 | fi |
---|
526 | |
---|
527 | |
---|
528 | # REMOTE-QUELLTEXTPFAD ERMITTELN |
---|
529 | line="" |
---|
530 | remote_source_path="" |
---|
531 | grep "$remote_host_string" $config_file | grep "%source_path" > $tmp_mbuild |
---|
532 | while read line1 |
---|
533 | do |
---|
534 | |
---|
535 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
536 | then |
---|
537 | line="$line1" |
---|
538 | fi |
---|
539 | |
---|
540 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
541 | then |
---|
542 | remote_source_path=`echo $line | cut -d" " -s -f2` |
---|
543 | fi |
---|
544 | |
---|
545 | done < $tmp_mbuild |
---|
546 | |
---|
547 | if [[ "$remote_source_path" = "" ]] |
---|
548 | then |
---|
549 | if [[ "$global_source_path" != "" ]] |
---|
550 | then |
---|
551 | remote_source_path=$global_source_path |
---|
552 | else |
---|
553 | printf "\n +++ no source path found in configuration file" |
---|
554 | printf "\n for \"$remote_host_string\" " |
---|
555 | locat=config_file; exit |
---|
556 | fi |
---|
557 | fi |
---|
558 | |
---|
559 | remote_ud=${remote_source_path}/../UTIL |
---|
560 | remote_ud=$(eval echo $remote_ud) |
---|
561 | |
---|
562 | |
---|
563 | # REMOTE-PFAD FUER MAKE-DEPOSITORY ERMITTELN |
---|
564 | remote_md="" |
---|
565 | line="" |
---|
566 | grep "$remote_host_string" $config_file | grep "%depository_path" > $tmp_mbuild |
---|
567 | while read line1 |
---|
568 | do |
---|
569 | |
---|
570 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
571 | then |
---|
572 | line="$line1" |
---|
573 | fi |
---|
574 | |
---|
575 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
576 | then |
---|
577 | remote_md=`echo $line | cut -d" " -s -f2` |
---|
578 | fi |
---|
579 | |
---|
580 | done < $tmp_mbuild |
---|
581 | |
---|
582 | if [[ "$remote_md" = "" ]] |
---|
583 | then |
---|
584 | if [[ "$global_depository_path" != "" ]] |
---|
585 | then |
---|
586 | remote_md=$global_depository_path |
---|
587 | else |
---|
588 | printf "\n +++ no depository path found in configuration file" |
---|
589 | printf "\n for \"$remote_host_string\" " |
---|
590 | printf "\n please set \"\%depository_path\" in configuration file" |
---|
591 | locat=config_file; exit |
---|
592 | fi |
---|
593 | fi |
---|
594 | |
---|
595 | remote_md=$(eval echo $remote_md) |
---|
596 | block="" |
---|
597 | [[ "$condition1" != "" ]] && block=_$condition1 |
---|
598 | [[ "$condition2" != "" ]] && block=${block}_$condition2 |
---|
599 | remote_md=${remote_md}$block |
---|
600 | |
---|
601 | |
---|
602 | # COMPILERNAMEN ERMITTELN |
---|
603 | line="" |
---|
604 | found=false |
---|
605 | grep "$remote_host_string" $config_file | grep "%compiler_name " > $tmp_mbuild |
---|
606 | while read line1 |
---|
607 | do |
---|
608 | |
---|
609 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
610 | then |
---|
611 | line="$line1" |
---|
612 | fi |
---|
613 | |
---|
614 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
615 | then |
---|
616 | compiler_name=`echo $line | cut -d" " -s -f2` |
---|
617 | found=true |
---|
618 | fi |
---|
619 | |
---|
620 | done < $tmp_mbuild |
---|
621 | |
---|
622 | if [[ $found = false ]] |
---|
623 | then |
---|
624 | printf "\n +++ no compiler name found in configuration file" |
---|
625 | printf "\n for \"$remote_host_string\" " |
---|
626 | locat=config_file; exit |
---|
627 | fi |
---|
628 | |
---|
629 | |
---|
630 | # BEI BENUTZUNG EINES PARALLELEN COMPILERS MUSS AUCH EIN |
---|
631 | # SERIELLER COMPILERNAME ERMITTELT WERDEN |
---|
632 | if [[ $(echo $remote_host_string | grep -c parallel) = 1 ]] |
---|
633 | then |
---|
634 | line="" |
---|
635 | found=false |
---|
636 | grep "$remote_host_string" $config_file | grep "%compiler_name_ser" > $tmp_mbuild |
---|
637 | while read line1 |
---|
638 | do |
---|
639 | |
---|
640 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
641 | then |
---|
642 | line="$line1" |
---|
643 | fi |
---|
644 | |
---|
645 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
646 | then |
---|
647 | compiler_name_ser=`echo $line | cut -d" " -s -f2` |
---|
648 | found=true |
---|
649 | fi |
---|
650 | |
---|
651 | done < $tmp_mbuild |
---|
652 | |
---|
653 | if [[ $found = false ]] |
---|
654 | then |
---|
655 | printf "\n +++ no serial compiler name found in configuration file" |
---|
656 | printf "\n for \"$remote_host_string\" " |
---|
657 | locat=config_file; exit |
---|
658 | fi |
---|
659 | else |
---|
660 | compiler_name_ser=$compiler_name |
---|
661 | fi |
---|
662 | |
---|
663 | |
---|
664 | |
---|
665 | # PRAEPROZESSOR-OPTIONEN/DIREKTIVEN ERMITTELN |
---|
666 | line="" |
---|
667 | found=false |
---|
668 | grep "$remote_host_string" $config_file | grep "%cpp_options" > $tmp_mbuild |
---|
669 | while read line1 |
---|
670 | do |
---|
671 | |
---|
672 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
673 | then |
---|
674 | line="$line1" |
---|
675 | fi |
---|
676 | |
---|
677 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
678 | then |
---|
679 | # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN |
---|
680 | cpp_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
681 | found=true |
---|
682 | fi |
---|
683 | |
---|
684 | done < $tmp_mbuild |
---|
685 | |
---|
686 | if [[ $found = false ]] |
---|
687 | then |
---|
688 | printf "\n +++ no preprocessor options found in configuration file" |
---|
689 | printf "\n for \"$remote_host_string\" " |
---|
690 | locat=config_file; exit |
---|
691 | fi |
---|
692 | |
---|
693 | |
---|
694 | # RECHNERSPEZIFISCHE CPP-DIREKTIVEN HINZUFUEGEN |
---|
695 | for string in $remote_host_string |
---|
696 | do |
---|
697 | if [[ $(echo $remote_host | cut -c1-2) = lc && $(echo $string | cut -c1-2) = lc ]] |
---|
698 | then |
---|
699 | cpp_options="$cpp_options -D__lc " |
---|
700 | elif [[ $(echo $remote_host | cut -c1-3) = ibm && $(echo $string | cut -c1-3) = ibm ]] |
---|
701 | then |
---|
702 | cpp_options="${cpp_options},-D__ibm" |
---|
703 | elif [[ $(echo $remote_host | cut -c1-3) = nec && $(echo $string | cut -c1-3) = nec ]] |
---|
704 | then |
---|
705 | cpp_options="${cpp_options} -D__nec" |
---|
706 | else |
---|
707 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
708 | then |
---|
709 | cpp_options="${cpp_options},-D__$string" |
---|
710 | else |
---|
711 | cpp_options="$cpp_options -D__$string " |
---|
712 | fi |
---|
713 | fi |
---|
714 | done |
---|
715 | |
---|
716 | |
---|
717 | |
---|
718 | # NETCDF-OPTIONEN ERMITTELN |
---|
719 | line="" |
---|
720 | grep "$remote_host_string" $config_file | grep "%netcdf_inc" > $tmp_mbuild |
---|
721 | while read line1 |
---|
722 | do |
---|
723 | |
---|
724 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
725 | then |
---|
726 | line="$line1" |
---|
727 | fi |
---|
728 | |
---|
729 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
730 | then |
---|
731 | # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN |
---|
732 | netcdf_inc=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
733 | fi |
---|
734 | |
---|
735 | done < $tmp_mbuild |
---|
736 | |
---|
737 | line="" |
---|
738 | grep "$remote_host_string" $config_file | grep "%netcdf_lib" > $tmp_mbuild |
---|
739 | while read line1 |
---|
740 | do |
---|
741 | |
---|
742 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
743 | then |
---|
744 | line="$line1" |
---|
745 | fi |
---|
746 | |
---|
747 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
748 | then |
---|
749 | # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN |
---|
750 | netcdf_lib=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
751 | fi |
---|
752 | |
---|
753 | done < $tmp_mbuild |
---|
754 | |
---|
755 | |
---|
756 | |
---|
757 | # get make options |
---|
758 | line="" |
---|
759 | found=false |
---|
760 | grep "$remote_host_string" $config_file | grep "%mopts" > $tmp_mbuild |
---|
761 | while read line1 |
---|
762 | do |
---|
763 | |
---|
764 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
765 | then |
---|
766 | line="$line1" |
---|
767 | fi |
---|
768 | |
---|
769 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
770 | then |
---|
771 | # remove colons from directive string |
---|
772 | make_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
773 | |
---|
774 | fi |
---|
775 | |
---|
776 | done < $tmp_mbuild |
---|
777 | |
---|
778 | |
---|
779 | |
---|
780 | # COMPILEROPTIONEN ERMITTELN |
---|
781 | line="" |
---|
782 | found=false |
---|
783 | grep "$remote_host_string" $config_file | grep "%fopts" > $tmp_mbuild |
---|
784 | while read line1 |
---|
785 | do |
---|
786 | |
---|
787 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
788 | then |
---|
789 | line="$line1" |
---|
790 | fi |
---|
791 | |
---|
792 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
793 | then |
---|
794 | # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN |
---|
795 | compiler_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
796 | found=true |
---|
797 | |
---|
798 | # NETCDF-INCLUDEVERZEICHNIS HINZUFUEGEN |
---|
799 | compiler_options="$compiler_options $netcdf_inc" |
---|
800 | fi |
---|
801 | |
---|
802 | done < $tmp_mbuild |
---|
803 | |
---|
804 | if [[ $found = false ]] |
---|
805 | then |
---|
806 | printf "\n +++ no compiler options found in configuration file" |
---|
807 | printf "\n for \"$remote_host_string\" " |
---|
808 | locat=config_file; exit |
---|
809 | fi |
---|
810 | |
---|
811 | |
---|
812 | |
---|
813 | # get modules to be loaded |
---|
814 | line="" |
---|
815 | grep "$remote_host_string" $config_file | grep "%modules" > $tmp_mbuild |
---|
816 | while read line1 |
---|
817 | do |
---|
818 | |
---|
819 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
820 | then |
---|
821 | line="$line1" |
---|
822 | fi |
---|
823 | |
---|
824 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
825 | then |
---|
826 | # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN |
---|
827 | modules=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
828 | fi |
---|
829 | |
---|
830 | done < $tmp_mbuild |
---|
831 | |
---|
832 | |
---|
833 | |
---|
834 | |
---|
835 | # LADER-OPTIONEN ERMITTELN |
---|
836 | line="" |
---|
837 | found=false |
---|
838 | grep "$remote_host_string" $config_file | grep "%lopts" > $tmp_mbuild |
---|
839 | while read line1 |
---|
840 | do |
---|
841 | |
---|
842 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] |
---|
843 | then |
---|
844 | line="$line1" |
---|
845 | fi |
---|
846 | |
---|
847 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
848 | then |
---|
849 | # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN |
---|
850 | loader_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
851 | found=true |
---|
852 | |
---|
853 | # NETCDF-LIBRARY HINZUFUEGEN |
---|
854 | loader_options="$loader_options $netcdf_lib" |
---|
855 | fi |
---|
856 | |
---|
857 | done < $tmp_mbuild |
---|
858 | |
---|
859 | if [[ $found = false ]] |
---|
860 | then |
---|
861 | printf "\n +++ no loader options found in configuration file" |
---|
862 | printf "\n for \"$remote_host_string\" " |
---|
863 | locat=config_file; exit |
---|
864 | fi |
---|
865 | |
---|
866 | |
---|
867 | printf "\n\n#------------------------------------------------------------------------# \n" |
---|
868 | if [[ $remote_host = $local_host ]] |
---|
869 | then |
---|
870 | column1="remote_host:"; column2="$remote_host (= local host!)" |
---|
871 | else |
---|
872 | column1="remote_host:"; column2=$remote_host |
---|
873 | fi |
---|
874 | printf "| $column1$column2 | \n" |
---|
875 | printf "| | \n" |
---|
876 | column1="conditions:"; column2="$condition1 $condition2" |
---|
877 | printf "| $column1$column2 | \n" |
---|
878 | column1="make depository:"; column2=$remote_md |
---|
879 | printf "| $column1$column2 | \n" |
---|
880 | line=$(echo "$remote_md" | cut -c51-) |
---|
881 | while [[ "$line" != "" ]] |
---|
882 | do |
---|
883 | column1="" |
---|
884 | column2=$line |
---|
885 | printf "| $column1$column2 | \n" |
---|
886 | line=$(echo "$line" | cut -c51-) |
---|
887 | done |
---|
888 | if [[ $compile_utility_programs = true ]] |
---|
889 | then |
---|
890 | column1="utility directory:"; column2=$remote_ud |
---|
891 | printf "| $column1$column2 | \n" |
---|
892 | fi |
---|
893 | column1="username:"; column2=$remote_username |
---|
894 | printf "| $column1$column2 | \n" |
---|
895 | column1="addres:"; column2=$remote_addres |
---|
896 | printf "| $column1$column2 | \n" |
---|
897 | column1="compiler:"; column2=$compiler_name |
---|
898 | printf "| $column1$column2 | \n" |
---|
899 | if [[ $compile_utility_programs = true ]] |
---|
900 | then |
---|
901 | column1="serial compiler:"; column2=$compiler_name_ser |
---|
902 | printf "| $column1$column2 | \n" |
---|
903 | fi |
---|
904 | if [[ "$make_options" != "" ]] |
---|
905 | then |
---|
906 | column1="make options:"; column2=$make_options |
---|
907 | printf "| $column1$column2 | \n" |
---|
908 | fi |
---|
909 | column1="cpp options:"; column2=$cpp_options |
---|
910 | printf "| $column1$column2 | \n" |
---|
911 | line=$(echo "$cpp_options" | cut -c51-) |
---|
912 | while [[ "$line" != "" ]] |
---|
913 | do |
---|
914 | column1="" |
---|
915 | column2=$line |
---|
916 | printf "| $column1$column2 | \n" |
---|
917 | line=$(echo "$line" | cut -c51-) |
---|
918 | done |
---|
919 | column1="compiler options:"; column2=$compiler_options |
---|
920 | printf "| $column1$column2 | \n" |
---|
921 | line=$(echo "$compiler_options" | cut -c51-) |
---|
922 | while [[ "$line" != "" ]] |
---|
923 | do |
---|
924 | column1="" |
---|
925 | column2=$line |
---|
926 | printf "| $column1$column2 | \n" |
---|
927 | line=$(echo "$line" | cut -c51-) |
---|
928 | done |
---|
929 | column1="loader options:"; column2=$loader_options |
---|
930 | printf "| $column1$column2 | \n" |
---|
931 | line=$(echo "$loader_options" | cut -c51-) |
---|
932 | while [[ "$line" != "" ]] |
---|
933 | do |
---|
934 | column1="" |
---|
935 | column2=$line |
---|
936 | printf "| $column1$column2 | \n" |
---|
937 | line=$(echo "$line" | cut -c51-) |
---|
938 | done |
---|
939 | if [[ $modules != "" ]] |
---|
940 | then |
---|
941 | column1="modules to be load:"; column2=$modules |
---|
942 | printf "| $column1$column2 | \n" |
---|
943 | line=$(echo "$modules" | cut -c51-) |
---|
944 | while [[ "$line" != "" ]] |
---|
945 | do |
---|
946 | column1="" |
---|
947 | column2=$line |
---|
948 | printf "| $column1$column2 | \n" |
---|
949 | line=$(echo "$line" | cut -c51-) |
---|
950 | done |
---|
951 | fi |
---|
952 | printf "#------------------------------------------------------------------------# \n" |
---|
953 | |
---|
954 | if [[ $silent = false ]] |
---|
955 | then |
---|
956 | answer=dummy |
---|
957 | printf "\n\n" |
---|
958 | while [[ "$answer" != y && "$answer" != Y && "$answer" != c && "$answer" != C && "$answer" != s && "$answer" != S && "$answer" != a && "$answer" != A ]] |
---|
959 | do |
---|
960 | printf " >>> continue (y(es)/c(ontinue)/a(bort)/s(skip)) ? " |
---|
961 | read answer |
---|
962 | done |
---|
963 | if [[ $answer = a || $answer = A ]] |
---|
964 | then |
---|
965 | locat=user_abort; exit |
---|
966 | fi |
---|
967 | if [[ $answer = c || $answer = C ]] |
---|
968 | then |
---|
969 | silent=true |
---|
970 | fi |
---|
971 | if [[ $answer = s || $answer = S ]] |
---|
972 | then |
---|
973 | continue |
---|
974 | fi |
---|
975 | fi |
---|
976 | |
---|
977 | |
---|
978 | # make on remote host |
---|
979 | if [[ $remote_host != $local_host ]] |
---|
980 | then |
---|
981 | |
---|
982 | if [[ $compile_utility_programs = false ]] |
---|
983 | then |
---|
984 | |
---|
985 | # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN |
---|
986 | # FALLS DIESES NOCH NICHT EXISTIERT, WIRD ES ERZEUGT |
---|
987 | echo " *** copying \"${mainprog}_sources.tar\" to \"${remote_addres}:${remote_md}/\" " |
---|
988 | if [[ $remote_host != lctit ]] |
---|
989 | then |
---|
990 | ssh ${remote_username}@${remote_addres} "[[ ! -d ${remote_md} ]] && (echo \" *** ${remote_md} will be created\"; mkdir -p ${remote_md})" |
---|
991 | else |
---|
992 | # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS |
---|
993 | # MIT SSH, DESHALB AUFRUF PER PIPE |
---|
994 | print "[[ ! -d ${remote_md} ]] && (echo \" *** ${remote_md} will be created\"; mkdir -p ${remote_md})" | ssh ${remote_username}@${remote_addres} 2>&1 |
---|
995 | fi |
---|
996 | if [[ $local_host = decalpha ]] |
---|
997 | then |
---|
998 | # DECALPHA BENUTZT BEI NICHTANGABE DES VOLLSTï¿œNDIGEN PFADES |
---|
999 | # IRGENDEIN ANDERES SCP (WAS NICHT FUNKTIONIERT). AUSSERDEM |
---|
1000 | # KOENNEN DOLLAR-ZEICHEN NICHT BENUTZT WERDEN |
---|
1001 | remote_md=`echo $remote_md | sed 's/\$HOME\///'` |
---|
1002 | /bin/scp ${local_source_path}/${mainprog}_sources.tar ${remote_username}@${remote_addres}:${remote_md}/${mainprog}_sources.tar |
---|
1003 | else |
---|
1004 | scp ${local_source_path}/${mainprog}_sources.tar ${remote_username}@${remote_addres}:${remote_md}/${mainprog}_sources.tar |
---|
1005 | fi |
---|
1006 | |
---|
1007 | |
---|
1008 | |
---|
1009 | # FALLS VORHANDEN, LETZTE VERSION AUF DEM REMOTE-RECHNER AUSPACKEN |
---|
1010 | echo " *** untar previous update on remote host, if existing" |
---|
1011 | if [[ $remote_host != lctit ]] |
---|
1012 | then |
---|
1013 | ssh ${remote_username}@${remote_addres} "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]] && tar -xf ${mainprog}_current_version.tar" |
---|
1014 | else |
---|
1015 | # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS |
---|
1016 | # MIT SSH, DESHALB AUFRUF PER PIPE |
---|
1017 | print "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]] && tar -xf ${mainprog}_current_version.tar" | ssh ${remote_username}@${remote_addres} 2>&1 |
---|
1018 | fi |
---|
1019 | |
---|
1020 | |
---|
1021 | # AKTUELLE QUELLTEXTVERSION AUF REMOTE-RECHNER AUSPACKEN |
---|
1022 | echo " *** untar actual sources on remote host" |
---|
1023 | if [[ $remote_host != lctit ]] |
---|
1024 | then |
---|
1025 | ssh ${remote_username}@${remote_addres} "cd ${remote_md}; tar -xf ${mainprog}_sources.tar" |
---|
1026 | else |
---|
1027 | # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS |
---|
1028 | # MIT SSH, DESHALB AUFRUF PER PIPE |
---|
1029 | print "cd ${remote_md}; tar -xf ${mainprog}_sources.tar" | ssh ${remote_username}@${remote_addres} 2>&1 |
---|
1030 | fi |
---|
1031 | |
---|
1032 | |
---|
1033 | # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF REMOTE RECHNER AUSFUEHREN |
---|
1034 | # KOMMANDOUEBERGABE AN SSH PER PIPE, DA SO DIE SYSTEM- UND |
---|
1035 | # BENUTZERPROFILE VOLLSTAENDIG AUSGEFUEHRT WERDEN (SONST FEHLEN MAKE |
---|
1036 | # Z.B. DIE PFADE ZUM COMPILER) |
---|
1037 | echo " *** execute \"make\" on remote host" |
---|
1038 | |
---|
1039 | |
---|
1040 | # generate make call with make options |
---|
1041 | if [[ $remote_host = nech ]] |
---|
1042 | then |
---|
1043 | make_call_string="sxmake $make_options PROG=$mainprog F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$loader_options\" " |
---|
1044 | else |
---|
1045 | make_call_string="make $make_options PROG=$mainprog F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$loader_options\" " |
---|
1046 | fi |
---|
1047 | |
---|
1048 | # generate command to load modules, if modules are given |
---|
1049 | if [[ "$modules" != "" ]] |
---|
1050 | then |
---|
1051 | if [[ $remote_host = lctit ]] |
---|
1052 | then |
---|
1053 | module_calls=". $modules" |
---|
1054 | else |
---|
1055 | module_calls="module load ${modules};" |
---|
1056 | fi |
---|
1057 | |
---|
1058 | # bugfix for wrong netcdf module |
---|
1059 | if [[ $remote_host = lcsgib || $remote_host = lcsgih ]] |
---|
1060 | then |
---|
1061 | if [[ $(echo $module_calls | grep -c netcdf/3.6.3-intel) != 0 ]] |
---|
1062 | then |
---|
1063 | module_calls="$module_calls export LD_LIBRARY_PATH=/sw/dataformats/netcdf/3.6.3-intel/lib:\$LD_LIBRARY_PATH;" |
---|
1064 | fi |
---|
1065 | fi |
---|
1066 | else |
---|
1067 | module_calls="" |
---|
1068 | fi |
---|
1069 | |
---|
1070 | if [[ $remote_host = ibmkisti || $remote_host = ibms || $remote_host = ibmy ]] |
---|
1071 | then |
---|
1072 | |
---|
1073 | ssh ${remote_username}@${remote_addres} "$module_calls cd ${remote_md}; echo '$make_call_string' > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1074 | |
---|
1075 | elif [[ $remote_host = ibmh ]] |
---|
1076 | then |
---|
1077 | |
---|
1078 | print "$module_calls export OBJECT_MODE=64; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1079 | |
---|
1080 | elif [[ $remote_host = lcsgib || $remote_host = lcsgih ]] |
---|
1081 | then |
---|
1082 | |
---|
1083 | # print ". /usr/share/modules/init/bash; $module_calls cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1084 | print "eval \`/sw/swdist/bin/modulesinit\`; $module_calls cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1085 | |
---|
1086 | elif [[ $remote_host = lctit ]] |
---|
1087 | then |
---|
1088 | |
---|
1089 | echo " " > ${remote_host}_last_make_protokoll |
---|
1090 | while [[ $(cat ${remote_host}_last_make_protokoll | grep -c "Forwarding to N1GE") = 0 ]] |
---|
1091 | do |
---|
1092 | print "cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1093 | done |
---|
1094 | |
---|
1095 | elif [[ $remote_host = lcxt4 ]] |
---|
1096 | then |
---|
1097 | |
---|
1098 | ssh ${remote_username}@${remote_addres} ". /opt/modules/default/init/ksh; $module_calls cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1099 | |
---|
1100 | else |
---|
1101 | |
---|
1102 | print "cd $module_calls ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1103 | |
---|
1104 | fi |
---|
1105 | |
---|
1106 | if [[ $(grep -c MAKE_ERROR ${remote_host}_last_make_protokoll) != 0 ]] |
---|
1107 | then |
---|
1108 | printf "\a\n +++ error(s) occurred during compiling or linking on host \"$remote_host\" " |
---|
1109 | if [[ $silent = false ]] |
---|
1110 | then |
---|
1111 | answer=dummy |
---|
1112 | printf "\n" |
---|
1113 | while [[ "$answer" != c && "$answer" != k ]] |
---|
1114 | do |
---|
1115 | printf " >>> continue / list errors / kill mbuild (c/l/k) ? " |
---|
1116 | read answer |
---|
1117 | if [[ "$answer" = l ]] |
---|
1118 | then |
---|
1119 | more ${remote_host}_last_make_protokoll |
---|
1120 | fi |
---|
1121 | done |
---|
1122 | if [[ $answer = k ]] |
---|
1123 | then |
---|
1124 | locat=user_abort; exit |
---|
1125 | fi |
---|
1126 | fi |
---|
1127 | fi |
---|
1128 | |
---|
1129 | |
---|
1130 | |
---|
1131 | # NEUE VERSION AUF REMOTE-RECHNER ZUSAMMENPACKEN |
---|
1132 | printf "\n *** tar update on remote host ..." |
---|
1133 | if [[ $remote_host != lctit ]] |
---|
1134 | then |
---|
1135 | ssh ${remote_username}@${remote_addres} "cd ${remote_md}; chmod u+w *; tar -cf ${mainprog}_current_version.tar ${mainprog} *.f90 *.o *.mod" |
---|
1136 | else |
---|
1137 | # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS |
---|
1138 | # MIT SSH, DESHALB AUFRUF PER PIPE |
---|
1139 | print "cd ${remote_md}; chmod u+w *; tar -cf ${mainprog}_current_version.tar ${mainprog} *.f90 *.o *.mod" | ssh ${remote_username}@${remote_addres} 2>&1 |
---|
1140 | fi |
---|
1141 | |
---|
1142 | |
---|
1143 | # AKTUELLES VERSIONSVERZEICHNIS AUF REMOTE-RECHNER BEREINIGEN |
---|
1144 | # printf "\n *** \"make clean\" on remote host ..." |
---|
1145 | # ssh ${remote_username}@${remote_addres} "cd ${remote_md}; make clean; rm ${mainprog}_sources.tar; rm *.f90 Makefile" |
---|
1146 | # printf "\n" |
---|
1147 | |
---|
1148 | |
---|
1149 | |
---|
1150 | |
---|
1151 | # GLEICHE AKTIONEN FUER DIE UTILITY-PROGRAMME DURCHFUEHREN |
---|
1152 | # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN |
---|
1153 | # FALLS DIESES NOCH NICHT EXISTIERT, WIRD ES ERZEUGT |
---|
1154 | elif [[ $compile_utility_programs = true ]] |
---|
1155 | then |
---|
1156 | |
---|
1157 | printf "\n\n" |
---|
1158 | echo " *** copying scripts and utility programs to \"${remote_addres}:${remote_ud}/\" " |
---|
1159 | cd ${local_source_path}/../SCRIPTS |
---|
1160 | |
---|
1161 | if [[ $remote_host != lctit ]] |
---|
1162 | then |
---|
1163 | ssh ${remote_username}@${remote_addres} "[[ ! -d ${remote_ud} ]] && (echo \" *** ${remote_ud} will be created\"; mkdir -p ${remote_ud}); [[ ! -d ${remote_ud}/../SCRIPTS ]] && (echo \" *** ${remote_ud}/../SCRIPTS will be created\"; mkdir -p ${remote_ud}/../SCRIPTS)" |
---|
1164 | else |
---|
1165 | # TIT ERLAUBT NUR DIE AUSFUEHRUNG GANZ BESTIMMTER KOMMANDOS |
---|
1166 | # MIT SSH, DESHALB AUFRUF PER PIPE |
---|
1167 | print "[[ ! -d ${remote_ud} ]] && (echo \" *** ${remote_ud} will be created\"; mkdir -p ${remote_ud}); [[ ! -d ${remote_ud}/../SCRIPTS ]] && (echo \" *** ${remote_ud}/../SCRIPTS will be created\"; mkdir -p ${remote_ud}/../SCRIPTS)" | ssh ${remote_username}@${remote_addres} 2>&1 |
---|
1168 | fi |
---|
1169 | |
---|
1170 | # KOPIEREN DER SCRIPTE |
---|
1171 | if [[ $local_host = decalpha ]] |
---|
1172 | then |
---|
1173 | # DECALPHA BENUTZT BEI NICHTANGABE DES VOLLSTAENDIGEN PFADES |
---|
1174 | # IRGENDEIN ANDERES SCP (WAS NICHT FUNKTIONIERT). AUSSERDEM |
---|
1175 | # KOENNEN DOLLAR-ZEICHEN NICHT BENUTZT WERDEN |
---|
1176 | remote_ud=`echo $remote_ud | sed 's/\$HOME\///'` |
---|
1177 | /bin/scp batch_scp mbuild mrun process_dvr_output .dvrserver.config subjob ${remote_username}@${remote_addres}:${remote_ud}/../SCRIPTS > /dev/null |
---|
1178 | else |
---|
1179 | scp batch_scp mbuild mrun process_dvr_output .dvrserver.config subjob ${remote_username}@${remote_addres}:${remote_ud}/../SCRIPTS > /dev/null |
---|
1180 | fi |
---|
1181 | |
---|
1182 | cd - > /dev/null |
---|
1183 | cd ${local_source_path}/../UTIL |
---|
1184 | |
---|
1185 | |
---|
1186 | # KOPIEREN DER UTILITY-PROGRAMME |
---|
1187 | if [[ $local_host = decalpha ]] |
---|
1188 | then |
---|
1189 | # DECALPHA BENUTZT BEI NICHTANGABE DES VOLLSTï¿œNDIGEN PFADES |
---|
1190 | # IRGENDEIN ANDERES SCP (WAS NICHT FUNKTIONIERT). AUSSERDEM |
---|
1191 | # KOENNEN DOLLAR-ZEICHEN NICHT BENUTZT WERDEN |
---|
1192 | remote_ud=`echo $remote_ud | sed 's/\$HOME\///'` |
---|
1193 | /bin/scp Makefile *.f90 ${remote_username}@${remote_addres}:${remote_ud} > /dev/null |
---|
1194 | else |
---|
1195 | scp Makefile *.f90 ${remote_username}@${remote_addres}:${remote_ud} > /dev/null |
---|
1196 | fi |
---|
1197 | |
---|
1198 | |
---|
1199 | |
---|
1200 | # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF REMOTE RECHNER AUSFUEHREN |
---|
1201 | # KOMMANDOUEBERGABE AN SSH PER PIPE, DA SO DIE SYSTEM- UND |
---|
1202 | # BENUTZERPROFILE VOLLSTAENDIG AUSGEFUEHRT WERDEN (SONST FEHLEN MAKE |
---|
1203 | # Z.B. DIE PFADE ZUM COMPILER) |
---|
1204 | echo " *** execute \"make\" on remote host" |
---|
1205 | |
---|
1206 | if [[ $remote_host = nech ]] |
---|
1207 | then |
---|
1208 | make_call_string="sxmake $make_options BLOCK=$block F90=$compiler_name F90_SER=$compiler_name_ser COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$loader_options\" " |
---|
1209 | else |
---|
1210 | make_call_string="make $make_options BLOCK=$block F90=$compiler_name F90_SER=$compiler_name_ser COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$loader_options\" " |
---|
1211 | fi |
---|
1212 | |
---|
1213 | # generate command to load modules, if modules are given |
---|
1214 | if [[ "$modules" != "" ]] |
---|
1215 | then |
---|
1216 | if [[ $remote_host = lctit ]] |
---|
1217 | then |
---|
1218 | module_calls=". $modules" |
---|
1219 | else |
---|
1220 | module_calls="module load ${modules};" |
---|
1221 | fi |
---|
1222 | |
---|
1223 | # bugfix for wrong netcdf module |
---|
1224 | if [[ $remote_host = lcsgib || $remote_host = lcsgih ]] |
---|
1225 | then |
---|
1226 | if [[ $(echo $module_calls | grep -c netcdf/3.6.3-intel) != 0 ]] |
---|
1227 | then |
---|
1228 | module_calls="$module_calls export LD_LIBRARY_PATH=/sw/dataformats/netcdf/3.6.3-intel/lib:\$LD_LIBRARY_PATH;" |
---|
1229 | fi |
---|
1230 | fi |
---|
1231 | else |
---|
1232 | module_calls="" |
---|
1233 | fi |
---|
1234 | |
---|
1235 | if [[ $remote_host = ibms || $remote_host = ibmy ]] |
---|
1236 | then |
---|
1237 | |
---|
1238 | ssh ${remote_username}@${remote_addres} "$module_calls cd ${remote_ud}; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" |
---|
1239 | |
---|
1240 | elif [[ $remote_host = ibmh ]] |
---|
1241 | then |
---|
1242 | |
---|
1243 | print "$module_calls export OBJECT_MODE=64; cd ${remote_ud}; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} |
---|
1244 | |
---|
1245 | elif [[ $remote_host = lctit ]] |
---|
1246 | then |
---|
1247 | |
---|
1248 | echo " " > ${remote_host}_last_make_protokoll |
---|
1249 | while [[ $(cat ${remote_host}_last_make_protokoll | grep -c "Forwarding to N1GE") = 0 ]] |
---|
1250 | do |
---|
1251 | print "$module_calls cd ${remote_ud}; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1252 | done |
---|
1253 | |
---|
1254 | elif [[ $remote_host = lcxt4 ]] |
---|
1255 | then |
---|
1256 | |
---|
1257 | ssh ${remote_username}@${remote_addres} ". /opt/modules/default/init/ksh; $module_calls cd ${remote_ud}; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1258 | |
---|
1259 | else |
---|
1260 | |
---|
1261 | print "$module_calls cd ${remote_ud}; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1262 | |
---|
1263 | fi |
---|
1264 | |
---|
1265 | fi # ENDE UEBERSETZUNG DER UTILITY-PROGRAMME |
---|
1266 | |
---|
1267 | rm -rf ${remote_host}_last_make_protokoll |
---|
1268 | |
---|
1269 | # make on local host |
---|
1270 | else |
---|
1271 | |
---|
1272 | # workaround for lcxt4 |
---|
1273 | if [[ $remote_host = lcxt4 ]] |
---|
1274 | then |
---|
1275 | . /opt/modules/default/init/ksh |
---|
1276 | fi |
---|
1277 | |
---|
1278 | # first load modules, if given |
---|
1279 | if [[ "$modules" != "" ]] |
---|
1280 | then |
---|
1281 | if [[ $remote_host = lctit ]] |
---|
1282 | then |
---|
1283 | . $modules |
---|
1284 | else |
---|
1285 | module load ${modules} |
---|
1286 | fi |
---|
1287 | fi |
---|
1288 | |
---|
1289 | |
---|
1290 | if [[ $compile_utility_programs = false ]] |
---|
1291 | then |
---|
1292 | |
---|
1293 | # DEPOSITORY VERZEICHNIS ERZEUGEN, FALLS NOCH NICHT VORHANDEN |
---|
1294 | eval remote_md=$remote_md |
---|
1295 | if [[ ! -d $remote_md ]] |
---|
1296 | then |
---|
1297 | if mkdir $remote_md |
---|
1298 | then |
---|
1299 | printf "\n\n *** directory for make depository:" |
---|
1300 | printf "\n $remote_md" |
---|
1301 | printf "\n was created\n" |
---|
1302 | else |
---|
1303 | printf "\n +++ directory for make depository:" |
---|
1304 | printf "\n $remote_md" |
---|
1305 | printf "\n cannot be created" |
---|
1306 | locat=local_depository_path; exit |
---|
1307 | fi |
---|
1308 | fi |
---|
1309 | |
---|
1310 | # QUELLTEXT-DATEIEN AUS REPOSITORY INS DEPOSITORY KOPIEREN |
---|
1311 | echo " " |
---|
1312 | echo " *** updating sources in $remote_md" |
---|
1313 | cd $remote_md |
---|
1314 | cp $local_source_path/${mainprog}_sources.tar . |
---|
1315 | tar xf ${mainprog}_sources.tar |
---|
1316 | |
---|
1317 | # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF LOKALEM RECHNER AUSFUEHREN |
---|
1318 | echo " " |
---|
1319 | echo " *** execute \"make\" on local host" |
---|
1320 | |
---|
1321 | make $make_options PROG=$mainprog F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$loader_options" 2>&1 | tee ${remote_host}_last_make_protokoll |
---|
1322 | |
---|
1323 | if [[ $? != 0 ]] |
---|
1324 | then |
---|
1325 | printf "\a\n +++ error(s) occurred during compiling or linking on host \"$remote_host\" " |
---|
1326 | if [[ $silent = false ]] |
---|
1327 | then |
---|
1328 | answer=dummy |
---|
1329 | printf "\n" |
---|
1330 | while [[ "$answer" != c && "$answer" != k ]] |
---|
1331 | do |
---|
1332 | printf " >>> continue / list errors / kill mbuild (c/l/k) ? " |
---|
1333 | read answer |
---|
1334 | if [[ "$answer" = l ]] |
---|
1335 | then |
---|
1336 | more ${remote_host}_last_make_protokoll |
---|
1337 | fi |
---|
1338 | done |
---|
1339 | if [[ $answer = k ]] |
---|
1340 | then |
---|
1341 | locat=user_abort; exit |
---|
1342 | fi |
---|
1343 | fi |
---|
1344 | fi |
---|
1345 | |
---|
1346 | |
---|
1347 | # TAR NEW VERSION ON LOCAL HOST |
---|
1348 | printf "\n *** tar update on local host ..." |
---|
1349 | tar -cf ${mainprog}_current_version.tar *.$suf *.o *.mod |
---|
1350 | |
---|
1351 | |
---|
1352 | # COMPILE THE UTILITY PROGRAMS |
---|
1353 | elif [[ $compile_utility_programs = true ]] |
---|
1354 | then |
---|
1355 | printf "\n\n" |
---|
1356 | echo " *** compiling the utility programs ..." |
---|
1357 | cd ${local_source_path}/../UTIL |
---|
1358 | |
---|
1359 | # TOUCH FILES IN ORDER TO FORCE COMPILATION FOR EVERY BLOCK |
---|
1360 | touch *.f90 |
---|
1361 | make $make_options BLOCK=$block F90=$compiler_name F90_SER=$compiler_name_ser COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$loader_options" |
---|
1362 | cd - > /dev/null |
---|
1363 | fi |
---|
1364 | |
---|
1365 | fi |
---|
1366 | |
---|
1367 | done |
---|
1368 | |
---|
1369 | |
---|
1370 | if [[ $host_found = false ]] |
---|
1371 | then |
---|
1372 | if [[ $host = all ]] |
---|
1373 | then |
---|
1374 | printf "\n +++ no hosts found in configuration file" |
---|
1375 | else |
---|
1376 | printf "\n +++ host \"$host\" not found in configuration file" |
---|
1377 | fi |
---|
1378 | locat=config_file; exit |
---|
1379 | fi |
---|
1380 | |
---|
1381 | |
---|
1382 | |
---|
1383 | # FINAL WORK |
---|
1384 | rm -f hosts_found_in_config_file |
---|
1385 | |
---|