[Compbench-devel] CompBenchmarks++/Benchmark Benchmark-BZIP2.cpp, NONE, 1.1 Benchmark-BZIP2.h, NONE
Brought to you by:
xfred
|
From: Frederic T. <xf...@us...> - 2006-10-01 19:36:17
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5318 Modified Files: Benchmark-Selector.cpp Makefile.am Makefile.in Added Files: Benchmark-BZIP2.cpp Benchmark-BZIP2.h Log Message: bzip2 package added. Index: Makefile.in =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Makefile.in,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.in 1 Oct 2006 19:19:19 -0000 1.6 --- Makefile.in 1 Oct 2006 19:36:11 -0000 1.7 *************** *** 108,112 **** SUBDIRS = Compiler ! sources = Benchmark.cpp Benchmark-Selector.cpp Benchmark-Autotools.cpp Benchmark-xZIP.cpp Benchmark-GZIP.cpp Benchmark-NBENCH.cpp Benchmark-SCIMARK2.cpp Benchmark-BENCHPP.cpp Benchmark-LINPACKC.cpp --- 108,112 ---- SUBDIRS = Compiler ! sources = Benchmark.cpp Benchmark-Selector.cpp Benchmark-Autotools.cpp Benchmark-xZIP.cpp Benchmark-GZIP.cpp Benchmark-BZIP2.cpp Benchmark-NBENCH.cpp Benchmark-SCIMARK2.cpp Benchmark-BENCHPP.cpp Benchmark-LINPACKC.cpp *************** *** 132,137 **** libBenchmark_la_OBJECTS = Benchmark.lo Benchmark-Selector.lo \ Benchmark-Autotools.lo Benchmark-xZIP.lo Benchmark-GZIP.lo \ ! Benchmark-NBENCH.lo Benchmark-SCIMARK2.lo Benchmark-BENCHPP.lo \ ! Benchmark-LINPACKC.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) --- 132,137 ---- libBenchmark_la_OBJECTS = Benchmark.lo Benchmark-Selector.lo \ Benchmark-Autotools.lo Benchmark-xZIP.lo Benchmark-GZIP.lo \ ! Benchmark-BZIP2.lo Benchmark-NBENCH.lo Benchmark-SCIMARK2.lo \ ! Benchmark-BENCHPP.lo Benchmark-LINPACKC.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) *************** *** 149,155 **** GZIP_ENV = --best DEP_FILES = .deps/Benchmark-Autotools.P .deps/Benchmark-BENCHPP.P \ ! .deps/Benchmark-GZIP.P .deps/Benchmark-LINPACKC.P \ ! .deps/Benchmark-NBENCH.P .deps/Benchmark-SCIMARK2.P \ ! .deps/Benchmark-Selector.P .deps/Benchmark-xZIP.P .deps/Benchmark.P SOURCES = $(libBenchmark_la_SOURCES) OBJECTS = $(libBenchmark_la_OBJECTS) --- 149,156 ---- GZIP_ENV = --best DEP_FILES = .deps/Benchmark-Autotools.P .deps/Benchmark-BENCHPP.P \ ! .deps/Benchmark-BZIP2.P .deps/Benchmark-GZIP.P \ ! .deps/Benchmark-LINPACKC.P .deps/Benchmark-NBENCH.P \ ! .deps/Benchmark-SCIMARK2.P .deps/Benchmark-Selector.P \ ! .deps/Benchmark-xZIP.P .deps/Benchmark.P SOURCES = $(libBenchmark_la_SOURCES) OBJECTS = $(libBenchmark_la_OBJECTS) Index: Benchmark-Selector.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark-Selector.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Benchmark-Selector.cpp 1 Oct 2006 19:19:19 -0000 1.3 --- Benchmark-Selector.cpp 1 Oct 2006 19:36:11 -0000 1.4 *************** *** 3,6 **** --- 3,7 ---- #include <Benchmark/Benchmark-GZIP.h> + #include <Benchmark/Benchmark-BZIP2.h> #include <Benchmark/Benchmark-NBENCH.h> #include <Benchmark/Benchmark-SCIMARK2.h> *************** *** 25,28 **** --- 26,37 ---- } + if (tmp=="bzip2-1c") { + return(new CBMBenchmarkBZIP21(system)); + } + + if (tmp=="bzip2-9c") { + return(new CBMBenchmarkBZIP29(system)); + } + if (tmp=="nbench-numsort") { return(new CBMBenchmarkNBENCH_NUMSORT(system)); *************** *** 126,129 **** --- 135,141 ---- CBMBenchmarkGZIP9 gzip9(system); + CBMBenchmarkBZIP21 bzip21(system); + CBMBenchmarkBZIP29 bzip29(system); + CBMBenchmarkNBENCH_NUMSORT nbench_numsort(system); CBMBenchmarkNBENCH_STRINGSORT nbench_stringsort(system); *************** *** 154,157 **** --- 166,172 ---- gzip9.display(); + bzip21.display(); + bzip29.display(); + nbench_numsort.display(); nbench_stringsort.display(); Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 1 Oct 2006 19:19:19 -0000 1.5 --- Makefile.am 1 Oct 2006 19:36:11 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- Benchmark-xZIP.cpp \ Benchmark-GZIP.cpp \ + Benchmark-BZIP2.cpp \ Benchmark-NBENCH.cpp \ Benchmark-SCIMARK2.cpp \ --- NEW FILE: Benchmark-BZIP2.h --- #ifndef H_CBMBENCHMARKBZIP2 #define H_CBMBENCHMARKBZIP2 #include <Benchmark/Benchmark-xZIP.h> class CBMBenchmarkBZIP2 : public CBMBenchmarkxZIP { private: virtual std::string downloadURL(void); virtual std::string expectedMD5(void); virtual std::string packageName(void); virtual std::string packageVersion(void); virtual int packageSize(void); /* in bytes */ virtual std::string packageComments(void); virtual std::string localPackageName(void); virtual char* extractDirectory(void); virtual std::string language(void); /** Configure package. Don't do anything. \return Always 1 (ok). */ virtual int configure(CBMBenchmarkContextCompiler *_currentCompiler, CBMBenchmarkContextCompilerOptions *_currentOptions); virtual int make(void); protected: public: CBMBenchmarkBZIP2(class CBMSystem *_system); virtual std::string benchmarkProgram(void); virtual std::string license(void); virtual std::string homePage(void); virtual std::string author(void); virtual int benchmarkSize(void); virtual ~CBMBenchmarkBZIP2(); }; class CBMBenchmarkBZIP21 : public CBMBenchmarkBZIP2 { protected: virtual char* compressionLevel(void); virtual std::string benchmarkComments(void); public: CBMBenchmarkBZIP21(class CBMSystem *_system); virtual std::string benchmarkName(void); virtual ~CBMBenchmarkBZIP21(); }; class CBMBenchmarkBZIP29 : public CBMBenchmarkBZIP2 { protected: virtual char* compressionLevel(void); virtual std::string benchmarkComments(void); public: CBMBenchmarkBZIP29(class CBMSystem *_system); virtual std::string benchmarkName(void); virtual ~CBMBenchmarkBZIP29(); }; #endif --- NEW FILE: Benchmark-BZIP2.cpp --- #include <Benchmark/Benchmark-BZIP2.h> #include <System/System.h> #include <config.h> #include <fstream> CBMBenchmarkBZIP2::CBMBenchmarkBZIP2(CBMSystem *_system) : CBMBenchmarkxZIP(_system) { } std::string CBMBenchmarkBZIP2::downloadURL(void) { return("http://www.bzip.org/1.0.3/bzip2-1.0.3.tar.gz"); } std::string CBMBenchmarkBZIP2::expectedMD5(void) { return("8a716bebecb6e647d2e8a29ea5d8447f"); } std::string CBMBenchmarkBZIP2::packageName(void) { return("bzip2"); } std::string CBMBenchmarkBZIP2::packageVersion(void) { return("1.0.3"); } int CBMBenchmarkBZIP2::packageSize(void) { return(669075); } std::string CBMBenchmarkBZIP2::packageComments(void) { return("Official bzip2-1.0.3 source package."); } std::string CBMBenchmarkBZIP2::localPackageName(void) { return("bzip2-1.0.3.tar.Z"); } std::string CBMBenchmarkBZIP2::language(void) { return("C"); } int CBMBenchmarkBZIP2::configure(CBMBenchmarkContextCompiler *_currentCompiler, CBMBenchmarkContextCompilerOptions *_currentOptions) { return(1); } int CBMBenchmarkBZIP2::make(void) { std::string cmd; std::string sstdout; cmd="cd "; cmd+=localPackageAbsoluteDirectory(); cmd+=" && "; cmd+=CBM_PROG_MAKE; cmd+=" "; if (language()=="C") { cmd+="CC="; } else { if (language()=="C++") { cmd+="CXX="; } else { /* !!! */ } } cmd+=currentCompiler->Binary(); if (language()=="C") { cmd+=" CFLAGS="; } else { if (language()=="C++") { cmd+="CXXFLAGS="; } else { /* !!! */ } } cmd+="'"; cmd+=currentOptions->Options(); cmd+="'"; return(system->exec(cmd, sstdout)==0); } char* CBMBenchmarkBZIP2::extractDirectory(void) { return("bzip2-1.0.3"); } std::string CBMBenchmarkBZIP2::benchmarkProgram(void) { return("bzip2"); } std::string CBMBenchmarkBZIP2::license(void) { return("BSD-style"); } std::string CBMBenchmarkBZIP2::homePage(void) { return("http://www.bzip.org"); } std::string CBMBenchmarkBZIP2::author(void) { return("Written by Julian Seward"); } int CBMBenchmarkBZIP2::benchmarkSize(void) { return(76546048); } CBMBenchmarkBZIP2::~CBMBenchmarkBZIP2() { } CBMBenchmarkBZIP21::CBMBenchmarkBZIP21(CBMSystem *_system) : CBMBenchmarkBZIP2(_system) { } std::string CBMBenchmarkBZIP21::benchmarkName(void) { return("bzip2-1c"); } char* CBMBenchmarkBZIP21::compressionLevel(void) { return("1"); } std::string CBMBenchmarkBZIP21::benchmarkComments(void) { return("Uses generated bzip2 binary with fastest compression"); } CBMBenchmarkBZIP21::~CBMBenchmarkBZIP21() { } CBMBenchmarkBZIP29::CBMBenchmarkBZIP29(CBMSystem *_system) : CBMBenchmarkBZIP2(_system) { } std::string CBMBenchmarkBZIP29::benchmarkName(void) { return("bzip2-9c"); } char* CBMBenchmarkBZIP29::compressionLevel(void) { return("9"); } std::string CBMBenchmarkBZIP29::benchmarkComments(void) { return("Uses generated bzip2 binary with maximum compression"); } CBMBenchmarkBZIP29::~CBMBenchmarkBZIP29() { } |