# Makefile for nbench, December 11, 1997, Uwe F. Mayer # Updated February 18, 2003 default: nbench ########################################################################## # If you are using gcc-2.7.2.3 or earlier: # The optimizer of gcc has a bug and in general you should not specify # -funroll-loops together with -O (or -O2, -O3, etc.) # This bug is supposed to be fixed with release 2.8 of gcc. # # This bug does NOT seem to have an effect on the correct compilation # of this benchmark suite on my Linux box. However, it leads to # the dreaded "internal compiler error" message on our alpha # running DEC Unix 4.0b. The Linux-binary that was used to obtain # the baseline results was nevertheless compiled with # CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops # # You should leave -static in the CFLAGS so that your sysinfo can be # compiled into the executable. CCC=gcc GCC=gcc # generic options for gcc #CFLAGS=-O3 -mcpu=ev67 -mieee -funroll-loops -ftree-vectorize -fprefetch-loop-arrays -pipe -static -msmall-data -msmall-text #CFLAGS=-O3 -mcpu=ev67 -mieee -pipe -msmall-data -msmall-text -funroll-loops -ftree-vectorize -static GCCFLAGS=-O3 -march=k8 -msse3 -ftree-vectorize -funroll-loops -pipe #CCCFLAGS=-fast -unroll 0 -inline speed CCCFLAGS=${GCCFLAGS} LINKFLAGS= # if your gcc lets you do it, then try this one #CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops # for gcc on an older Pentium type processor you can try the following #CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -m486 \ # -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \ # -falign-jumps=2 -funroll-loops # for a newer gcc on a newer Pentium type processor you can try the following #CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -march=i686 \ # -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \ # -falign-jumps=2 -funroll-loops # for a newer gcc on an Athlon XP type processor you can try the following #CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -march=athlon-xp \ # -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \ # -falign-jumps=2 -funroll-loops # For debugging using gcc #CFLAGS = -g -O3 -Wall -DDEBUG ########################################################################## # For Linux machines with more than one binary format. # The default binaries, depends on your system whether it's elf or aout. MACHINE= # a.out code for linux on an elf machine #MACHINE= -bi486-linuxaout # elf code for linux on an a.out machine #MACHINE= -bi486-linuxelf # if you want a different compiler version and different binaries, for example #MACHINE= -V2.7.2 -bi486-linuxaout ########################################################################## # Read the file README.nonlinux if you are not using Linux # for DEC Unix using cc you can try #CC = cc #CFLAGS = -O3 #LINKFLAGS = -s -non_shared # for SunOS using cc #CC = cc #CFLAGS = -O3 -s # for DEC Ultrix using cc #CC = cc #CFLAGS = -O2 #LINKFLAGS = -s # for a Mac with OsX and the Darwin environment #CC = cc #CFLAGS = -O3 -DOSX # For debugging using cc #CC = cc #CFLAGS = -g -DDEBUG ########################################################################## # If your system does not understand the system command "uname -s -r" # then comment this out # NO_UNAME= -DNO_UNAME ########################################################################## # For any Unix flavor you need -DLINUX # You also need -DLINUX to get the new indices DEFINES=$(NO_UNAME) -DLINUX ########################################################################## # For LINUX-like systems with gcc sysinfoc.c: Makefile ./sysinfo.sh $(GCC) $(DEFINES) $(GCCFLAGS) sysinfo.c: Makefile ./sysinfo.sh $(GCC) $(DEFINES) $(GCCFLAGS) ########################################################################## # For non-LINUX systems # Edit the files sysinfo.c and sysinfoc.c to include your system information # and take sysinfo.c and sysinfoc.c out of the dependencies for nbench0.o hardware.o: hardware.c hardware.h Makefile $(GCC) $(DEFINES) $(GCCFLAGS) -c hardware.c nbench0.o: nbench0.h nbench0.c nmglobal.h hardware.h Makefile sysinfo.c sysinfoc.c $(GCC) $(DEFINES) $(GCCFLAGS) -c nbench0.c # Segfault before first test emfloat.o: emfloat.h emfloat.c nmglobal.h Makefile $(CCC) $(DEFINES) $(CCCFLAGS) -c emfloat.c randnum.o: randnum.c Makefile $(CCC) $(DEFINES) $(CCCFLAGS) -c randnum.c numsort.o: numsort.c $(CCC) $(DEFINES) $(CCCFLAGS) -c numsort.c # gcc - 2.95 # ccc - 5.08 stringsort.o: stringsort.c $(CCC) $(DEFINES) $(CCCFLAGS) -c stringsort.c # gcc - 6.77 # ccc - 7.24 bitfield.o: bitfield.c $(CCC) $(DEFINES) $(CCCFLAGS) -c bitfield.c # gcc - 4.93, 4.90, 4.93, 4.93 # ccc - 4.79, 4.85, 4.81, fpemulation.o: fpemulation.c $(CCC) $(DEFINES) $(CCCFLAGS) -c fpemulation.c # gcc - 13.90 # ccc - 13.90 fourier.o: fourier.c $(CCC) $(DEFINES) $(CCCFLAGS) -c fourier.c # gcc - 15.96 # ccc - 19.30 assignment.o: assignment.c $(GCC) $(DEFINES) $(GCCFLAGS) -c assignment.c # gcc - 16.51 # ccc - 7.98 idea.o: idea.c $(CCC) $(DEFINES) $(CCCFLAGS) -c idea.c # gcc - 8.79 # ccc - 9.10 huffman.o: huffman.c $(GCC) $(DEFINES) $(GCCFLAGS) -c huffman.c # $(CCC) $(DEFINES) -O1 -host -unroll 0 -inline speed -c huffman.c -g3 # $(CCC) $(DEFINES) $(CCCFLAGS) -c huffman.c -g3 # gcc - 6.94 # ccc - segfault # ccc -O1 -host - 5.14 # ccc -O2 -host - segfault # ccc -O1 -host -unroll 0 -inline speed - 5.95 neural.o: neural.c $(CCC) $(DEFINES) $(CCCFLAGS) -c neural.c # gcc - 12.00 # ccc - 14.20 linear.o: linear.c $(CCC) $(DEFINES) $(CCCFLAGS) -c linear.c # gcc - 16.38 # ccc - 23.29 sysspec.o: sysspec.h sysspec.c nmglobal.h Makefile $(GCC) $(DEFINES) $(GCCFLAGS) -c sysspec.c nbench: emfloat.o randnum.o nbench0.o numsort.o sysspec.o hardware.o stringsort.o bitfield.o fpemulation.o fourier.o assignment.o idea.o huffman.o neural.o linear.o $(GCC) emfloat.o randnum.o nbench0.o numsort.o sysspec.o hardware.o stringsort.o bitfield.o fpemulation.o fourier.o assignment.o idea.o huffman.o neural.o linear.o -o nbench -lm ########################################################################## clean: - /bin/rm -f *.o nbench sysinfo.c sysinfoc.c remake: clean nbench