Changeset 123 for trunk/Softwares/SPECINT2000/Makefile
- Timestamp:
- Jun 8, 2009, 10:43:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Softwares/SPECINT2000/Makefile
r119 r123 7 7 # 8 8 9 # common definition 9 include Makefile.defs 10 11 #-----[ Specint variable ]-------------------------------------------------------- 12 13 # BENCHS = 164.gzip \ 14 # 175.vpr \ 15 # 176.gcc \ 16 # 181.mcf \ 17 # 255.vortex \ 18 # 256.bzip2 \ 19 # 300.twolf 20 21 BENCHS = 164.gzip 22 23 10 24 SPECINT2000_PATH = /users/cao/kane/Project/SPEC_CPU2000/benchspec/CINT2000 11 SPECINT2000_PATHS = $(SPECINT2000_PATH)/164.gzip \ 12 $(SPECINT2000_PATH)/175.vpr \ 13 $(SPECINT2000_PATH)/176.gcc \ 14 $(SPECINT2000_PATH)/181.mcf \ 15 $(SPECINT2000_PATH)/255.vortex\ 16 $(SPECINT2000_PATH)/256.bzip2 \ 17 $(SPECINT2000_PATH)/300.twolf 18 19 # $(SPECINT2000_PATH)/164.gzip 20 # $(SPECINT2000_PATH)/175.vpr 21 # $(SPECINT2000_PATH)/176.gcc 22 # $(SPECINT2000_PATH)/181.mcf 23 # $(SPECINT2000_PATH)/186.crafty 24 # $(SPECINT2000_PATH)/197.parser 25 # $(SPECINT2000_PATH)/252.eon 26 # $(SPECINT2000_PATH)/253.perlbmk 27 # $(SPECINT2000_PATH)/254.gap 28 # $(SPECINT2000_PATH)/255.vortex 29 # $(SPECINT2000_PATH)/256.bzip2 30 # $(SPECINT2000_PATH)/300.twolf 25 SPECINT2000_PATHS = $(addprefix $(SPECINT2000_PATH)/, $(BENCHS)) 31 26 32 27 SPECINT2000_PATH_INC = $(addprefix -I, $(addsuffix /src, $(SPECINT2000_PATHS))) 33 28 SPECINT2000_PATH_SRC = $(wildcard $(addsuffix /src , $(SPECINT2000_PATHS))) 34 SPECINT2000_OBJECTS = $(addprefix $(DIR_OBJ)/164.gzip_, $(addsuffix .o, $(basename $(notdir $(wildcard $(SPECINT2000_PATH)/164.gzip/src/*.c)))))\ 35 36 # $(addprefix $(DIR_OBJ)/175.vpr_, $(addsuffix .o, $(basename $(notdir $(wildcard $(SPECINT2000_PATH)/175.vpr/src/*.c)))))\ 37 # $(addprefix $(DIR_OBJ)/181.mcf_, $(addsuffix .o, $(basename $(notdir $(wildcard $(SPECINT2000_PATH)/181.mcf/src/*.c))))) \ 38 # $(addprefix $(DIR_OBJ)/256.bzip2_, $(addsuffix .o, $(basename $(notdir $(wildcard $(SPECINT2000_PATH)/256.bzip2/src/*.c))))) \ 39 # $(addprefix $(DIR_OBJ)/176.gcc_, $(addsuffix .o, $(basename $(notdir $(wildcard $(SPECINT2000_PATH)/176.gcc/src/*.c))))) 40 # $(addprefix $(DIR_OBJ)/255.vortex_, $(addsuffix .o, $(basename $(notdir $(wildcard $(SPECINT2000_PATH)/255.vortex/src/*.c))))) \ 41 # $(addprefix $(DIR_OBJ)/300.twolf_, $(addsuffix .o, $(basename $(notdir $(wildcard $(SPECINT2000_PATH)/300.twolf/src/*.c))))) 29 SPECINT2000_OBJECTS = $(foreach bench,$(BENCHS),$(addprefix $(DIR_OBJ)/$(bench)_, $(addsuffix .o, $(basename $(notdir $(wildcard $(SPECINT2000_PATH)/$(bench)/src/*.c)))))) 30 31 #-----[ Directory ]--------------------------------------------------------------- 42 32 43 33 DIR_SOFT = .. … … 54 44 LIBNAME = $(NEWLIB_LIBNAME) 55 45 56 FLAGS = -DSPECINT2000_PATH=\"$(SPECINT2000_PATH)\" 46 FILE_BENCH = $(DIR_INC)/workload.h 47 FILE_BENCH_SED = $(DIR_INC)/workload.h.sed 48 49 #-----[ Flags ]------------------------------------------------------------------- 50 51 FLAGS = -DSPECINT2000_PATH=\"$(SPECINT2000_PATH)\" -DNB_THREAD_MAX=$(NB_THREAD_MAX) 57 52 FLAGS_164.gzip = 58 53 FLAGS_175.vpr = -DSPEC_CPU2000 … … 100 95 $(OR32_CC) $(OR32_CC_OPT) $(FLAGS_181.mcf) -o $@ -c $^ ; 101 96 97 $(DIR_OBJ)/186.crafty_%.o : $(SPECINT2000_PATH)/186.crafty/src/%.c 98 @\ 99 $(ECHO) "Compilation : $*.c"; \ 100 $(OR32_CC) $(OR32_CC_OPT) $(FLAGS_186.crafty) -o $@ -c $^ ; 101 102 102 $(DIR_OBJ)/255.vortex_%.o : $(SPECINT2000_PATH)/255.vortex/src/%.c 103 103 @\ … … 105 105 $(OR32_CC) $(OR32_CC_OPT) $(FLAGS_255.vortex) -o $@ -c $^ ; 106 106 107 $(DIR_OBJ)/197.parser_%.o : $(SPECINT2000_PATH)/197.parser/src/%.c 108 @\ 109 $(ECHO) "Compilation : $*.c"; \ 110 $(OR32_CC) $(OR32_CC_OPT) $(FLAGS_197.parser) -o $@ -c $^ ; 111 112 $(DIR_OBJ)/252.eon_%.o : $(SPECINT2000_PATH)/252.eon/src/%.c 113 @\ 114 $(ECHO) "Compilation : $*.c"; \ 115 $(OR32_CC) $(OR32_CC_OPT) $(FLAGS_252.eon) -o $@ -c $^ ; 116 117 $(DIR_OBJ)/253.perlbmk_%.o : $(SPECINT2000_PATH)/253.perlbmk/src/%.c 118 @\ 119 $(ECHO) "Compilation : $*.c"; \ 120 $(OR32_CC) $(OR32_CC_OPT) $(FLAGS_253.perlbmk) -o $@ -c $^ ; 121 122 $(DIR_OBJ)/254.gap_%.o : $(SPECINT2000_PATH)/254.gap/src/%.c 123 @\ 124 $(ECHO) "Compilation : $*.c"; \ 125 $(OR32_CC) $(OR32_CC_OPT) $(FLAGS_254.gap) -o $@ -c $^ ; 126 107 127 $(DIR_OBJ)/256.bzip2_%.o : $(SPECINT2000_PATH)/256.bzip2/src/%.c 108 128 @\ … … 114 134 $(ECHO) "Compilation : $*.c"; \ 115 135 $(OR32_CC) $(OR32_CC_OPT) $(FLAGS_300.twolf) -o $@ -c $^ ; 136 137 list : 138 @\ 139 for bench in $(BENCHS); do \ 140 $(ECHO) $${bench}; \ 141 done; 142 143 print : 144 @$(CAT) $(FILE_BENCH); 145 146 define : 147 @ \ 148 $(ECHO) "Give a Number of thread (1 by default, Max : $(NB_THREAD_MAX)) : "; \ 149 declare -i NB_THREAD=0; \ 150 $(READ) NB_THREAD; \ 151 \ 152 if $(TEST) "$$NB_THREAD" -ge "$(NB_THREAD_MAX)"; \ 153 then \ 154 NB_THREAD=$(NB_THREAD_MAX); \ 155 else \ 156 if $(TEST) "$$NB_THREAD" -eq 0; \ 157 then \ 158 NB_THREAD=1; \ 159 fi; \ 160 fi; \ 161 \ 162 $(ECHO) "You want $$NB_THREAD thread(s)"; \ 163 $(ECHO) ""; \ 164 declare -i NUM_THREAD=0; \ 165 declare WORKLOAD=""; \ 166 declare -i PREVIOUS=1; \ 167 declare -i CPT=2; \ 168 declare -a BENCHS; \ 169 \ 170 BENCHS[0]="previous choose"; \ 171 BENCHS[1]="none"; \ 172 for benchs in $(BENCHS); do \ 173 BENCHS[$$CPT]=$${benchs/"."/"_"}; \ 174 CPT=$$(($$CPT+1)); \ 175 done; \ 176 \ 177 $(ECHO) "For each Thread, you must select a number of benchmark (0 by default)";\ 178 $(ECHO) ""; \ 179 \ 180 while [ $$NUM_THREAD -lt $$NB_THREAD ]; \ 181 do \ 182 if $(TEST) $$NUM_THREAD -ne 0; \ 183 then \ 184 WORKLOAD=$$WORKLOAD",\n"; \ 185 fi; \ 186 \ 187 $(ECHO) "For Thread[$$NUM_THREAD] ....."; \ 188 declare -i NUM_BENCH; \ 189 \ 190 $(ECHO) "0) previous choose : $${BENCHS[$$PREVIOUS]}"; \ 191 CPT=1; \ 192 while [ $$CPT -lt $${#BENCHS[*]} ]; \ 193 do \ 194 $(ECHO) "$$CPT) $${BENCHS[$$CPT]}"; \ 195 CPT=$$(($$CPT+1)); \ 196 done; \ 197 $(READ) NUM_BENCH; \ 198 \ 199 if $(TEST) "$$NUM_BENCH" -ge "$$CPT"; \ 200 then \ 201 NUM_BENCH=0; \ 202 fi; \ 203 \ 204 if $(TEST) "$$NUM_BENCH" -eq "0"; \ 205 then \ 206 NUM_BENCH=$$PREVIOUS; \ 207 else \ 208 PREVIOUS=$$NUM_BENCH; \ 209 fi; \ 210 \ 211 $(ECHO) "Benchmark selected : $${BENCHS[$$NUM_BENCH]}"; \ 212 $(ECHO) ""; \ 213 \ 214 WORKLOAD=$$WORKLOAD"\t(void *) run_$${BENCHS[$$NUM_BENCH]}"; \ 215 NUM_THREAD=$$(($$NUM_THREAD+1)); \ 216 done; \ 217 $(ECHO) ""; \ 218 $(ECHO) "Generate the file : $(FILE_BENCH)"; \ 219 $(CAT) $(FILE_BENCH_SED) |$(SED) "s/@WORKLOAD/$$WORKLOAD/" > $(FILE_BENCH); \ 220 $(RM) $$$$; \ 221 $(ECHO) ""; 222 223 224 workload : 225 @ \ 226 $(ECHO) "Give a Number of thread (1 by default, Max : $(NB_THREAD_MAX)) : "; \ 227 declare -i NB_THREAD=0; \ 228 $(READ) NB_THREAD; \ 229 \ 230 if $(TEST) "$$NB_THREAD" -ge "$(NB_THREAD_MAX)"; \ 231 then \ 232 NB_THREAD=$(NB_THREAD_MAX); \ 233 else \ 234 if $(TEST) "$$NB_THREAD" -eq 0; \ 235 then \ 236 NB_THREAD=1; \ 237 fi; \ 238 fi; \ 239 \ 240 $(ECHO) " * You want $$NB_THREAD thread(s)"; \ 241 $(ECHO) ""; \ 242 $(ECHO) "List of all Benchmark"; \ 243 declare -i CPT=1; \ 244 declare -a BENCHS; \ 245 \ 246 for benchs in $(BENCHS); do \ 247 $(ECHO) " $$CPT) $$benchs"; \ 248 BENCHS[$$CPT]=$${benchs/"."/"_"}; \ 249 CPT=$$(($$CPT+1)); \ 250 done; \ 251 $(ECHO) ""; \ 252 $(ECHO) "Enter the list benchmark (0 to stop)"; \ 253 declare -i NUM_BENCH; \ 254 CPT=1; \ 255 declare -a -i WORKLOAD; \ 256 \ 257 while $(TEST) 1; do \ 258 $(READ) NUM_BENCH; \ 259 \ 260 if $(TEST) $$NUM_BENCH -eq 0; then \ 261 break; \ 262 fi; \ 263 \ 264 if $(TEST) $$NUM_BENCH -gt $${#BENCHS[*]}; then \ 265 $(ECHO) " * Out of limit, retry ..."; \ 266 else \ 267 echo " * $${BENCHS[$$NUM_BENCH]}"; \ 268 WORKLOAD[$$CPT]=$$NUM_BENCH; \ 269 CPT=$$(($$CPT+1)); \ 270 fi; \ 271 done; \ 272 \ 273 if $(TEST) $$NB_THREAD -gt $${#WORKLOAD[*]}; then \ 274 $(ECHO) "Error : The number of bench in the workload ($${#WORKLOAD[*]}) is < at the number of thread ($$NB_THREAD)"; \ 275 exit; \ 276 fi; \ 277 $(ECHO) ""; \ 278 $(ECHO) "Generate the workload"; \ 279 \ 280 declare -i NB_ITERATION=1; \ 281 CPT=$$(($$NB_THREAD+1)); \ 282 while $(TEST) $$CPT -le $${#WORKLOAD[*]}; do \ 283 NB_ITERATION=$$(($$NB_ITERATION*$$CPT)); \ 284 CPT=$$(($$CPT+1)); \ 285 done; \ 286 CPT=$$(($${#WORKLOAD[*]}-$$NB_THREAD)); \ 287 while $(TEST) $$CPT -gt 0; do \ 288 NB_ITERATION=$$(($$NB_ITERATION/$$CPT)); \ 289 CPT=$$(($$CPT-1)); \ 290 done; \ 291 $(ECHO) " * $$NB_ITERATION Workloads (n!/(p!*(n-p)!))"; \ 292 \ 293 declare -a -i PTR; \ 294 CPT=1; \ 295 while $(TEST) $$CPT -le $$NB_THREAD; do \ 296 PTR[$$CPT]=$$(($$NB_THREAD-$$CPT+1)); \ 297 CPT=$$(($$CPT+1)); \ 298 done; \ 299 \ 300 CPT=0; \ 301 declare -i IT; \ 302 declare -a -i OVF; \ 303 declare -a -i NB_OVF; \ 304 \ 305 while $(TEST) $$CPT -lt $$NB_ITERATION; do \ 306 declare COMMAND="$$NB_THREAD\n"; \ 307 echo -ne " - [$$CPT]\t"; \ 308 \ 309 OVF[0]=0; \ 310 NB_OVF=0; \ 311 if $(TEST) $${PTR[1]} -ge $${#WORKLOAD[*]}; then \ 312 OVF[0]=1; \ 313 fi; \ 314 \ 315 IT=1; \ 316 while $(TEST) $$IT -le $$NB_THREAD; do \ 317 echo -ne " $${BENCHS[$${WORKLOAD[$${PTR[$$IT]}]}]}\t"; \ 318 \ 319 COMMAND="$${COMMAND}$$(($${WORKLOAD[$${PTR[$$IT]}]}+1))\n"; \ 320 OVF[$$(($$IT))]=0; \ 321 if $(TEST) $${OVF[$$(($$IT-1))]} -eq 1 ; then \ 322 if $(TEST) $$(($${PTR[$$IT]}+$$NB_OVF)) -ge $${#WORKLOAD[*]}; then \ 323 OVF[$$IT]=1; \ 324 NB_OVF=$$(($$NB_OVF+1)); \ 325 fi; \ 326 fi; \ 327 \ 328 IT=$$(($$IT+1)); \ 329 done; \ 330 echo ""; \ 331 \ 332 $(ECHO) -e $${COMMAND} | $(MAKE) define; \ 333 $(MAKE) $(DIR_BIN)/$(EXE)_$${CPT}.x; \ 334 \ 335 PTR[1]=$$(($${PTR[1]}+1)); \ 336 IT=$$NB_THREAD; \ 337 while $(TEST) $$IT -ge 1; do \ 338 if $(TEST) $${OVF[$$IT]} -eq 1 ; then \ 339 PTR[$$(($$IT))]=$${PTR[$$(($$IT+1))]}; \ 340 fi; \ 341 \ 342 if $(TEST) $${OVF[$$(($$IT-1))]} -eq 1 ; then \ 343 PTR[$$(($$IT))]=$$(($${PTR[$$IT]}+1)); \ 344 fi; \ 345 IT=$$(($$IT-1)); \ 346 done; \ 347 \ 348 CPT=$$(($$CPT+1)); \ 349 done; \
Note: See TracChangeset
for help on using the changeset viewer.