Changeset 124 for trunk/Softwares/SPECINT2000/Makefile
- Timestamp:
- Jun 17, 2009, 2:11:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Softwares/SPECINT2000/Makefile
r123 r124 10 10 11 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.twolf20 21 BENCHS = 164.gzip22 23 12 24 13 SPECINT2000_PATH = /users/cao/kane/Project/SPEC_CPU2000/benchspec/CINT2000 … … 40 29 DIR_LDSCRIPT = $(NEWLIB)/lib/ 41 30 42 INCDIR = $(NEWLIB_INCDIR) -I$(DIR_INC) $(SPECINT2000_PATH_INC)31 INCDIR = $(NEWLIB_INCDIR) -I$(DIR_INC) 43 32 LIBDIR = $(NEWLIB_LIBDIR) 44 33 LIBNAME = $(NEWLIB_LIBNAME) 45 46 FILE_BENCH = $(DIR_INC)/workload.h47 FILE_BENCH_SED = $(DIR_INC)/workload.h.sed48 34 49 35 #-----[ Flags ]------------------------------------------------------------------- 50 36 51 37 FLAGS = -DSPECINT2000_PATH=\"$(SPECINT2000_PATH)\" -DNB_THREAD_MAX=$(NB_THREAD_MAX) 52 FLAGS_164.gzip = 53 FLAGS_175.vpr = -DSPEC_CPU2000 54 FLAGS_176.gcc = 55 FLAGS_181.mcf = -DWANT_STDC_PROTO 56 FLAGS_186.crafty = 57 FLAGS_197.parser = 58 FLAGS_252.eon = 59 FLAGS_253.perlbmk = 60 FLAGS_254.gap = 61 FLAGS_255.vortex = 62 FLAGS_256.bzip2 = -DWANT_STDC_PROTO 63 FLAGS_300.twolf = -DSPEC_CPU2000 38 39 FLAGS_164.gzip = -I$(SPECINT2000_PATH)/164.gzip/src 40 FLAGS_175.vpr = -I$(SPECINT2000_PATH)/175.vpr/src -DSPEC_CPU2000 41 FLAGS_176.gcc = -I$(SPECINT2000_PATH)/176.gcc/src 42 FLAGS_181.mcf = -I$(SPECINT2000_PATH)/181.mcf/src -DWANT_STDC_PROTO 43 FLAGS_186.crafty = -I$(SPECINT2000_PATH)/186.crafty/src 44 FLAGS_197.parser = -I$(SPECINT2000_PATH)/197.parser/src 45 FLAGS_252.eon = -I$(SPECINT2000_PATH)/252.eon/src 46 FLAGS_253.perlbmk = -I$(SPECINT2000_PATH)/253.perlbmk/src 47 FLAGS_254.gap = -I$(SPECINT2000_PATH)/254.gap/src 48 FLAGS_255.vortex = -I$(SPECINT2000_PATH)/255.vortex/src 49 FLAGS_256.bzip2 = -I$(SPECINT2000_PATH)/256.bzip2/src -DWANT_STDC_PROTO 50 FLAGS_300.twolf = -I$(SPECINT2000_PATH)/300.twolf/src -DSPEC_CPU2000 64 51 65 52 #-----[ Files ]------------------------------------------------------------------- … … 74 61 75 62 include $(DIR_SOFT)/Makefile.Software 63 include $(DIR_SOFT)/Makefile.Workload 76 64 77 65 $(DIR_OBJ)/164.gzip_%.o : $(SPECINT2000_PATH)/164.gzip/src/%.c … … 134 122 $(ECHO) "Compilation : $*.c"; \ 135 123 $(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.