Changeset 3499


Ignore:
Timestamp:
Nov 8, 2024, 10:55:50 AM (13 days ago)
Author:
afalco
Message:

libphy compilation: fixed a few pathes for compilation with dynamico & others.
Removing lock when fail.
Allows for user to re-run compilation without the warning "ATTENTION... you might be already compiling"
AF

Location:
trunk/LMDZ.COMMON
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/build_gcm

    r3484 r3499  
    4444
    4545# run "fcm build" command
    46 ${dirname}fcm build $*
     46${dirname}fcm build $* || (exit 1)
    4747if [ $? != 0 ]; then # check if fcm command worked
    48     exit 1
     48  echo "Removing .lock"
     49  \rm -f '.lock'
     50  exit 1
    4951fi
    5052
  • trunk/LMDZ.COMMON/makelmdz_fcm

    r3484 r3499  
    682682######################################################################
    683683
    684 
    685 SUFF_NAME=_${dim_full}
     684if [[ $libphy != "true" ]];then
     685  SUFF_NAME=_${dim_full}
     686fi
    686687SUFF_NAME=${SUFF_NAME}_phy${physique}
    687688
     
    731732  SUFF_NAME=${SUFF_NAME}_inca
    732733fi
    733 SUFF_DIR=
     734SUFF_DEBUG=
    734735if [[ "$compil_mod" == "debug" ]]
    735736then
    736   SUFF_DIR=_debug
    737 fi
    738 SUFF_DIR=${SUFF_NAME}
     737  SUFF_DEBUG=_debug
     738fi
     739SUFF_DIR=${SUFF_NAME}${SUFF_DEBUG}
    739740
    740741if [[ $libphy == "true" ]]
     
    749750  code=""
    750751  SUFF_NAME=""
     752  # SUFF_DIR=
    751753else
    752754  SUFF_NAME=${SUFF_NAME}.e
     
    803805# cleanup before compiling
    804806if [[ $libphy != "true" ]]; then
    805     rm -f bin/${code}${SUFF_NAME}
    806 fi
    807 rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock
    808 ./build_gcm ${fcm_path} -j $job $full
    809 if [ $? != 0 ]; then # check if fcm command worked
    810     exit 1
    811 fi
     807  rm -f bin/${code}${SUFF_NAME}
     808fi
     809rm -f $LIBOGCM/${arch}${SUFF_DIR}/.config/fcm.bld.lock
     810
     811function delete_dim_h {
     812  if [[ -r $LIBFGCM/grid/dimensions.h ]];then
     813    echo "Removing dimensions.h"
     814    \rm -f $LIBFGCM/grid/dimensions.h
     815  fi
     816}
     817
     818./build_gcm ${fcm_path} -j $job $full || (echo "Build gcm failed."; delete_dim_h; exit 1)
    812819
    813820rm -rf tmp_src
    814821rm -rf config
    815 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config
    816 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/ppsrc tmp_src
    817 
    818 
    819 if [[ -r $LIBFGCM/grid/dimensions.h ]]
    820 then
    821   # Cleanup: remove dimension.h file
    822   \rm -f $LIBFGCM/grid/dimensions.h
    823 fi
     822ln -s $LIBOGCM/${arch}${SUFF_DIR}/.config config
     823ln -s $LIBOGCM/${arch}${SUFF_DIR}/.config/ppsrc tmp_src
     824
     825delete_dim_h
Note: See TracChangeset for help on using the changeset viewer.