Changeset 2420 for palm/trunk/SCRIPTS/palmbuild
- Timestamp:
- Sep 7, 2017 6:20:11 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmbuild
r2412 r2420 45 45 column1="" 46 46 column2="" 47 config_file=.palm.config 48 host=default 49 host_found=false 47 host_identifier=default 50 48 locat=normal 51 49 makefile="" … … 86 84 case $option in 87 85 (d) fname=$OPTARG;; 88 (h) host =$OPTARG;;86 (h) host_identifier=$OPTARG;; 89 87 (m) makefile=$OPTARG;; 90 88 (s) suf=$OPTARG;; … … 98 96 99 97 # BUILD THE CONFIGURATION-FILE NAME 100 config_file= ${config_file}.$host98 config_file=.palm.config.$host_identifier 101 99 102 100 … … 256 254 fi 257 255 258 [[ "$remote_hostname" = "" ]] && remote_hostname=$remote_ip259 260 261 256 # GET SOURCE AND DEPOSITORY PATH ON THE REMOTE MACHINE WITHOUT EVALUATING 262 257 # THE $ … … 272 267 273 268 line=`grep %base_directory $config_file` 274 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host }269 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host_identifier} 275 270 276 271 else 277 272 278 make_depository=${base_directory}/MAKE_DEPOSITORY_${host }273 make_depository=${base_directory}/MAKE_DEPOSITORY_${host_identifier} 279 274 280 275 fi … … 286 281 printf "| %-40s%30s | \n" "$version" "$calltime" 287 282 printf "| | \n" 288 printf "| %-13s%-57s | \n" "called on:" "$ local_hostname"283 printf "| %-13s%-57s | \n" "called on:" "$(hostname) (IP:$local_ip)" 289 284 column2=$(echo $config_file | cut -c1-57 ) 290 285 printf "| %-13s%-57s | \n" "config file:" "$column2" … … 337 332 338 333 # GET CONFIRMATION TO CONTINUE 339 printf "\n *** update will be made for host \"$host \" "334 printf "\n *** update will be made for host \"$host_identifier\" " 340 335 341 336 … … 362 357 if [[ "$remote_ip" != "" ]] 363 358 then 364 column2= $remote_hostname365 printf "| %-20s%-50s | \n" " remote host:" "$column2"359 column2="$host_identifier" 360 printf "| %-20s%-50s | \n" "host identifier:" "$column2" 366 361 printf "| | \n" 367 362 column2=$(echo "$make_depository" | cut -c1-50 ) 368 363 printf "| %-20s%-50s | \n" "remote depository:" "$column2" 369 364 else 370 column2= $local_hostname371 printf "| %-20s%-50s | \n" " local host:" "$column2"365 column2="$host_identifier" 366 printf "| %-20s%-50s | \n" "host identifier:" "$column2" 372 367 printf "| | \n" 373 368 column2=$(echo "$make_depository" | cut -c1-50 ) … … 513 508 echo " *** creating utilities on remote host" 514 509 make_call_string="make -f Makefile_utilities $make_options F90=$compiler_name F90_SER=$compiler_name_ser COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 515 echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${ remote_hostname}_last_make_protokoll516 517 if [[ $(grep -c MAKE_ERROR ${ remote_hostname}_last_make_protokoll) != 0 ]]510 echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_identifier}_last_make_protokoll 511 512 if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protokoll) != 0 ]] 518 513 then 519 514 printf "\a\n +++ error(s) occurred during compiling or linking of utilities" 520 printf "\n on host \"$remote_hostname\" "515 printf "\n for host \"$host_identifier\" " 521 516 if [[ $silent = false ]] 522 517 then … … 529 524 if [[ "$answer" = l ]] 530 525 then 531 more ${ remote_hostname}_last_make_protokoll526 more ${host_identifier}_last_make_protokoll 532 527 fi 533 528 done … … 547 542 echo " *** compile PALM sources on remote host" 548 543 make_call_string="make $make_options PROG=$program_name F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 549 echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${ remote_hostname}_last_make_protokoll550 551 if [[ $(grep -c MAKE_ERROR ${ remote_hostname}_last_make_protokoll) != 0 ]]552 then 553 printf "\a\n +++ error(s) occurred during compiling or linking on host \"$remote_hostname\" "544 echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_identifier}_last_make_protokoll 545 546 if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protokoll) != 0 ]] 547 then 548 printf "\a\n +++ error(s) occurred during compiling or linking for host \"$host_identifier\" " 554 549 if [[ $silent = false ]] 555 550 then … … 562 557 if [[ "$answer" = l ]] 563 558 then 564 more ${ remote_hostname}_last_make_protokoll559 more ${host_identifier}_last_make_protokoll 565 560 fi 566 561 done … … 584 579 585 580 # FIRST CHECK, IF A DEPOSITORY EXISTS ON THE REMOTE MACHINE 586 echo "[[ ! -d ${make_depository} ]] && echo depository not found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${ remote_hostname}_last_make_protokoll581 echo "[[ ! -d ${make_depository} ]] && echo depository not found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_identifier}_last_make_protokoll 587 582 588 583 589 584 # COPY MAKE DEPOSITORY ON REMOTE MACHINE TO SOURCES_FOR_RUN_... 590 printf "\n *** copy MAKE_DEPOSITORY_${host } on remote host to SOURCES_FOR_RUN_$fname \n"585 printf "\n *** copy MAKE_DEPOSITORY_${host_identifier} on remote host to SOURCES_FOR_RUN_$fname \n" 591 586 echo "rm -rf $fast_io_catalog/SOURCES_FOR_RUN_$fname; mkdir -p $fast_io_catalog/SOURCES_FOR_RUN_$fname; cp ${make_depository}/${program_name}_current_version.tar $fast_io_catalog/SOURCES_FOR_RUN_$fname; cd $fast_io_catalog/SOURCES_FOR_RUN_$fname; tar xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 592 587 593 588 594 589 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... ON THE REMOTE MACHINE 595 printf "\n *** copy $base_directory/SOURCES_FOR_RUN_$fname to SOURCES_FOR_RUN_$fname on remote host \n" 590 printf "\n *** copy $base_directory/SOURCES_FOR_RUN_$fname" 591 printf "\n to SOURCES_FOR_RUN_$fname on remote host \n" 596 592 scp -q $ssh_key $base_directory/SOURCES_FOR_RUN_$fname/{*,.[!.]*} ${remote_username}@${remote_ip}:${fast_io_catalog}/SOURCES_FOR_RUN_$fname 597 593 … … 605 601 [[ "$module_commands" != "" ]] && module_commands=${module_commands}";" 606 602 echo " *** execute \"make\" on remote host" 607 echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/SOURCES_FOR_RUN_$fname; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${ remote_hostname}_last_make_protokoll608 609 if [[ $(grep -c MAKE_ERROR ${ remote_hostname}_last_make_protokoll) != 0 ]]603 echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/SOURCES_FOR_RUN_$fname; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_identifier}_last_make_protokoll 604 605 if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protokoll) != 0 ]] 610 606 then 611 printf "\a\n +++ error(s) occurred during compiling or linking on host \"$remote_hostname\" "607 printf "\a\n +++ error(s) occurred during compiling or linking for host \"$host_identifier\" " 612 608 if [[ $silent = false ]] 613 609 then … … 620 616 if [[ "$answer" = l ]] 621 617 then 622 more ${ remote_hostname}_last_make_protokoll618 more ${host_identifier}_last_make_protokoll 623 619 fi 624 620 done … … 638 634 fi 639 635 640 rm -rf ${ remote_hostname}_last_make_protokoll636 rm -rf ${host_identifier}_last_make_protokoll 641 637 642 638 … … 698 694 echo " *** compile PALM sources on local host" 699 695 700 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 2>&1 | tee ${ local_hostname}_last_make_protokoll696 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 2>&1 | tee ${host_identifier}_last_make_protokoll 701 697 702 698 if [[ $? != 0 ]] 703 699 then 704 printf "\a\n +++ error(s) occurred during compiling or linking on host \"$local_hostname\" "700 printf "\a\n +++ error(s) occurred during compiling or linking for host \"$host_identifier\" " 705 701 if [[ $silent = false ]] 706 702 then … … 713 709 if [[ "$answer" = l ]] 714 710 then 715 more ${ local_hostname}_last_make_protokoll711 more ${host_identifier}_last_make_protokoll 716 712 fi 717 713 done … … 739 735 printf "\n +++ directory for local make depository:" 740 736 printf "\n $make_depository" 741 printf "\n not found. Please run \"palmbuild -h $host \" "737 printf "\n not found. Please run \"palmbuild -h $host_identifier\" " 742 738 locat=make_depository; exit 743 739 fi … … 745 741 746 742 # COPY MAKE DEPOSITORY ON LOCAL MACHINE TO SOURCES_FOR_RUN_... 747 printf "\n *** copy MAKE_DEPOSITORY_${host } on local host to "743 printf "\n *** copy MAKE_DEPOSITORY_${host_identifier} on local host to " 748 744 printf "\n $fast_io_catalog/SOURCES_FOR_RUN_$fname \n" 749 745 rm -rf $fast_io_catalog/SOURCES_FOR_RUN_$fname … … 774 770 then 775 771 776 printf "\a\n +++ error(s) occurred during compiling or linking on host \"$local_hostname\" "772 printf "\a\n +++ error(s) occurred during compiling or linking for host \"$host_identifier\" " 777 773 if [[ $silent = false ]] 778 774 then
Note: See TracChangeset
for help on using the changeset viewer.