Changeset 3294 for trunk/NEMOGCM/CONFIG/makenemo
- Timestamp:
- 2012-01-28T17:44:18+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/CONFIG/makenemo
r2731 r3294 76 76 # 77 77 #- 78 79 #- 80 #- Initialization of the options --- 81 x_d=""; 82 x_h=""; 83 x_n=""; 84 x_r=""; 85 x_m=""; 86 x_t=""; 87 x_c=""; 88 x_j=1; 89 x_e="none"; 90 x_s=NEMO; 91 x_v=1; 78 92 79 93 #- Local variables --- … … 89 103 export TOOLS_DIR=${MAIN_DIR}/TOOLS 90 104 export COMPIL_DIR=${MAIN_DIR}/TOOLS/COMPILE 91 export NEMO_DIR=${MAIN_DIR}/ NEMO105 export NEMO_DIR=${MAIN_DIR}/${x_s} 92 106 export AGRIFUSE=10 93 94 107 declare -a TAB 95 108 #- … … 99 112 #- 100 113 #- Choice of the options --- 101 x_d=""; 102 x_n=""; 103 x_r=""; 104 x_m=""; 105 x_t=""; 106 x_c=""; 107 x_j=1; 108 while getopts :hd:n:r:m:j:t: V 114 while getopts :hd:n:r:m:j:e:s:v:t: V 109 115 do 110 116 case $V in 111 (h) echo "Usage : "${b_n} \ 112 " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-j No]"; 113 echo " -h : help"; 114 echo " -n name : config name, [-n help] to list existing configurations"; 115 echo " -m arch : choose compiler, [-m help] to list existing compilers"; 116 echo " -d dir : choose NEMO sub-directories"; 117 echo " -r conf : choose reference configuration"; 118 echo " -j No : number of processes used to compile (0=nocompilation)"; 119 echo " -t dir : temporary directory for compilation" 117 (h) x_h=${OPTARG}; 118 echo "Usage : "${b_n} \ 119 " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No]"; 120 echo " -h : help"; 121 echo " -h institute : specific help for consortium members"; 122 echo " -n name : config name, [-n help] to list existing configurations"; 123 echo " -m arch : choose compiler, [-m help] to list existing compilers"; 124 echo " -d dir : choose NEMO sub-directories"; 125 echo " -r conf : choose reference configuration"; 126 echo " -s Path : choose alternative location for NEMO main directory"; 127 echo " -e Path : choose alternative location for MY_SRC directory"; 128 echo " -j No : number of processes used to compile (0=nocompilation)"; 129 echo " -v No : set verbosity level for compilation [0-3]"; 130 echo " -t dir : temporary directory for compilation" 120 131 echo ""; 121 132 echo "Example to install a new configuration MY_CONFIG"; … … 123 134 echo "makenemo -n MY_CONFIG -d \"OPA_SRC LIM_SRC_2\""; 124 135 echo ""; 125 echo "Available configurations :"; cat ${CO MPIL_DIR}/cfg.txt;136 echo "Available configurations :"; cat ${CONFIG_DIR}/cfg.txt; 126 137 echo ""; 127 138 echo "Example to remove bad configuration "; … … 137 148 echo "./makenemo -n MY_CONFIG -j0 add_key \"key_iomput key_mpp_mpi\" del_key \"key_agrif\" "; 138 149 echo ""; 139 . ${COMPIL_DIR}/Flist_archfile.sh ;150 . ${COMPIL_DIR}/Flist_archfile.sh ${x_h} ; 140 151 echo ""; 141 152 echo "Default : previous configuration and compiler"; … … 147 158 (j) x_j=${OPTARG};; 148 159 (t) x_t=${OPTARG};; 160 (e) x_e=${OPTARG};; 161 (s) x_s=${OPTARG};; 162 (v) x_v=${OPTARG};; 149 163 (:) echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 150 164 exit 2;; … … 198 212 NEMO_TDIR=${x_t:-$NEMO_TDIR} 199 213 export NEMO_TDIR=${NEMO_TDIR:-$CONFIG_DIR} 214 export NEMO_DIR=${MAIN_DIR}/${x_s} 200 215 201 216 #- Check if the tool or the compiler exist or list it 202 217 if [ "${NEW_CONF}" == help ] ; then 203 218 echo "Available configurations :" 204 cat ${CO MPIL_DIR}/cfg.txt219 cat ${CONFIG_DIR}/cfg.txt 205 220 exit 206 221 fi 207 [ "${CMP_NAM}" == help ] && . ${COMPIL_DIR}/Flist_archfile.sh && exit222 [ "${CMP_NAM}" == help ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit 208 223 209 224 #- When used for the first time, choose a compiler --- … … 238 253 . ${COMPIL_DIR}/Fmake_config.sh ${NEW_CONF} ${REF_CONF} 239 254 else 240 sed -e "/${NEW_CONF} /d" ${CO MPIL_DIR}/cfg.txt > ${COMPIL_DIR}/cfg.tmp241 \mv ${COMPIL_DIR}/cfg.tmp ${CO MPIL_DIR}/cfg.txt255 sed -e "/${NEW_CONF} /d" ${CONFIG_DIR}/cfg.txt > ${COMPIL_DIR}/cfg.tmp 256 \mv ${COMPIL_DIR}/cfg.tmp ${CONFIG_DIR}/cfg.txt 242 257 fi 243 258 244 259 #- 245 260 #- Save new configuration and directories names --- 246 echo ${NEW_CONF} ${TAB[*]} >> ${CO MPIL_DIR}/cfg.txt261 echo ${NEW_CONF} ${TAB[*]} >> ${CONFIG_DIR}/cfg.txt 247 262 248 263 #- … … 250 265 #- Clean links and librairies --- 251 266 #- Creating the good links, at first on OPA_SRC --- 252 . ${COMPIL_DIR}/Fmake_WORK.sh ${ NEW_CONF} ${TAB[*]} || exit267 . ${COMPIL_DIR}/Fmake_WORK.sh ${x_e} ${NEW_CONF} ${TAB[*]} || exit 253 268 254 269 . ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF} ${NEMO_TDIR} || exit … … 290 305 [ "$AGRIFUSE" == 1 ] && rm -rf ${NEMO_TDIR}/${NEW_CONF}/BLD/* 291 306 fi 292 fcm build ${x_c} --ignore-lock -v 1-j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || cd -307 fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || cd - 293 308 [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ${CONFIG_DIR}/${NEW_CONF}/EXP00/opa 294 309 [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/server.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/server.exe ${CONFIG_DIR}/${NEW_CONF}/EXP00/server.exe
Note: See TracChangeset
for help on using the changeset viewer.