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