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