Changeset 2404 for palm/trunk/SCRIPTS/palmbuild
- Timestamp:
- Sep 5, 2017 9:33:14 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmbuild
r2396 r2404 172 172 173 173 174 # CHECK, IF THE BASE DIRECTORY PATH HAS BEEN GIVEN 175 if [[ "$base_directory" = "" ]] 176 then 177 printf "\n +++ no base directory found in configuration file" 178 locat=config_file; exit 179 else 180 if [[ ! -d $base_directory ]] 181 then 182 printf "\n\n +++ base directory \"$base_directory\" " 183 printf "\n does not exist" 184 locat=source_path; exit 185 fi 186 fi 187 188 174 189 # CHECK SOURCE-CODE PATH 175 190 if [[ "$source_path" = "" ]] … … 187 202 188 203 189 # CHECK DEPOSITORY-PATH190 if [[ "$depository_path" = "" ]]191 then192 printf "\n +++ no depository path found in configuration file"193 locat=config_file; exit194 fi195 196 197 204 # CHECK MAKEFILE 198 205 [[ "$makefile" = "" ]] && makefile=$source_path/Makefile … … 247 254 248 255 [[ "$remote_hostname" = "" ]] && remote_hostname=$remote_ip 256 249 257 250 258 # GET SOURCE AND DEPOSITORY PATH ON THE REMOTE MACHINE WITHOUT EVALUATING … … 260 268 fi 261 269 262 line=`grep %remote_depository_path $config_file` 263 if [[ "$line" != "" ]] 264 then 265 remote_depository_path=`echo $line | cut -d" " -s -f2` 266 else 267 line=`grep %depository_path $config_file` 268 remote_depository_path=`echo $line | cut -d" " -s -f2` 269 fi 270 271 remote_make_depository=${remote_depository_path}/MAKE_DEPOSITORY_${host} 270 line=`grep %base_directory $config_file` 271 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host} 272 272 273 273 else 274 274 275 local_make_depository=${depository_path}/MAKE_DEPOSITORY_${host}275 make_depository=${base_directory}/MAKE_DEPOSITORY_${host} 276 276 277 277 fi … … 362 362 printf "| %-20s%-50s | \n" "remote host:" "$column2" 363 363 printf "| | \n" 364 column2=$(echo "$ remote_make_depository" | cut -c1-50 )364 column2=$(echo "$make_depository" | cut -c1-50 ) 365 365 printf "| %-20s%-50s | \n" "remote depository:" "$column2" 366 line=$(echo "$remote_make_depository" | cut -c51-)367 while [[ "$line" != "" ]]368 do369 column1=""370 column2=$(echo "$line" | cut -c1-50 )371 printf "| %-20s%-50s | \n" "$column1" "$column2"372 line=$(echo "$line" | cut -c51-)373 done374 366 else 375 367 column2=$local_hostname 376 368 printf "| %-20s%-50s | \n" "local host:" "$column2" 377 369 printf "| | \n" 378 column2=$(echo "$ local_make_depository" | cut -c1-50 )370 column2=$(echo "$make_depository" | cut -c1-50 ) 379 371 printf "| %-20s%-50s | \n" "local depository:" "$column2" 380 line=$(echo "$local_make_depository" | cut -c51-)381 while [[ "$line" != "" ]]382 do383 column1=""384 column2=$(echo "$line" | cut -c1-50 )385 printf "| %-20s%-50s | \n" "$column1" "$column2"386 line=$(echo "$line" | cut -c51-)387 done388 fi372 fi 373 line=$(echo "$make_depository" | cut -c51-) 374 while [[ "$line" != "" ]] 375 do 376 column1="" 377 column2=$(echo "$line" | cut -c1-50 ) 378 printf "| %-20s%-50s | \n" "$column1" "$column2" 379 line=$(echo "$line" | cut -c51-) 380 done 389 381 390 382 if [[ "$remote_ip" != "" ]] … … 496 488 # COPY CURRENT SOURCE CODE TO SOURCE-CODE DIRECTORY ON THE REMOTE HOST 497 489 # CREATE THIS DIRECTORY, IF IT DOES NOT EXIST 498 echo " *** copying \"${program_name}_sources.tar\" to \"${remote_ip}:${ remote_make_depository}/\" "499 echo "[[ ! -d ${ remote_make_depository} ]] && (echo \" *** ${remote_make_depository} will be created\"; mkdir -p ${remote_make_depository})" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1500 501 scp $ssh_key ${source_path}/${program_name}_sources.tar ${remote_username}@${remote_ip}:${ remote_make_depository}/${program_name}_sources.tar490 echo " *** copying \"${program_name}_sources.tar\" to \"${remote_ip}:${make_depository}/\" " 491 echo "[[ ! -d ${make_depository} ]] && (echo \" *** ${make_depository} will be created\"; mkdir -p ${make_depository})" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 492 493 scp $ssh_key ${source_path}/${program_name}_sources.tar ${remote_username}@${remote_ip}:${make_depository}/${program_name}_sources.tar 502 494 503 495 … … 505 497 # UNTAR PREVIOUS UPDATE ON REMOTE HOST, IF EXISTING 506 498 echo " *** untar previous update on remote host, if existing" 507 echo "cd ${ remote_make_depository}; [[ -f ${program_name}_current_version.tar ]] && tar -xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1499 echo "cd ${make_depository}; [[ -f ${program_name}_current_version.tar ]] && tar -xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 508 500 509 501 510 502 # UNTAR CURRENT SOURCES ON REMOTE HOST 511 503 echo " *** untar current sources on remote host" 512 echo "cd ${ remote_make_depository}; tar -xf ${program_name}_sources.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1504 echo "cd ${make_depository}; tar -xf ${program_name}_sources.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 513 505 514 506 … … 522 514 echo " *** creating utilities on remote host" 523 515 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\" " 524 echo "$login_init_cmd $module_commands cd ${ remote_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 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_protokoll 525 517 526 518 if [[ $(grep -c MAKE_ERROR ${remote_hostname}_last_make_protokoll) != 0 ]] … … 556 548 echo " *** compile PALM sources on remote host" 557 549 make_call_string="make $make_options PROG=$program_name F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 558 echo "$login_init_cmd $module_commands cd ${ remote_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 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_protokoll 559 551 560 552 if [[ $(grep -c MAKE_ERROR ${remote_hostname}_last_make_protokoll) != 0 ]] … … 583 575 # TAR UPDATED VERSION ON THE REMOTE HOST 584 576 printf "\n *** tar update on remote host ..." 585 echo "cd ${ remote_make_depository}; chmod u+w *; tar -cf ${program_name}_current_version.tar ${program_name} *.f90 *.o *.mod *.x" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1577 echo "cd ${make_depository}; chmod u+w *; tar -cf ${program_name}_current_version.tar ${program_name} *.f90 *.o *.mod *.x" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 586 578 587 579 … … 593 585 594 586 # FIRST CHECK, IF A DEPOSITORY EXISTS ON THE REMOTE MACHINE 595 echo "[[ ! -d ${ remote_make_depository} ]] && echo depository not found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${remote_hostname}_last_make_protokoll587 echo "[[ ! -d ${make_depository} ]] && echo depository not found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${remote_hostname}_last_make_protokoll 596 588 597 589 598 590 # COPY MAKE DEPOSITORY ON REMOTE MACHINE TO SOURCES_FOR_RUN_... 599 591 printf "\n *** copy MAKE_DEPOSITORY_${host} on remote host to SOURCES_FOR_RUN_$fname \n" 600 echo "rm -rf $ tmp_user_catalog/SOURCES_FOR_RUN_$fname; mkdir -p $tmp_user_catalog/SOURCES_FOR_RUN_$fname; cp ${remote_make_depository}/${program_name}_current_version.tar $tmp_user_catalog/SOURCES_FOR_RUN_$fname; cd $tmp_user_catalog/SOURCES_FOR_RUN_$fname; tar xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1592 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 601 593 602 594 603 595 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... ON THE REMOTE MACHINE 604 596 printf "\n *** copy $base_directory/SOURCES_FOR_RUN_$fname to SOURCES_FOR_RUN_$fname on remote host \n" 605 scp -q $ssh_key $base_directory/SOURCES_FOR_RUN_$fname/{*,.[!.]*} ${remote_username}@${remote_ip}:${ tmp_user_catalog}/SOURCES_FOR_RUN_$fname597 scp -q $ssh_key $base_directory/SOURCES_FOR_RUN_$fname/{*,.[!.]*} ${remote_username}@${remote_ip}:${fast_io_catalog}/SOURCES_FOR_RUN_$fname 606 598 607 599 … … 614 606 [[ "$module_commands" != "" ]] && module_commands=${module_commands}";" 615 607 echo " *** execute \"make\" on remote host" 616 echo "$login_init_cmd $module_commands cd ${ tmp_user_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 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_protokoll 617 609 618 610 if [[ $(grep -c MAKE_ERROR ${remote_hostname}_last_make_protokoll) != 0 ]] … … 672 664 673 665 # CREATE MAKE-DEPOSITORY, IF IT DOES NOT EXIST 674 eval local_make_depository=$local_make_depository675 if [[ ! -d $ local_make_depository ]]676 then 677 if mkdir -p $ local_make_depository666 eval make_depository=$make_depository 667 if [[ ! -d $make_depository ]] 668 then 669 if mkdir -p $make_depository 678 670 then 679 671 printf "\n\n *** directory for local make depository:" 680 printf "\n $ local_make_depository"672 printf "\n $make_depository" 681 673 printf "\n was created\n" 682 674 else 683 675 printf "\n +++ directory for local make depository:" 684 printf "\n $ local_make_depository"676 printf "\n $make_depository" 685 677 printf "\n cannot be created" 686 locat=local_depository _path; exit678 locat=local_depository; exit 687 679 fi 688 680 fi … … 691 683 echo " " 692 684 echo " *** untar current source sources on local host in" 693 echo " $ local_make_depository"694 cd $ local_make_depository685 echo " $make_depository" 686 cd $make_depository 695 687 cp $source_path/${program_name}_sources.tar . 696 688 tar xf ${program_name}_sources.tar … … 744 736 745 737 # FIRST CHECK, IF A DEPOSITORY EXISTS ON THE LOCAL MACHINE 746 if [[ ! -d ${ local_make_depository} ]]738 if [[ ! -d ${make_depository} ]] 747 739 then 748 740 printf "\n +++ directory for local make depository:" 749 printf "\n $ local_make_depository"741 printf "\n $make_depository" 750 742 printf "\n not found. Please run \"palmbuild -h $host\" " 751 locat= local_make_depository; exit743 locat=make_depository; exit 752 744 fi 753 745 … … 755 747 # COPY MAKE DEPOSITORY ON LOCAL MACHINE TO SOURCES_FOR_RUN_... 756 748 printf "\n *** copy MAKE_DEPOSITORY_${host} on local host to " 757 printf "\n $ tmp_user_catalog/SOURCES_FOR_RUN_$fname \n"758 rm -rf $ tmp_user_catalog/SOURCES_FOR_RUN_$fname759 mkdir -p $ tmp_user_catalog/SOURCES_FOR_RUN_$fname760 cp ${ local_make_depository}/${program_name}_current_version.tar $tmp_user_catalog/SOURCES_FOR_RUN_$fname761 cd $ tmp_user_catalog/SOURCES_FOR_RUN_$fname749 printf "\n $fast_io_catalog/SOURCES_FOR_RUN_$fname \n" 750 rm -rf $fast_io_catalog/SOURCES_FOR_RUN_$fname 751 mkdir -p $fast_io_catalog/SOURCES_FOR_RUN_$fname 752 cp ${make_depository}/${program_name}_current_version.tar $fast_io_catalog/SOURCES_FOR_RUN_$fname 753 cd $fast_io_catalog/SOURCES_FOR_RUN_$fname 762 754 tar xf ${program_name}_current_version.tar 763 755 764 756 765 757 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... 766 # IN THE TMP_USER_CATALOG ON THE LOCAL MACHINE758 # IN THE FAST_IO_CATALOG ON THE LOCAL MACHINE 767 759 printf "\n *** copy $base_directory/SOURCES_FOR_RUN_$fname to" 768 printf "\n $ tmp_user_catalog/SOURCES_FOR_RUN_$fname on local host \n"769 cp $base_directory/SOURCES_FOR_RUN_$fname/{*,.[!.]*} ${ tmp_user_catalog}/SOURCES_FOR_RUN_$fname760 printf "\n $fast_io_catalog/SOURCES_FOR_RUN_$fname on local host \n" 761 cp $base_directory/SOURCES_FOR_RUN_$fname/{*,.[!.]*} ${}/SOURCES_FOR_RUN_$fname 770 762 771 763
Note: See TracChangeset
for help on using the changeset viewer.