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