diff --git a/.gitignore b/.gitignore index 751b674e8..c939f1228 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ zstd # Test artefacts tmp* -dictionary +dictionary* # Other files .directory diff --git a/.travis.yml b/.travis.yml index ff6ab0f79..972c1b4ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ matrix: - qemu-user-static - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" CMD="make -C tests versionsTest" + env: PLATFORM="Ubuntu 12.04" CMD="make -C programs zstd-small && make -C programs zstd-decompress && make -C programs zstd-compress && make clean && make -C tests versionsTest" - os: linux sudo: required env: PLATFORM="Ubuntu 12.04" CMD="make asan32" diff --git a/build/VS2010/zstd/generate_res/zstd32.res b/build/VS2010/zstd/generate_res/zstd32.res index 362d9c22d..75705d068 100644 Binary files a/build/VS2010/zstd/generate_res/zstd32.res and b/build/VS2010/zstd/generate_res/zstd32.res differ diff --git a/build/VS2010/zstd/generate_res/zstd64.res b/build/VS2010/zstd/generate_res/zstd64.res index d726146f2..85de277c7 100644 Binary files a/build/VS2010/zstd/generate_res/zstd64.res and b/build/VS2010/zstd/generate_res/zstd64.res differ diff --git a/programs/Makefile b/programs/Makefile index 6e78d0ea9..ed26f0700 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -70,7 +70,7 @@ VOID = /dev/null endif -.PHONY: default all clean install uninstall +.PHONY: default all clean clean_decomp_o install uninstall default: zstd @@ -92,7 +92,7 @@ zstd32 : $(ZSTDDECOMP32_O) $(ZSTD_FILES) $(ZSTDLEGACY_FILES) $(ZDICT_FILES) \ $(CC) -m32 $(FLAGS) -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) $^ $(RES32_FILE) -o $@$(EXT) -zstd_nolegacy : +zstd_nolegacy : clean_decomp_o $(MAKE) zstd ZSTD_LEGACY_SUPPORT=0 zstd-pgo : MOREFLAGS = -fprofile-generate @@ -108,18 +108,19 @@ zstd-pgo : clean zstd $(MAKE) zstd MOREFLAGS=-fprofile-use zstd-frugal: $(ZSTDDECOMP_O) $(ZSTD_FILES) zstdcli.c fileio.c - $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_LEGACY_SUPPORT=0 $^ -o zstd$(EXT) + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT $^ -o zstd$(EXT) -zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) \ - zstdcli.c fileio.c - $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) +zstd-small: clean_decomp_o + ZSTD_LEGACY_SUPPORT=0 CFLAGS="-Os -s" $(MAKE) zstd-frugal -zstd-decompress: $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) \ - zstdcli.c fileio.c - $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) +zstd-decompress-clean: $(ZSTDDECOMP_O) $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) zstdcli.c fileio.c + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS $^ -o zstd-decompress$(EXT) -zstd-small: clean - CFLAGS="-Os -s" $(MAKE) zstd-frugal +zstd-decompress: clean_decomp_o + ZSTD_LEGACY_SUPPORT=0 $(MAKE) zstd-decompress-clean + +zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) zstdcli.c fileio.c + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS $^ -o $@$(EXT) clean: @@ -130,6 +131,10 @@ clean: *.gcda default.profraw @echo Cleaning completed +clean_decomp_o: + @$(RM) $(ZSTDDECOMP_O) + @$(RM) $(ZSTDDECOMP32_O) + #---------------------------------------------------------------------------------- #make install is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 6d1d9f649..fe97f965c 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -231,7 +231,8 @@ int main(int argCount, const char* argv[]) /* init */ (void)recursive; (void)cLevelLast; /* not used when ZSTD_NOBENCH set */ (void)dictCLevel; (void)dictSelect; (void)dictID; /* not used when ZSTD_NODICT set */ - (void)decode; (void)cLevel; /* not used when ZSTD_NOCOMPRESS set */ + (void)decode; (void)cLevel; (void)testmode;/* not used when ZSTD_NOCOMPRESS set */ + (void)ultra; /* not used when ZSTD_NODECOMPRESS set */ if (filenameTable==NULL) { DISPLAY("zstd: %s \n", strerror(errno)); exit(1); } filenameTable[0] = stdinmark; displayOut = stderr; @@ -490,12 +491,14 @@ int main(int argCount, const char* argv[]) CLEAN_RETURN(filenameIdx); } +#ifndef ZSTD_NOCOMPRESS /* check compression level limits */ { int const maxCLevel = ultra ? ZSTD_maxCLevel() : ZSTDCLI_CLEVEL_MAX; if (cLevel > maxCLevel) { DISPLAYLEVEL(2, "Warning : compression level higher than max, reduced to %i \n", maxCLevel); cLevel = maxCLevel; } } +#endif /* No warning message in pipe mode (stdin + stdout) or multi-files mode */ if (!strcmp(filenameTable[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (displayLevel==2)) displayLevel=1; diff --git a/zlibWrapper/.gitignore b/zlibWrapper/.gitignore index f197c8cc6..1fd8f416c 100644 --- a/zlibWrapper/.gitignore +++ b/zlibWrapper/.gitignore @@ -1,26 +1,10 @@ -# Object files -*.o -*.ko - -# Libraries -*.lib -*.a - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app - # Default result files _* -example -example_zstd +example.* +example_zstd.* +fitblk.* +fitblk_zstd.* +zwrapbench.* foo.gz # Misc files diff --git a/zlibWrapper/README.md b/zlibWrapper/README.md index 427cdbe09..5fefac1d3 100644 --- a/zlibWrapper/README.md +++ b/zlibWrapper/README.md @@ -71,7 +71,7 @@ The script used for compilation can be found at [zlibWrapper/Makefile](Makefile) The zstd distribution contains a tool called `zwrapbench` which can measure speed and ratio of zlib, zstd, and the wrapper. The benchmark is conducted using given filenames or synthetic data if filenames are not provided. -The files are read into memory and joined together. +The files are read into memory and processed independently. It makes benchmark more precise as it eliminates I/O overhead. Many filenames can be supplied as multiple parameters, parameters with wildcards or names of directories can be used as parameters with the -r option. One can select compression levels starting from `-b` and ending with `-e`. The `-i` parameter selects minimal time used for each of tested levels. @@ -119,7 +119,7 @@ In our example (the last 2 lines) it gives 4% better compression speed and 5% be #### Compatibility issues -After enabling zstd compression not all native zlib functions are supported. When calling unsupported methods they put error message into strm->msg and return Z_STREAM_ERROR. +After enabling zstd compression not all native zlib functions are supported. When calling unsupported methods they put error message into `strm->msg` and return Z_STREAM_ERROR. Supported methods: - deflateInit