Changeset 82 for palm/trunk/SCRIPTS/mbuild
- Timestamp:
- Apr 16, 2007 3:40:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/mbuild
r75 r82 87 87 # adjustments for running under pdksh, local ip-addres 88 88 # is not determined any more 89 # 30/03/07 - Siggi - cpp-directives/options + netcdf-options are read 90 # from configuration file 91 # host identifier (local_host) is read from config file 89 92 90 93 … … 159 162 160 163 161 # LOKALEN RECHNER ERMITTELN162 local_host_real_name=$(hostname)163 # local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')164 165 case $local_host_real_name in166 (atmos) local_host=lcide;;167 (berte) local_host=t3eb;;168 (bora|breva|gregale|irifi|levanto|maestro|orkan|ostria|quanero|scirocco) local_host=lcmuk;;169 (fimm.bccs.uib.no) local_host=lcmuk;;170 (gate) local_host=neck;;171 (gfdl3.yonsei.ac.kr) local_host=decalpha;;172 (gfdl5) local_host=ibmy;;173 (gwdk081.gwdg.de) local_host=ibm;;174 (hreg01a-en0|hreg02a-en0) local_host=ibmh;;175 (nobel|nobela) local_host=ibms;;176 (tgg*) local_host=lctit;;177 (t3e) local_host=t3eh;;178 (zam003) local_host=t3ej2;;179 (zam005) local_host=t3ej5;;180 (*) printf "\n +++ local host \"$local_host_real_name\" not admitted for mbuild \n"181 locat=local_host; exit;;182 esac183 184 [[ $local_host_real_name = scirocco ]] && scirocco=true185 [[ $local_host_real_name = fimm.bccs.uib.no ]] && fimm=true186 187 188 189 164 # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN 190 165 if [[ ! -f $config_file ]] … … 195 170 locat=configuration; exit 196 171 fi 172 173 174 175 # LOKALEN RECHNER ERMITTELN 176 local_host_real_name=$(hostname) 177 # local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}') 178 179 180 181 # HOST-IDENTIFIER (local_host) AUS KONFIGURATIONSDATEI BESTIMMEN 182 line="" 183 grep "%host_identifier" $config_file > tmp_mbuild 184 while read line 185 do 186 if [[ "$line" != "" || $(echo $line | cut -c1) != "#" ]] 187 then 188 HOSTNAME=`echo $line | cut -d" " -s -f2` 189 host_identifier=`echo $line | cut -d" " -s -f3` 190 if [[ "$HOSTNAME" = $local_host_real_name ]] 191 then 192 local_host=$host_identifier 193 break 194 fi 195 fi 196 done < tmp_mbuild 197 198 if [[ "$local_host" = "" ]] 199 then 200 printf "\n +++ no host identifier found in configuration file \"$config_file\"" 201 printf "\n for local host \"$local_host_real_name\"." 202 printf "\n Please add line" 203 printf "\n \"\%host_identifier $local_host_real_name <identifier>\"" 204 printf "\n to the configuration file." 205 locat=local_host; exit 206 fi 207 208 209 # case $local_host_real_name in 210 # (atmos) local_host=lcide;; 211 # (berte) local_host=t3eb;; 212 # (bora|breva|gregale|irifi|levanto|maestro|orkan|ostria|quanero|scirocco) local_host=lcmuk;; 213 # (fimm.bccs.uib.no) local_host=lcmuk;; 214 # (gate) local_host=neck;; 215 # (gfdl3.yonsei.ac.kr) local_host=decalpha;; 216 # (gfdl5) local_host=ibmy;; 217 # (gwdk081.gwdg.de) local_host=ibm;; 218 # (hreg01a-en0|hreg02a-en0) local_host=ibmh;; 219 # (nobel|nobela) local_host=ibms;; 220 # (tgg*) local_host=lctit;; 221 # (t3e) local_host=t3eh;; 222 # (zam003) local_host=t3ej2;; 223 # (zam005) local_host=t3ej5;; 224 # (*) printf "\n +++ local host \"$local_host_real_name\" not admitted for mbuild \n" 225 # locat=local_host; exit;; 226 # esac 227 228 [[ $local_host_real_name = scirocco ]] && scirocco=true 229 [[ $local_host_real_name = fimm.bccs.uib.no ]] && fimm=true 230 231 232 197 233 if [[ $local_host != ibms ]] 198 234 then … … 214 250 fi 215 251 done < tmp_mbuild 252 216 253 217 254 if [[ "$local_username" = "" ]] … … 673 710 fi 674 711 712 netcdf_inc="" 713 netcdf_lib="" 675 714 676 715 # AUF HLRN-RECHNER NUR EINMAL UEBERSETZEN … … 700 739 netcdf_support=false 701 740 case $remote_host in 702 (lcmuk) remote_addres=130.75.105.3 ; cpp_options=""741 (lcmuk) remote_addres=130.75.105.3 703 742 netcdf_support=true 704 743 if [[ $scirocco = true ]] … … 939 978 940 979 980 # PRAEPROZESSOR-OPTIONEN/DIREKTIVEN ERMITTELN 981 line="" 982 grep "$remote_host_string" $config_file | grep "%cpp_options" > tmp_mbuild 983 while read line1 984 do 985 if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] 986 then 987 line="$line1" 988 fi 989 done < tmp_mbuild 990 if [[ "$line" = "" || $(echo $line | cut -c1) = "#" ]] 991 then 992 printf "\n +++ no preprocessor options found in configuration file" 993 printf "\n for \"$remote_host_string\" " 994 locat=config_file; exit 995 else 996 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 997 cpp_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 998 fi 999 1000 # RECHNERSPEZIFISCHE CPP-DIREKTIVEN HINZUFUEGEN 1001 for string in $remote_host_string 1002 do 1003 if [[ $(echo $remote_host | cut -c1-2) = lc && $(echo $string | cut -c1-2) = lc ]] 1004 then 1005 cpp_options="$cpp_options -D__lc " 1006 else 1007 cpp_options="$cpp_options -D__$string " 1008 fi 1009 done 1010 1011 1012 1013 # NETCDF-OPTIONEN ERMITTELN 1014 line="" 1015 grep "$remote_host_string" $config_file | grep "%netcdf_inc" > tmp_mbuild 1016 while read line1 1017 do 1018 if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] 1019 then 1020 line="$line1" 1021 fi 1022 done < tmp_mbuild 1023 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 1024 then 1025 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 1026 netcdf_inc=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 1027 fi 1028 1029 line="" 1030 grep "$remote_host_string" $config_file | grep "%netcdf_lib" > tmp_mbuild 1031 while read line1 1032 do 1033 if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] 1034 then 1035 line="$line1" 1036 fi 1037 done < tmp_mbuild 1038 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 1039 then 1040 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 1041 netcdf_lib=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 1042 fi 1043 1044 1045 941 1046 # COMPILEROPTIONEN ERMITTELN 942 1047 line="" … … 957 1062 # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN 958 1063 compiler_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 959 fi 1064 1065 # NETCDF-INCLUDEVERZEICHNIS HINZUFUEGEN 1066 compiler_options="$compiler_options $netcdf_inc" 1067 fi 1068 960 1069 if [[ $netcdf_support = true ]] 961 1070 then … … 965 1074 (ibms) compiler_options="-I /applic/netcdf64/src/f90 $compiler_options";; 966 1075 (ibmy) compiler_options="-I ${netcdf_path}/include $compiler_options";; 967 (lcmuk) compiler_options="-I ${netcdf_path}/include $compiler_options";;968 1076 (lctit) compiler_options="-I ${netcdf_path}/include $compiler_options";; 969 1077 (nech|neck) compiler_options="-I ${netcdf_path}/include $compiler_options";; 970 1078 esac 971 1079 fi 972 973 1080 974 1081 … … 992 1099 # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN 993 1100 loader_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 994 fi 1101 1102 # NETCDF-LIBRARY HINZUFUEGEN 1103 loader_options="$loader_options $netcdf_lib" 1104 fi 1105 995 1106 if [[ $netcdf_support = true ]] 996 1107 then 997 1108 case $remote_host in 998 (decalpha) 999 (ibmb|ibmh| lcmuk|nech|neck) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;1000 (ibms) 1001 (ibmy) 1002 (lctit) 1109 (decalpha) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";; 1110 (ibmb|ibmh|nech|neck) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";; 1111 (ibms) loader_options="$loader_options -L${netcdf_path} -lnetcdf";; 1112 (ibmy) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";; 1113 (lctit) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";; 1003 1114 esac 1004 1115 fi
Note: See TracChangeset
for help on using the changeset viewer.