Changeset 3236 for palm/trunk/SCRIPTS/palmbuild
- Timestamp:
- Sep 10, 2018 9:07:06 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmbuild
r3210 r3236 27 27 # ----------------- 28 28 # $Id$ 29 # "host identifier" in header output renamed "config. identifier", 30 # host_configuration renamed configuration_identifier, 31 # jobname renamed run_identifier 32 # header output of PALM code revision, 33 # options -m, -s, and -S removed 34 # 35 # 3210 2018-08-28 07:31:13Z sward 29 36 # Bugfix: agent_preprocessing stays in MAKE_DEPOSITORY after compilation 30 37 # … … 77 84 column1="" 78 85 column2="" 79 host_configuration=default 86 configuration_identifier=default 87 global_revision="" 80 88 locat=normal 81 89 makefile="" … … 95 103 # ERROR HANDLING 96 104 # IN CASE OF EXIT: 97 trap 'rm -rf ${source_path}/${ host_configuration}_last_make_protocol105 trap 'rm -rf ${source_path}/${configuration_identifier}_last_make_protocol 98 106 if [[ $locat != normal ]] 99 107 then … … 112 120 # IN CASE OF TERMINAL-BREAK: 113 121 trap 'printf "\n\n +++ palmbuild killed by \"^C\" \n\n" 114 rm ${source_path}/${ host_configuration}_last_make_protocol122 rm ${source_path}/${configuration_identifier}_last_make_protocol 115 123 exit 116 124 ' 2 … … 119 127 120 128 # READ SHELLSCRIPT-OPTIONS 121 while getopts :d:h: m:s:S:uvV option129 while getopts :d:h:uvV option 122 130 do 123 131 case $option in 124 (d) jobname=$OPTARG;; 125 (h) host_configuration=$OPTARG;; 126 (m) makefile=$OPTARG;; 127 (s) suf=$OPTARG;; 128 (S) source_list="$OPTARG";; 132 (d) run_identifier=$OPTARG;; 133 (h) configuration_identifier=$OPTARG;; 129 134 (v) silent=true;; 130 135 (V) use_existing_sources_folder=true;; … … 135 140 136 141 137 # FOR COMPATIBILITY REASONS SET OLD ENVIRONMENT VARIABLE 138 export fname=$jobname 142 # FOR COMPATIBILITY REASONS SET OLD ENVIRONMENT VARIABLES 143 export fname=$run_identifier 144 export jobname=$run_identifier 139 145 140 146 141 147 # BUILD THE CONFIGURATION-FILE NAME AND THE SOURCES_FOR_RUN-FOLDER NAME 142 config_file=.palm.config.$ host_configuration143 sources_for_run_catalog=SOURCES_FOR_RUN_${ host_configuration}_$jobname148 config_file=.palm.config.$configuration_identifier 149 sources_for_run_catalog=SOURCES_FOR_RUN_${configuration_identifier}_$run_identifier 144 150 145 151 … … 249 255 250 256 # CHECK MAKEFILE 251 [[ "$makefile" = "" ]] &&makefile=$source_path/Makefile257 makefile=$source_path/Makefile 252 258 if [[ ! -f $makefile ]] 253 259 then … … 312 318 313 319 line=`grep %base_directory $config_file` 314 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${ host_configuration}320 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${configuration_identifier} 315 321 316 322 else 317 323 318 make_depository=${base_directory}/MAKE_DEPOSITORY_${host_configuration} 319 320 fi 324 make_depository=${base_directory}/MAKE_DEPOSITORY_${configuration_identifier} 325 326 fi 327 328 329 # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY 330 global_revision=`svnversion $source_path 2>/dev/null` 331 global_revision="Rev: $global_revision" 332 321 333 322 334 # HEADER-OUTPUT (PART1: MESSAGES CONCERNING THE LOCAL HOST) … … 327 339 printf "#------------------------------------------------------------------------# \n" 328 340 printf "| %-40s%30s | \n" "$version" "$calltime" 341 printf "| %-40s%30s | \n" "PALM code $global_revision" " " 329 342 printf "| | \n" 330 343 printf "| %-13s%-57s | \n" "called on:" "$(hostname) (IP:$local_ip)" … … 363 376 if [[ "$remote_ip" != "" ]] 364 377 then 365 column2="$ host_configuration"366 printf "| %-20s%-50s | \n" " host configuration:" "$column2"378 column2="$configuration_identifier" 379 printf "| %-20s%-50s | \n" "config. identifier:" "$column2" 367 380 column2=$(echo "$make_depository" | cut -c1-50 ) 368 381 printf "| %-20s%-50s | \n" "remote depository:" "$column2" 369 382 else 370 column2="$ host_configuration"371 printf "| %-20s%-50s | \n" " hostidentifier:" "$column2"383 column2="$configuration_identifier" 384 printf "| %-20s%-50s | \n" "config. identifier:" "$column2" 372 385 column2=$(echo "$make_depository" | cut -c1-50 ) 373 386 printf "| %-20s%-50s | \n" "local depository:" "$column2" … … 496 509 497 510 # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_... 498 if [[ "$ jobname" = "" ]]511 if [[ "$run_identifier" = "" ]] 499 512 then 500 513 … … 543 556 fi 544 557 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\" " 545 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_configuration}_last_make_protocol546 547 if [[ $(grep -c MAKE_ERROR ${ host_configuration}_last_make_protocol) != 0 ]]558 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 ${configuration_identifier}_last_make_protocol 559 560 if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]] 548 561 then 549 562 printf "\a\n +++ error(s) occurred during compiling or linking of utilities" 550 printf "\n for host configuration \"$ host_configuration\" "563 printf "\n for host configuration \"$configuration_identifier\" " 551 564 if [[ $silent = false ]] 552 565 then … … 559 572 if [[ "$answer" = l ]] 560 573 then 561 more ${ host_configuration}_last_make_protocol574 more ${configuration_identifier}_last_make_protocol 562 575 fi 563 576 done … … 582 595 fi 583 596 make_call_string="make $make_options PROG=$program_name F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 584 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_configuration}_last_make_protocol585 586 if [[ $(grep -c MAKE_ERROR ${ host_configuration}_last_make_protocol) != 0 ]]587 then 588 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$ host_configuration\" "597 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 ${configuration_identifier}_last_make_protocol 598 599 if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]] 600 then 601 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" " 589 602 if [[ $silent = false ]] 590 603 then … … 597 610 if [[ "$answer" = l ]] 598 611 then 599 more ${ host_configuration}_last_make_protocol612 more ${configuration_identifier}_last_make_protocol 600 613 fi 601 614 done … … 621 634 # INCLUDING E.G. USER-INTERFACE ROUTINES. ALSO ADD OTHER UTILITY EXECUTABLES. EVERYTHING IS 622 635 # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_... 623 elif [[ "$ jobname" != "" ]]636 elif [[ "$run_identifier" != "" ]] 624 637 then 625 638 626 639 # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS 627 640 # AND ASK, IF THEY SHALL BE USED 628 echo "[[ -d ${fast_io_catalog}/${sources_for_run_catalog} ]] && echo sources for run found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 > ${ host_configuration}_last_make_protocol629 if [[ $(grep -c "sources for run found" ${ host_configuration}_last_make_protocol) != 0 && $use_existing_sources_folder = true ]]630 then 631 printf "\a\n *** compiled sources for run \"$ jobname\" found on remote host in folder"641 echo "[[ -d ${fast_io_catalog}/${sources_for_run_catalog} ]] && echo sources for run found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 > ${configuration_identifier}_last_make_protocol 642 if [[ $(grep -c "sources for run found" ${configuration_identifier}_last_make_protocol) != 0 && $use_existing_sources_folder = true ]] 643 then 644 printf "\a\n *** compiled sources for run \"$run_identifier\" found on remote host in folder" 632 645 printf "\n ${fast_io_catalog}/${sources_for_run_catalog}" 633 646 printf "\n will be used!" … … 638 651 if [[ $silent = false ]] 639 652 then 640 printf "\n *** copy MAKE_DEPOSITORY_${ host_configuration} on remote host to $sources_for_run_catalog \n"653 printf "\n *** copy MAKE_DEPOSITORY_${configuration_identifier} on remote host to $sources_for_run_catalog \n" 641 654 fi 642 655 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}; mkdir -p ${fast_io_catalog}/${sources_for_run_catalog}; cp ${make_depository}/${program_name}_current_version.tar ${fast_io_catalog}/${sources_for_run_catalog}; cd ${fast_io_catalog}/${sources_for_run_catalog}; tar xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 … … 663 676 echo " *** execute \"make\" on remote host" 664 677 fi 665 echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/${sources_for_run_catalog}; 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_configuration}_last_make_protocol666 667 if [[ $(grep -c MAKE_ERROR ${ host_configuration}_last_make_protocol) != 0 ]]678 echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/${sources_for_run_catalog}; 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 ${configuration_identifier}_last_make_protocol 679 680 if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]] 668 681 then 669 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$ host_configuration\" "682 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" " 670 683 if [[ $silent = false ]] 671 684 then … … 678 691 if [[ "$answer" = l ]] 679 692 then 680 more ${ host_configuration}_last_make_protocol693 more ${configuration_identifier}_last_make_protocol 681 694 fi 682 695 done … … 701 714 fi 702 715 703 rm -rf ${source_path}/${ host_configuration}_last_make_protocol716 rm -rf ${source_path}/${configuration_identifier}_last_make_protocol 704 717 705 718 … … 710 723 # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_... ON THE 711 724 # LOCAL HOST 712 if [[ "$ jobname" = "" ]]725 if [[ "$run_identifier" = "" ]] 713 726 then 714 727 … … 774 787 fi 775 788 776 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 2>&1 | tee ${ host_configuration}_last_make_protocol789 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 2>&1 | tee ${configuration_identifier}_last_make_protocol 777 790 778 791 if [[ $? != 0 ]] 779 792 then 780 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$ host_configuration\" "793 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" " 781 794 if [[ $silent = false ]] 782 795 then … … 789 802 if [[ "$answer" = l ]] 790 803 then 791 more ${ host_configuration}_last_make_protocol804 more ${configuration_identifier}_last_make_protocol 792 805 fi 793 806 done … … 820 833 if [[ -d ${fast_io_catalog}/${sources_for_run_catalog} && $use_existing_sources_folder = true ]] 821 834 then 822 printf "\a\n *** compiled sources for run \"$ jobname\" found on local host in folder"835 printf "\a\n *** compiled sources for run \"$run_identifier\" found on local host in folder" 823 836 printf "\n ${fast_io_catalog}/${sources_for_run_catalog}" 824 837 printf "\n will be used!" … … 831 844 printf "\n +++ directory for local make depository:" 832 845 printf "\n $make_depository" 833 printf "\n not found. Please run \"palmbuild -h $ host_configuration\" "846 printf "\n not found. Please run \"palmbuild -h $configuration_identifier\" " 834 847 locat=make_depository; exit 835 848 fi … … 839 852 if [[ $silent = false ]] 840 853 then 841 printf "\n *** copy MAKE_DEPOSITORY_${ host_configuration} on local host to "854 printf "\n *** copy MAKE_DEPOSITORY_${configuration_identifier} on local host to " 842 855 printf "\n ${fast_io_catalog}/${sources_for_run_catalog} \n" 843 856 fi … … 875 888 then 876 889 877 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$ host_configuration\" "890 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" " 878 891 if [[ $silent = false ]] 879 892 then
Note: See TracChangeset
for help on using the changeset viewer.