Changeset 9651 for utils/build/mk


Ignore:
Timestamp:
2018-05-28T08:47:14+02:00 (3 years ago)
Author:
nicolasmartin
Message:

Reorganisation plan for NEMO repository: add missing modifications from previous commit

Location:
utils/build/mk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • utils/build/mk/Fclean_config.sh

    r9598 r9651  
    6363# 
    6464#- 
    65  NEW_CONF=${x_n} 
    66  if [ ${#NEW_CONF} -eq 0 ] ; then 
    67       echo " " 
    68       echo "No configuration specified, please use makenemo -n CONFIG clean_config " 
    69  else 
    70     echo "Are you sure that you want to remove this directory $NEW_CONF? [y/n] " 
    71     read answer 
    72     answer=`echo $answer | sed 's/^[y].*$/y/'` 
    73     if [  -z "$answer" -o "x$answer" = "xy" ]; then 
    74       # testing if configuration exists 
    75       if [ "$(cat ${CONFIG_DIR}/cfg.txt | grep "${NEW_CONF} ")"  == "" ] ; then 
    76         echo "The configuration ${NEW_CONF} does not exist in file cfg.txt"      
    77         echo "No removing configuration" 
    78         echo " " 
    79         else 
    80         rm -rf ${CONFIG_DIR}/${NEW_CONF} 
    81         sed -e "/${NEW_CONF} /d"  ${CONFIG_DIR}/cfg.txt >  ${CONFIG_DIR}/cfg.tmp 
    82         mv  ${CONFIG_DIR}/cfg.tmp  ${CONFIG_DIR}/cfg.txt 
    83         echo "${NEW_CONF} configuration REMOVED"  
    84         fi 
    85     else 
    86       echo " " 
    87       echo "nothing to remove" 
    88     fi 
    89  fi  
    90  unset -v answer 
     65 
     66NEW_CONF=${x_n} 
     67 
     68if [ ${#NEW_CONF} -eq 0 ] ; then 
     69   echo " " 
     70   echo "No configuration specified, please use makenemo -n CONFIG clean_config " 
     71else 
     72   echo "Are you sure that you want to remove this directory $NEW_CONF? [y/n] " 
     73   read answer 
     74   answer=`echo $answer | sed 's/^[y].*$/y/'` 
     75 
     76   if [  -z "$answer" -o "x$answer" = "xy" ]; then 
     77 
     78      ## testing if configuration exists 
     79      if [[ ! $( grep "${NEW_CONF} " */work_cfgs.txt ) ]] ; then 
     80         echo "The configuration ${NEW_CONF} does not exist in file work_cfgs.txt"      
     81         echo "No removing configuration" 
     82         echo " " 
     83      else 
     84         CONFIG_DIR=${MAIN_DIR}/$( grep -l "${NEW_CONF} " */work_cfgs.txt | cut -d/ -f1 ) 
     85         rm -rf ${CONFIG_DIR}/${NEW_CONF} 
     86         sed -e "/${NEW_CONF} /d"  ${CONFIG_DIR}/work_cfgs.txt >  ${CONFIG_DIR}/work_cfgs.tmp 
     87         mv  ${CONFIG_DIR}/work_cfgs.tmp  ${CONFIG_DIR}/work_cfgs.txt 
     88         echo "${NEW_CONF} configuration REMOVED"  
     89      fi 
     90 
     91   else 
     92      echo " " 
     93      echo "nothing to remove" 
     94   fi 
     95 
     96fi  
     97 
     98unset -v answer 
  • utils/build/mk/Flist_archfile.sh

    r9598 r9651  
    5656#- 
    5757 
    58 if [ -n "$2" ]; then 
    59 shift 
    60 fi 
     58archfile_loop() { 
    6159 
    62 echo "Available compilers for -m option :" 
    63 for file in  $(ls ${MAIN_DIR}/arch | grep "fcm$" ) 
    64 do 
    65 zvar1=${file#arch-} 
    66 zvar2=$(head -1 ${MAIN_DIR}/arch/$file) 
    67 #echo "${zvar1%.fcm} : ${zvar2#\#}" 
    68 printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}" 
     60   for file in $( ls $1/*.fcm ); do 
     61      zvar1=$( basename $file | sed 's/arch-\(.*\).fcm/\1/' ) 
     62      zvar2=$( head -1  $file | tr -d '#'                   ) 
     63      printf "%-30s %-s\n" ${zvar1} "${zvar2}" 
     64   done 
     65 
     66} 
     67 
     68echo -e "\n  ¤ Generic computing architectures" 
     69 
     70archfile_loop ${MAIN_DIR}/arch 
     71 
     72for dir in $( ls ${MAIN_DIR}/arch | grep -v "fcm$" ); do 
     73   echo -e "\n  ¤ Specific HPC architectures for "${dir} 
     74   archfile_loop ${MAIN_DIR}/arch/$dir 
    6975done 
    7076 
    71  
    72 if [ "$1" == "all" ]; then 
    73    for dir  in  $(ls ${MAIN_DIR}/arch | grep -v "fcm$" ) 
    74    do  
    75       echo "Available compilers at ${dir} :" 
    76       for file in  $(ls ${MAIN_DIR}/arch/${dir} | grep "fcm$" ) 
    77       do 
    78       zvar1=${file#arch-} 
    79       zvar2=$(head -1 ${MAIN_DIR}/arch/${dir}/$file) 
    80       #echo "${zvar1%.fcm} : ${zvar2#\#}" 
    81       printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}" 
    82       done 
    83    done 
    84 elif [ -d ${MAIN_DIR}/arch/${1} ]; then 
    85       echo "Available compilers at $1 :" 
    86       for file in  $(ls ${MAIN_DIR}/arch/$1 | grep "fcm$" ) 
    87       do 
    88       zvar1=${file#arch-} 
    89       zvar2=$(head -1 ${MAIN_DIR}/arch/${1}/$file) 
    90       #echo "${zvar1%.fcm} : ${zvar2#\#}" 
    91       printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}" 
    92       done 
    93 else 
    94       echo "Available consortium member sub-directories :" 
    95       for dir  in  $(ls ${MAIN_DIR}/arch | grep -v "fcm$" ) 
    96       do 
    97          echo ${dir} 
    98       done 
    99       echo "use \"makenemo -h all\" or \"makenemo -m help\" to see compilers available in member's sub-directories" 
    100 fi 
     77echo 
  • utils/build/mk/Fmake_WORK.sh

    r9598 r9651  
    6969declare i=0 ; declare NDIR=${#ZTAB[@]} 
    7070 
    71 echo "Creating ${ZCONF}/WORK = ${ZTAB[*]} for ${ZCONF}" 
     71echo 'Creating '${ZCONF}'/WORK = '${ZTAB[*]}' for '${ZCONF} 
    7272 
    7373[ ! -d ${ZCONF}/MY_SRC ] && \mkdir ${ZCONF}/MY_SRC 
    7474[   -d ${ZCONF}/WORK   ] || \mkdir ${ZCONF}/WORK 
    7575 
    76 if [ "${ZSRC}" != "none" ] ; then  
    77   if [ -d ${ZSRC} ] ; then  
    78      ln -sf ${ZSRC}/*.[Ffh]90 ${ZCONF}/MY_SRC/.  
    79      echo "MY_SRC content is linked to ${ZSRC}"  
    80   else 
    81      echo "External directory for MY_SRC does not exist. Using default." 
    82   fi 
     76if [ "${ZSRC}" != 'none' ] ; then  
     77 
     78   if [ -d ${ZSRC} ] ; then  
     79      ln -sf ${ZSRC}/*.[Ffh]90 ${ZCONF}/MY_SRC/.  
     80      echo 'MY_SRC content is linked to '${ZSRC} 
     81   else 
     82      echo 'External directory for MY_SRC does not exist. Using default.' 
     83   fi 
     84 
    8385else  
    84 echo "MY_SRC directory is : ${ZCONF}/MY_SRC" 
     86   echo 'MY_SRC directory is : '${ZCONF}'/MY_SRC' 
    8587fi 
    8688 
    87 \rm -f ../${1}/WORK/* 
     89#\rm -f ../${1}/WORK/* 
    8890 
    89 while [ $i -lt $NDIR ] 
    90 do 
    91    [ "${ZTAB[i]}" = "OCE" ] && ln -sf ${NEMO_DIR}/OCE/*.[Ffh]90 ${ZCONF}/WORK 
    92    [ "${ZTAB[i]}" = "OCE" ] && ln -sf ${NEMO_DIR}/OCE/*/*.[Ffh]90 ${ZCONF}/WORK && break 
    93    let i=$i+1 
     91for comp in ${ZTAB[*]}; do 
     92   find ${NEMO_DIR}/$comp -name *.[Ffh]90 -exec ln -sf {} ${ZCONF}/WORK \; 
    9493done 
    9594 
    96 i=0 
    97 while [ $i -lt $NDIR ] 
    98 do 
    99    if [ "${ZTAB[i]}" != "OCE" ]; then 
    100       ln -sf ${NEMO_DIR}/${ZTAB[i]}/*.[Ffh]90 ${ZCONF}/WORK 
    101       ln -sf ${NEMO_DIR}/${ZTAB[i]}/*/*.[Ffh]90 ${ZCONF}/WORK  
    102       ln -sf ${NEMO_DIR}/${ZTAB[i]}/*/*/*.[Ffh]90 ${ZCONF}/WORK 2>/dev/null 
    103    fi 
    104    let i=$i+1 
     95for i in `(cd ${ZCONF}/MY_SRC ; \ls *.[Ffh]90 2>/dev/null ) `; do 
     96   [ -f ${ZCONF}/MY_SRC/$i ] &&  ln -sf $PWD/${ZCONF}/MY_SRC/${i} ${ZCONF}/WORK/. 
    10597done 
    10698 
    107 for i in `(cd ${ZCONF}/MY_SRC ; \ls *.[Ffh]90 2>/dev/null ) ` 
    108    do 
    109       [ -f ${ZCONF}/MY_SRC/$i ] &&  ln -sf $PWD/${ZCONF}/MY_SRC/${i} ${ZCONF}/WORK/. 
    110    done 
    111  
    112 unset -v  ZCONF 
    113 unset -v ZTAB 
    114 unset -v  i 
    115 unset -v NDIR 
    116  
     99unset -v ZCONF ZTAB i NDIR 
  • utils/build/mk/Fmake_bld.sh

    r9598 r9651  
    5858# 
    5959#- 
    60 [ ! -d ${3}/${2} ] && \mkdir  ${3}/${2} 
    61 [ ! -d ${3}/${2}/BLD ] && \mkdir  ${3}/${2}/BLD 
    62 [ ! -d ${1}/${2}/BLD ]   && ln -sf ${3}/${2}/BLD ${1}/${2}/BLD 
     60[ ! -d ${3}/${2}     ] && \mkdir ${3}/${2} 
     61[ ! -d ${3}/${2}/BLD ] && \mkdir ${3}/${2}/BLD 
     62[ ! -d ${1}/${2}/BLD ] && ln -sf ${3}/${2}/BLD ${1}/${2}/BLD 
    6363[ -f ${1}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ] && ln -sf ${1}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ${COMPIL_DIR}/cpp.fcm 
    6464rm -f  ${1}/${NEW_CONF}/BLD/fcm.bld.lock 
Note: See TracChangeset for help on using the changeset viewer.