new zstd-noBench & zstd-frugal builds

This commit is contained in:
Yann Collet 2015-12-03 12:11:30 +01:00
parent 6a2f03295c
commit 28e7cefea9
4 changed files with 29 additions and 7 deletions

View File

@ -32,7 +32,7 @@
# ################################################################ # ################################################################
# Version number # Version number
export VERSION := 0.4.2 export VERSION := 0.4.3
PRGDIR = programs PRGDIR = programs
ZSTDDIR = lib ZSTDDIR = lib

3
NEWS
View File

@ -1,3 +1,6 @@
v0.4.3 :
new : zstd-frugal
v0.4.2 : v0.4.2 :
Generic minor improvements for small blocks Generic minor improvements for small blocks
Fixed : big-endian compatibility, by Peter Harris (#85) Fixed : big-endian compatibility, by Peter Harris (#85)

View File

@ -30,7 +30,7 @@
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode # fullbench32: Same as fullbench, but forced to compile in 32-bits mode
# ########################################################################## # ##########################################################################
VERSION?= 0.4.2 VERSION?= 0.4.3
DESTDIR?= DESTDIR?=
PREFIX ?= /usr/local PREFIX ?= /usr/local
@ -89,6 +89,13 @@ zstd-pgo : clean zstd
rm zstd rm zstd
$(MAKE) zstd MOREFLAGS=-fprofile-use $(MAKE) zstd MOREFLAGS=-fprofile-use
zstd-noBench: $(ZSTD_FILES) $(ZSTDDIR)/zstd_buffered.c \
zstdcli.c fileio.c $(ZSTD_FILEIO_LEGACY)
$(CC) $(FLAGS) -DZSTD_NOBENCH $^ -o zstd$(EXT)
zstd-frugal: clean
CFLAGS=-Os $(MAKE) zstd-noBench ZSTD_LEGACY_SUPPORT=0
fullbench : $(ZSTD_FILES) \ fullbench : $(ZSTD_FILES) \
datagen.c fullbench.c datagen.c fullbench.c
$(CC) $(FLAGS) $^ -o $@$(EXT) $(CC) $(FLAGS) $^ -o $@$(EXT)

View File

@ -138,11 +138,13 @@ static int usage_advanced(const char* programName)
DISPLAY( " -q : suppress warnings; specify twice to suppress errors too\n"); DISPLAY( " -q : suppress warnings; specify twice to suppress errors too\n");
DISPLAY( " -c : force write to standard output, even if it is the console\n"); DISPLAY( " -c : force write to standard output, even if it is the console\n");
//DISPLAY( " -t : test compressed file integrity\n"); //DISPLAY( " -t : test compressed file integrity\n");
#ifndef ZSTD_NOBENCH
DISPLAY( "Benchmark arguments :\n"); DISPLAY( "Benchmark arguments :\n");
DISPLAY( " -b# : benchmark file(s), using # compression level (default : 1) \n"); DISPLAY( " -b# : benchmark file(s), using # compression level (default : 1) \n");
DISPLAY( " -B# : cut file into independent blocks of size # (default : no block)\n"); DISPLAY( " -B# : cut file into independent blocks of size # (default : no block)\n");
DISPLAY( " -i# : iteration loops [1-9](default : 3)\n"); DISPLAY( " -i# : iteration loops [1-9](default : 3)\n");
DISPLAY( " -r# : test all compression levels from 1 to # (default : disabled)\n"); DISPLAY( " -r# : test all compression levels from 1 to # (default : disabled)\n");
#endif
return 0; return 0;
} }
@ -169,17 +171,19 @@ int main(int argCount, const char** argv)
bench=0, bench=0,
decode=0, decode=0,
forceStdout=0, forceStdout=0,
main_pause=0, main_pause=0;
rangeBench = 1;
unsigned fileNameStart = 0;
unsigned nbFiles = 0;
unsigned cLevel = 1; unsigned cLevel = 1;
const char* programName = argv[0]; const char* programName = argv[0];
const char* inFileName = NULL; const char* inFileName = NULL;
const char* outFileName = NULL; const char* outFileName = NULL;
char* dynNameSpace = NULL; char* dynNameSpace = NULL;
const char extension[] = ZSTD_EXTENSION; const char extension[] = ZSTD_EXTENSION;
unsigned fileNameStart = 0;
unsigned nbFiles = 0;
int rangeBench = 1;
/* init */
(void)rangeBench; (void)nbFiles; (void)fileNameStart; /* not used when ZSTD_NOBENCH set */
displayOut = stderr; displayOut = stderr;
/* Pick out basename component. Don't rely on stdlib because of conflicting behavior. */ /* Pick out basename component. Don't rely on stdlib because of conflicting behavior. */
for (i = (int)strlen(programName); i > 0; i--) { if (programName[i] == '/') { i++; break; } } for (i = (int)strlen(programName); i > 0; i--) { if (programName[i] == '/') { i++; break; } }
@ -260,6 +264,7 @@ int main(int argCount, const char** argv)
/* keep source file (default anyway, so useless; only for xz/lzma compatibility) */ /* keep source file (default anyway, so useless; only for xz/lzma compatibility) */
case 'k': argument++; break; case 'k': argument++; break;
#ifndef ZSTD_NOBENCH
/* Benchmark */ /* Benchmark */
case 'b': bench=1; argument++; break; case 'b': bench=1; argument++; break;
@ -293,6 +298,7 @@ int main(int argCount, const char** argv)
rangeBench = -1; rangeBench = -1;
argument++; argument++;
break; break;
#endif /* ZSTD_NOBENCH */
/* Pause at the end (hidden option) */ /* Pause at the end (hidden option) */
case 'p': main_pause=1; argument++; break; case 'p': main_pause=1; argument++; break;
@ -320,7 +326,13 @@ int main(int argCount, const char** argv)
DISPLAYLEVEL(3, WELCOME_MESSAGE); DISPLAYLEVEL(3, WELCOME_MESSAGE);
/* Check if benchmark is selected */ /* Check if benchmark is selected */
if (bench) { BMK_benchFiles(argv+fileNameStart, nbFiles, cLevel*rangeBench); goto _end; } if (bench)
{
#ifndef ZSTD_NOBENCH
BMK_benchFiles(argv+fileNameStart, nbFiles, cLevel*rangeBench);
#endif
goto _end;
}
/* No input filename ==> use stdin */ /* No input filename ==> use stdin */
if(!inFileName) { inFileName=stdinmark; } if(!inFileName) { inFileName=stdinmark; }