Changeset 3484


Ignore:
Timestamp:
Oct 24, 2024, 1:10:52 PM (4 weeks ago)
Author:
afalco
Message:

ICOSA_LMDZ: overall compilation stops when compilation of a module fails.
Errors from internal calls in compilation scripts are transferred to the scripts above.
AF

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICOSA_LMDZ/make_icosa_lmdz

    r3480 r3484  
    200200echo "%LIB $ICOSA_LIB">> config.fcm
    201201
    202 if [[ "$build_deps" == "TRUE" ]]
    203 then
    204 
    205   if [[ -d ../IOIPSL ]] ; then
    206     cd ../IOIPSL
    207     ./makeioipsl_fcm -parallel -arch $arch -arch_path $arch_path -j $job $full_flag  || exit 1
     202function compile_module {
     203  ## function to compile each module.
     204  dir=$1 # module folder
     205  shift
     206  cmd=$@ # command line to compile
     207  if [[ -d ../$dir ]] ; then
     208    cd ../$dir
     209    echo "-- Compiling $dir with:"
     210    echo $cmd
     211    $cmd
     212    if [ $? != 0 ]; then # check if fcm command worked
     213      echo "In ../$dir, the following command failed:"
     214      echo "$cmd"
     215      exit 1
     216    fi
     217
    208218    cd -
    209219  else
    210     echo "Error: cannot find ../IOIPSL directory"
    211     exit
    212   fi
    213 
    214   if [[ -d ../XIOS ]] ; then
    215     cd ../XIOS
    216     ./make_xios --arch $arch --arch_path $arch_path --job $job $full_flag2 || exit 1
    217     cd -
    218   else
    219     echo "Error: cannot find ../XIOS directory"
    220     exit
    221   fi
    222 
     220    echo "Error: cannot find ../$dir directory"
     221    exit 1
     222  fi
     223}
     224
     225if [[ "$build_deps" == "TRUE" ]]
     226then
     227  compile_module IOIPSL ./makeioipsl_fcm -parallel -arch $arch -arch_path $arch_path -j $job $full_flag
     228  compile_module XIOS ./make_xios --arch $arch --arch_path $arch_path --job $job $full_flag2
    223229fi # of if [[ "$build_deps" == "TRUE" ]]
    224230
    225 if [[ -d ../LMDZ.COMMON ]] ; then
    226     cd ../LMDZ.COMMON
    227     echo "Compiling LMDZ.COMMON with:"
    228     cmd="./makelmdz_fcm -p $phys $phys_opt -$compil_mode -parallel $parallel -libphy -io xios -arch $arch -arch_path $arch_path -j $job $full_flag"
    229     echo $cmd
    230     $cmd || (echo "Failed compilation of LMDZ.COMMON. Command line was:" && echo $cmd && exit 1)
    231     cd -
    232 else
    233     echo "Error: cannot find ../LMDZ.COMMON directory"
    234     exit
    235 fi
    236 
    237 if [[ -d ../ICOSAGCM ]] ; then
    238     cd ../ICOSAGCM
    239     # from now on, compile using fcm2
    240     echo "Compiling ICOSAGCM with:"
    241     cmd="./make_icosa -$compil_mode -parallel $parallel -external_ioipsl -with_xios -arch $arch -arch_path $arch_path -job $job $full_flag"
    242     echo "$cmd"
    243     $cmd || (echo "Failed compilation of ICOSAGCM. Command line was:" && echo $cmd && exit 1)
    244     cd -
    245 else
    246     echo "Error: cannot find ../ICOSAGCM directory"
    247     exit
    248 fi
     231compile_module LMDZ.COMMON ./makelmdz_fcm -p $phys $phys_opt -$compil_mode -parallel $parallel -libphy -io xios -arch $arch -arch_path $arch_path -j $job $full_flag
     232
     233compile_module ICOSAGCM ./make_icosa -$compil_mode -parallel $parallel -external_ioipsl -with_xios -arch $arch -arch_path $arch_path -job $job $full_flag
    249234
    250235# compile interface and link
  • trunk/LMDZ.COMMON/build_gcm

    r1019 r3484  
    55# the full path to where the 'fcm' command is to be found
    66
    7 if test -f '.lock' 
     7if test -f '.lock'
    88  then
    99    echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs'
     
    1919    echo "Do you wish to continue?"
    2020    read ouinon
    21     if [[ $ouinon == "oui" || $ouinon == "yes" ]] 
     21    if [[ $ouinon == "oui" || $ouinon == "yes" ]]
    2222        then
    23         echo OK 
     23        echo OK
    2424    else
    2525        exit
     
    4545# run "fcm build" command
    4646${dirname}fcm build $*
     47if [ $? != 0 ]; then # check if fcm command worked
     48    exit 1
     49fi
     50
    4751
    4852# cleanup
    49 \rm -f '.lock' 
     53\rm -f '.lock'
    5054
  • trunk/LMDZ.COMMON/makelmdz_fcm

    r3481 r3484  
    180180
    181181      "-adjnt")
    182           echo "not operational ... work to be done here ";exit
     182          echo "not operational ... work to be done here ";exit 1
    183183          opt_dep="$opt_dep adjnt" ; adjnt="-ladjnt -ldyn3d "
    184184          optim="$optim -Dadj" ; shift ;;
     
    350350    echo "newstart or start2archive utilities should be run in serial!"
    351351    echo " Compile without -parallel [mpi|omp|mpi_omp] option!"
    352     exit
     352    exit 1
    353353fi
    354354
     
    397397   echo "Option -v $veget does not exist"
    398398   echo "Use ./makelmdz_fcm -h for more information"
    399    exit
     399   exit 1
    400400fi
    401401
     
    549549    \rm -f $LIBFGCM/grid/dimensions.h
    550550  else
    551     exit
     551    exit 1
    552552  fi
    553553fi
     
    585585  else
    586586    echo "Error: you should not use the -s # option with -p $physique"
    587     exit
     587    exit 1
    588588  fi
    589589fi
     
    618618    echo "Error: a 1D model compiled with xios should also be compiled with "
    619619    echo "       -parallel mpi option!"
    620     exit
     620    exit 1
    621621   fi
    622622  else
     
    626626    echo "Error: a 1D model should not be compiled with "
    627627    echo "       -parallel [mpi|omp|mpi_omp] option!"
    628     exit
     628    exit 1
    629629   fi
    630630  fi # of if [[ $io == "xios" ]]
     
    807807rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock
    808808./build_gcm ${fcm_path} -j $job $full
     809if [ $? != 0 ]; then # check if fcm command worked
     810    exit 1
     811fi
    809812
    810813rm -rf tmp_src
Note: See TracChangeset for help on using the changeset viewer.