- Timestamp:
- 09/04/09 13:27:47 (15 years ago)
- Location:
- modipsl/trunk/util
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
modipsl/trunk/util/AA_make.gdef
r638 r728 1 1 #- 2 2 #- $Id$ 3 #- 4 #- Validate the correlation between the target and the environment 5 #- 6 UTIL_DIR = '??' 7 WW_h_t = $(shell cat $(UTIL_DIR)/.host_target) 8 WW_h_w = $(shell $(UTIL_DIR)/w_i_h) 9 WW_t_e = $(shell $(UTIL_DIR)/w_i_e $(WW_h_t) $(WW_h_w)) 10 ifeq "$(WW_t_e)" "NO" 11 $(error ) 12 endif 3 13 #- 4 14 #-Q- Darwin #- Global definitions for Mac OSX, gfortran … … 103 113 #-Q- aix6 M_M = 0 104 114 #-Q- aix6 L_X = 0 105 #-Q- aix6 L_O = $(F_P) -q64 -bmaxdata:2000000000 -O3 -brename:.flush,.flush_ 115 #-Q- aix6 L_O = $(F_P) -q64 -bmaxdata:2000000000 -O3 -brename:.flush,.flush_ 106 116 #-Q- aix6 A_C = ar -rs -X64 107 117 #-Q- aix6 A_G = ar -x -X64 … … 163 173 #-Q- ax6_mono NCDF_LIB = -L/usr/local/pub/NetCDF/3.6.2/lib -lnetcdf 164 174 #-Q- ax6_mono #- 165 #-Q- babel #- Global definitions for IBM Blue Gene 175 #-Q- babel #- Global definitions for IBM Blue Gene 166 176 #-Q- babel M_K = gmake 167 177 #-Q- babel P_C = /usr/bin/cpp … … 179 189 #-Q- babel L_X = 0 180 190 #-Q- babel L_O = $(F_P) -O3 181 #-Q- babel A_C = ar -rs 182 #-Q- babel A_G = ar -x 191 #-Q- babel A_C = ar -rs 192 #-Q- babel A_G = ar -x 183 193 #-Q- babel C_C = cc -c 184 194 #-Q- babel C_O = -O … … 187 197 #-Q- babel NCDF_INC = /bglocal/prod/tools_ibm/netcdf-3.6.1/include 188 198 #-Q- babel NCDF_LIB = -L/bglocal/prod/tools_ibm/netcdf-3.6.1/lib -lnetcdf 189 #-Q- babel #- 199 #-Q- babel #- 190 200 #-Q- bgfe #- Global definitions for IBM Blue Gene Front End 191 201 #-Q- bgfe M_K = gmake … … 660 670 #-Q- sx8brodie NCDF_LIB = -L/SXlocal/pub/netCDF/netCDF-3.6.1/lib -lnetcdf 661 671 #-Q- sx8brodie #- 662 #-Q- sx8mercure #- Global definitions for NEC SX8 at CCRT 672 #-Q- sx8mercure #- Global definitions for NEC SX8/SX9 at CCRT 673 #-Q- sx9mercure #- Global definitions for NEC SX8/SX9 at CCRT 663 674 #-Q- sx8mercure LIB_MPI = MPI1 664 675 #-Q- sx8mercure LIB_MPI_BIS = MPI1 … … 690 701 #-Q- sx8mercure FC_L = gcc 691 702 #-Q- sx8mercure #- 692 #-Q- sx8mercure NCDF_INC = /usr/local/SX8/soft/netcdf/include 693 #-Q- sx8mercure NCDF_LIB = -L/usr/local/SX8/soft/netcdf/lib -lnetcdf 703 #-Q- sx8mercure NETCDF_SX_INCLUDEDIR ?= /usr/local/SX8/soft/netcdf/include 704 #-Q- sx8mercure NETCDF_SX_LIBDIR ?= /usr/local/SX8/soft/netcdf/lib 705 #-Q- sx8mercure NCDF_INC = ${NETCDF_SX_INCLUDEDIR} 706 #-Q- sx8mercure NCDF_LIB = -L${NETCDF_SX_LIBDIR} -lnetcdf 694 707 #-Q- sx8mercure #- 695 708 #-Q- sxdkrz #- Global definitions for NEC SX8 at DKRZ -
modipsl/trunk/util/clr_make
r293 r728 2 2 # $Id$ 3 3 #--------------------------------------------------------------------- 4 #- Suppression des Makefile propres a un environnement4 #- Remove Makefiles and data according to an environment 5 5 #--------------------------------------------------------------------- 6 6 d_n=$(dirname ${0}); … … 8 8 l_rep=$(find ${d_n}/.. -name AA_make -print) 9 9 #- 10 echo "Suppression des Makefile"; 10 echo ""; 11 echo "Remove Makefiles and data according to an environment"; 12 echo ""; 13 #- 11 14 for i in $l_rep 12 15 do 13 16 j=${i%/AA_make} 14 echo " Suppression dans$j ...";15 rm -f $ j/Makefile17 echo "Remove in $j ..."; 18 rm -f ${j}/Makefile 16 19 done 20 echo "Remove ${d_n}/.host_target"; 21 rm -f ${d_n}/.host_target 22 #- 17 23 l_prism=${d_n}'/../prism' 18 24 if [ -d ${l_prism} ]; then 19 rm -f ${d_n}/../prism/src/mod/oasis3/COMP_oasis3*20 rm -f ${ d_n}/../prism/util/COMP_libs*21 echo "Suppression de COMP_oasis3 et COMP_libs"25 echo "Remove COMP_oasis3 and COMP_libs" 26 rm -f ${l_prism}/src/mod/oasis3/COMP_oasis3* 27 rm -f ${l_prism}/util/COMP_libs* 22 28 fi 29 echo ""; 23 30 #- 24 31 exit 0; -
modipsl/trunk/util/ins_make
r294 r728 1 #!/bin/ ksh1 #!/bin/bash 2 2 # $Id$ 3 3 #--------------------------------------------------------------------- 4 4 #- Installation of Makefiles according to an environment 5 5 #--------------------------------------------------------------------- 6 shopt -s extglob 7 #- 6 8 function ins_make_Usage 7 9 { 8 typeset -L13 h_n; typeset v0 v1 v2 v3 v4 v5 v6 v7;9 print -"10 typeset v0 v1 v2 v3 v4 v5 v6 v7 h_n; 11 echo -e " 10 12 ins_make install the Makefile in the directories 11 13 … … 27 29 ins_make -t sx8brodie 28 30 " 29 print -"Supported targets :\n"30 [[ ! -f "${MKTG}" ]] && { print -"? (${MKTG} unreachable)\n"; exit 3; }31 echo -e "Supported targets :\n" 32 [[ ! -f "${MKTG}" ]] && { echo -e "? (${MKTG} unreachable)\n"; exit 3; } 31 33 while read v1 v2 v3 v4 v5 v6 v7 32 34 do 33 35 [[ -n "${v1}" && "${v1}${v3}" = '#-Q-#-' && \ 34 36 -n "${v4}" && "${v4}${v5}${v6}" = 'Globaldefinitionsfor' ]] && \ 35 { h_n=${v2} ; print - "${h_n} : ${v7}"; }37 { h_n=${v2}' '; echo -e "${h_n:0:13} : ${v7}"; } 36 38 done <${MKTG} 37 print -"38 Fo tother targets, look in ${MKTG}.39 echo -e " 40 For other targets, look in ${MKTG}. 39 41 " 40 42 } … … 43 45 #- File containing global definitions 44 46 MKTG=${d_n}'/AA_make.gdef' 47 45 48 #- Retrieving and validation of the options 46 49 x_v='silencious'; x_d='normal'; x_p="??"; x_t="??"; x_m='??'; … … 84 87 { echo "Local_Host not supported" 1>&2; exit 1; }; } 85 88 #- 89 # Get editing header 90 x_h=$(${d_n}/w_i_p ${x_t}); 91 #- 86 92 [[ ! -f "${MKTG}" ]] && { echo "${MKTG} unreachable ..."; exit 3; } 87 93 #- 88 W_X X=$(sed -n -e "s/^#-Q- *\(${x_t}\)[\t ].*$/\1/p" ${MKTG} | sort -u);89 [[ '\?'"${W_X X}" != '\?'"${x_t}" ]] && \94 W_X1=$(sed -n -e "s/^#-Q- *\(${x_h}\)[\t ].*$/\1/p" ${MKTG} | sort -u); 95 [[ '\?'"${W_X1}" != '\?'"${x_h}" ]] && \ 90 96 { echo "Target_Host "${x_t}" not supported" 1>&2; exit 1; } 91 97 #- … … 103 109 echo '--- MPI context : '${x_m}; } 104 110 #- 105 echo ""; echo "Installation of makefiles for ${x_t}"; echo ""; 111 echo ""; 112 echo "Installation of makefiles, scripts and data for ${x_t}"; 113 echo ""; 106 114 #- 107 l_rep=$(find ${d_n}/.. -name AA_make -print) 115 w_t='AA_make'; 116 l_rep=$(cd ${d_n};find .. -name ${w_t} -print) 108 117 for i in ${l_rep} 109 118 do 110 j=${i%/AA_make};119 k=${i%/${w_t}}; k=${k#./}; j=${d_n}'/'${k}; j=${j#./}; 111 120 echo "Installation in ${j}"; 112 121 MKTL="${j}"'/AA_make.ldef'; … … 114 123 MKTR="${j}"'/AA_make'; 115 124 cat ${MKTL} ${MKTG} ${MKTR} > mk1.$$; 116 W_PR='#-Q- *'; W_X X=${W_PR}${x_t};117 sed -e "/^${W_X X}[\t ]/ s/^${W_XX} *//" -e "/^${W_PR}/d" mk1.$$ > mk2.$$;125 W_PR='#-Q- *'; W_X1=${W_PR}${x_h}; 126 sed -e "/^${W_X1}[\t ]/ s/^${W_X1} *//" -e "/^${W_PR}/d" mk1.$$ > mk2.$$; 118 127 #- 119 128 # Default INTEGER and REAL precision 120 W_PR='#-P- '; W_X X=${W_PR}${x_p};121 sed -e "/^${W_X X} */ s///" -e "/^${W_PR}/d" mk2.$$ > mk1.$$;129 W_PR='#-P- '; W_X1=${W_PR}${x_p}; 130 sed -e "/^${W_X1} */ s///" -e "/^${W_PR}/d" mk2.$$ > mk1.$$; 122 131 #- 123 132 # Handle the precision module "defprec.f90" in "IOIPSL/src" 124 133 [[ '!!'${j##*/modeles} = '!!/IOIPSL/src' ]] && \ 125 { [[ ${x_v} = 'verbose' ]] && W_X X='-v' || W_XX="";126 ${d_n}/ins_m_prec ${W_X X} -i ${w_ip} -r ${w_rp}; r_c=${?};134 { [[ ${x_v} = 'verbose' ]] && W_X1='-v' || W_X1=""; 135 ${d_n}/ins_m_prec ${W_X1} -i ${w_ip} -r ${w_rp}; r_c=${?}; 127 136 unset w_ip w_rp; 128 137 [[ ${r_c} != 0 ]] && exit ${r_c}; } … … 130 139 # Debug 131 140 W_PR='#-D- '; 132 [[ ${x_d} = 'debug' ]] && W_X X=${W_PR}'MD' || W_XX=${W_PR}'MN';133 sed -e "/^${W_X X} */ s///" -e "/^${W_PR}/d" mk1.$$ > mk2.$$;141 [[ ${x_d} = 'debug' ]] && W_X1=${W_PR}'MD' || W_X1=${W_PR}'MN'; 142 sed -e "/^${W_X1} */ s///" -e "/^${W_PR}/d" mk1.$$ > mk2.$$; 134 143 #- 135 # Retrieve the path of the directory 136 mk_dir=$(cd ${j};/bin/pwd;) 137 W_XX='MAKE_DIR =' 138 # Update the value 139 sed -e "s!^${W_XX}.*!${W_XX} ${mk_dir}!" mk2.$$ > mk1.$$ 140 unset mk_dir; 144 # Retrieve the path of the Makefile directory 145 # and the path from the directory to modipsl/util 146 mk_dir=$(cd ${j};/bin/pwd;); 147 ut_dir=''; for ww in ${k//\//' '}; do ut_dir=${ut_dir}'../'; done 148 ut_dir=${ut_dir%'../'}'util'; 149 echo "Path from Makefile to modipsl/util : ${ut_dir}"; 150 # Update the values 151 W_X1='UTIL_DIR ='; W_X2='MAKE_DIR ='; 152 sed -e "s!^${W_X1}.*!${W_X1} ${ut_dir}!" \ 153 -e "s!^${W_X2}.*!${W_X2} ${mk_dir}!" \ 154 mk2.$$ > mk1.$$ 155 unset mk_dir ut_dir; 141 156 #- 142 157 # Choice of mpi library for the coupling 143 W_X X='LIB_MPI ='; W_XX_BIS='LIB_MPI_BIS =';158 W_X1='LIB_MPI ='; W_X2='LIB_MPI_BIS ='; 144 159 case ${x_m} in 145 160 ( mpi1 | MPI1 ) 146 161 lib_mpi='MPI1'; lib_mpi_bis='MPI1'; 147 sed -e "s!^${W_X X}.*!${W_XX} ${lib_mpi}!" \148 -e "s!^${W_X X_BIS}.*!${W_XX_BIS} ${lib_mpi_bis}!" \162 sed -e "s!^${W_X1}.*!${W_X1} ${lib_mpi}!" \ 163 -e "s!^${W_X2}.*!${W_X2} ${lib_mpi_bis}!" \ 149 164 mk1.$$ > ${j}/Makefile;; 150 165 ( mpi2 | MPI2 ) 151 166 lib_mpi='MPI2'; lib_mpi_bis=''; 152 sed -e "s!^${W_X X}.*!${W_XX} ${lib_mpi}!" \153 -e "s!^${W_X X_BIS}.*!${W_XX_BIS} ${lib_mpi_bis}!" \167 sed -e "s!^${W_X1}.*!${W_X1} ${lib_mpi}!" \ 168 -e "s!^${W_X2}.*!${W_X2} ${lib_mpi_bis}!" \ 154 169 mk1.$$ > ${j}/Makefile;; 155 170 (??) … … 158 173 esac 159 174 unset lib_mpi lib_mpi_bis; 175 #- 160 176 done 161 177 #- 178 # Creating environment file 179 echo ${x_t} > ${d_n}/.host_target 180 #- 162 181 echo ""; 163 unset W_X X W_XX_BIS; rm -f mk1.$$ mk2.$$;182 unset W_X1 W_X2 w_t; rm -f mk1.$$ mk2.$$; 164 183 #- 165 184 exit 0; -
modipsl/trunk/util/w_i_h
r609 r728 1 #!/bin/ ksh1 #!/bin/bash 2 2 # $Id$ 3 3 #-----------------------------------------------# 4 #- What is host ? - w_i_h - 20/03/2008-#4 #--- What is host ? - w_i_h - 21/07/2009 ---# 5 5 #-----------------------------------------------# 6 6 w_z=$(uname -s -n -r -m 2>/dev/null); 7 7 [[ ${?} != 0 ]] && { exit 1; } 8 read u_s u_n u_r u_m << ! 9 $(print - ${w_z}) 10 ! 8 read u_s u_n u_r u_m <<< ${w_z} 11 9 unset w_z; 10 #- 11 d_n=$(dirname ${0}); 12 12 #- 13 13 case ${u_s} in 14 14 ( AIX ) \ 15 15 { case ${u_n} in 16 17 18 16 ( zahir* ) DSYS="aix";; 17 ( vargas* ) DSYS="aix6";; 18 ( * ) DSYS="ax_mono"; 19 19 esac 20 20 };; 21 ( AIXESA ) 22 ( ConvexOS ) 23 ( CP486 | dev ) 24 ( Darwin ) 21 ( AIXESA ) DSYS="aixesa";; 22 ( ConvexOS ) DSYS="convex";; 23 ( CP486 | dev ) DSYS="sco";; 24 ( Darwin ) DSYS="Darwin";; 25 25 ( HP-UX ) \ 26 26 { case ${u_n} in 27 28 27 ( moon ) DSYS="eshpux";; 28 ( * ) DSYS="hpux";; 29 29 esac 30 30 };; 31 31 ( IRIX ) \ 32 32 { case ${u_r} in 33 34 33 ( 4\.* ) DSYS="sgi4";; 34 ( * ) DSYS="sgi5";; 35 35 esac 36 36 };; 37 ( IRIX64 ) 37 ( IRIX64 ) DSYS="sgi6";; 38 38 ( Linux ) \ 39 39 { case ${u_n} in 40 ( asterix* | obelix* ) DSYS="lxiv8";; 41 ( argent[0-9]* ) DSYS="argent";; 42 ( cesium[0-9]* ) DSYS="cesium";; 43 ( platine[0-9]* ) DSYS="platine";; 44 ( mercure ) DSYS="sx8mercure";; 45 ( brodie ) DSYS="sx8brodie";; 46 ( ulam ) DSYS="ulam";; 47 ( ds[0-9]* ) DSYS="sxdkrz";; 48 ( babel* ) DSYS="babel";; 49 ( * ) DSYS="linux";; 40 ( asterix* | obelix* ) DSYS="lxiv8";; 41 ( argent[0-9]* ) DSYS="argent";; 42 ( cesium[0-9]* ) DSYS="cesium";; 43 ( platine[0-9]* ) DSYS="platine";; 44 ( mercure ) \ 45 { DSYS="sx8mercure" 46 u_l=$(/usr/bin/modulecmd bash list -t 2>&1) 47 for h in ${u_l} 48 do 49 [[ ${h} = 'SX9' ]] && { DSYS="sx9mercure"; break; } 50 done 51 unset u_l h 52 };; 53 ( brodie ) DSYS="sx8brodie";; 54 ( ulam ) DSYS="ulam";; 55 ( ds[0-9]* ) DSYS="sxdkrz";; 56 ( babel* ) DSYS="babel";; 57 ( * ) DSYS="linux";; 50 58 esac 51 59 };; 52 ( MIPS ) 53 ( OSF1 ) 60 ( MIPS ) DSYS="mips";; 61 ( OSF1 ) DSYS="osf1";; 54 62 ( SunOS ) \ 55 63 { case ${u_r} in 56 57 64 ( 5\.* ) DSYS="solaris";; 65 ( * ) DSYS="sun";; 58 66 esac 59 67 };; 60 ( SUPER-UX ) 61 ( ULTRIX ) 62 ( UNICOS | sn4803 | sn4602 ) 63 ( UNIX_System_V ) 68 ( SUPER-UX ) DSYS="nec";; 69 ( ULTRIX ) DSYS="ultrix";; 70 ( UNICOS | sn4803 | sn4602 ) DSYS="cray";; 71 ( UNIX_System_V ) DSYS="fjvpp";; 64 72 (*) \ 65 73 { case ${u_m} in 66 67 74 ( "CRAY T3E" ) DSYS="t3e";; 75 ( * ) DSYS="Unknown";; 68 76 esac 69 77 };;
Note: See TracChangeset
for help on using the changeset viewer.