Changeset 2489


Ignore:
Timestamp:
Sep 21, 2017 12:57:25 PM (7 years ago)
Author:
raasch
Message:

ask for compilation, if SOURCES_FOR_RUN_... exists

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palmbuild

    r2487 r2489  
    2727# -----------------
    2828# $Id$
     29# ask for compilation, if SOURCES_FOR_RUN_... exists
     30#
     31# 2487 2017-09-21 11:30:10Z raasch
    2932# bugfix: abort in case of compiling/linking errors in silent mode
    3033#
     
    7073          printf "\n\n *** palmbuild finished \n\n"
    7174          exit 0
    72        fi' exit
     75       fi
     76       rm -rf ${source_path}/${host_identifier}_last_make_protocol
     77      ' exit
    7378
    7479
    7580    # IN CASE OF TERMINAL-BREAK:
    7681 trap 'printf "\n\n +++ palmbuild killed by \"^C\" \n\n"
     82       rm -rf ${source_path}/${host_identifier}_last_make_protocol
    7783       exit
    7884      ' 2
     
    509515          echo "  *** creating utilities on remote host"
    510516          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\" "
    511           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
    512 
    513           if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protokoll) != 0 ]]
     517          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_protocol
     518
     519          if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protocol) != 0 ]]
    514520          then
    515521             printf "\a\n  +++ error(s) occurred during compiling or linking of utilities"
     
    525531                   if [[ "$answer" = l ]]
    526532                   then
    527                       more ${host_identifier}_last_make_protokoll
     533                      more ${host_identifier}_last_make_protocol
    528534                   fi
    529535                done
     
    546552          echo "  *** compile PALM sources on remote host"
    547553          make_call_string="make  $make_options  PROG=$program_name  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$linker_options\" "
    548           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
    549 
    550           if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protokoll) != 0 ]]
     554          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_protocol
     555
     556          if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protocol) != 0 ]]
    551557          then
    552558             printf "\a\n  +++ error(s) occurred during compiling or linking for host \"$host_identifier\" "
     
    561567                   if [[ "$answer" = l ]]
    562568                   then
    563                       more ${host_identifier}_last_make_protokoll
     569                      more ${host_identifier}_last_make_protocol
    564570                   fi
    565571                done
     
    585591       then
    586592
    587              # FIRST CHECK, IF A DEPOSITORY EXISTS ON THE REMOTE MACHINE
    588           echo  "[[ ! -d ${make_depository} ]]  &&  echo depository not found" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1 | tee ${host_identifier}_last_make_protokoll
    589 
     593             # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS
     594             # AND ASK, IF THEY SHALL BE USED
     595          echo  "[[ -d $fast_io_catalog/SOURCES_FOR_RUN_$fname ]]  &&  echo sources for run found" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1  >  ${host_identifier}_last_make_protocol
     596          if [[ $(grep -c "sources for run found" ${host_identifier}_last_make_protocol) != 0 ]]
     597          then
     598             printf "\a\n  *** compiled sources for run \"$fname\" found on remote host in folder"
     599             printf "\n      $fast_io_catalog/SOURCES_FOR_RUN_$fname" 
     600             answer=dummy
     601             printf "\n\n"
     602             while [[ "$answer" != y  &&  "$answer" != n ]]
     603             do
     604                printf "  >>> shall they be used (y/n) ? "
     605                read  answer
     606             done
     607             if [[ $answer = y ]]
     608             then
     609                exit
     610             fi
     611          fi
    590612
    591613             # COPY MAKE DEPOSITORY ON REMOTE MACHINE TO SOURCES_FOR_RUN_...
     
    608630             [[ "$module_commands" != "" ]]  &&  module_commands=${module_commands}";"
    609631             echo "  *** execute \"make\" on remote host"
    610              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
    611 
    612              if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protokoll) != 0 ]]
     632             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_protocol
     633
     634             if [[ $(grep -c MAKE_ERROR ${host_identifier}_last_make_protocol) != 0 ]]
    613635             then
    614636                printf "\a\n  +++ error(s) occurred during compiling or linking for host \"$host_identifier\" "
     
    623645                      if [[ "$answer" = l ]]
    624646                      then
    625                          more ${host_identifier}_last_make_protokoll
     647                         more ${host_identifier}_last_make_protocol
    626648                      fi
    627649                   done
     
    644666       fi
    645667
    646        rm -rf  ${host_identifier}_last_make_protokoll
     668       rm -rf  ${host_identifier}_last_make_protocol
    647669
    648670
     
    704726          echo "  *** compile PALM sources on local host"
    705727
    706           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
     728          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_protocol
    707729
    708730          if [[ $? != 0 ]]
     
    719741                   if [[ "$answer" = l ]]
    720742                   then
    721                       more ${host_identifier}_last_make_protokoll
     743                      more ${host_identifier}_last_make_protocol
    722744                   fi
    723745                done
     
    743765             # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_...
    744766
    745              # FIRST CHECK, IF A DEPOSITORY EXISTS ON THE LOCAL MACHINE
     767             # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS
     768             # AND ASK, IF THEY SHALL BE USED
     769          if [[ -d $fast_io_catalog/SOURCES_FOR_RUN_$fname ]]
     770          then
     771             printf "\a\n  *** compiled sources for run \"$fname\" found on local host in folder"
     772             printf "\n      $fast_io_catalog/SOURCES_FOR_RUN_$fname" 
     773             answer=dummy
     774             printf "\n\n"
     775             while [[ "$answer" != y  &&  "$answer" != n ]]
     776             do
     777                printf "  >>> shall they be used (y/n) ? "
     778                read  answer
     779             done
     780             if [[ $answer = y ]]
     781             then
     782                exit
     783             fi
     784          fi
     785
     786             # SECOND CHECK, IF A DEPOSITORY EXISTS ON THE LOCAL MACHINE
    746787          if [[ ! -d ${make_depository} ]]
    747788          then
Note: See TracChangeset for help on using the changeset viewer.