extzstd 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY.ja +5 -0
  3. data/README.md +5 -5
  4. data/contrib/zstd/CONTRIBUTING.md +42 -0
  5. data/contrib/zstd/LICENSE-examples +11 -0
  6. data/contrib/zstd/Makefile +315 -0
  7. data/contrib/zstd/NEWS +261 -0
  8. data/contrib/zstd/PATENTS +33 -0
  9. data/contrib/zstd/README.md +121 -41
  10. data/contrib/zstd/TESTING.md +44 -0
  11. data/contrib/zstd/appveyor.yml +178 -0
  12. data/contrib/zstd/circle.yml +75 -0
  13. data/contrib/zstd/lib/BUCK +186 -0
  14. data/contrib/zstd/lib/Makefile +163 -0
  15. data/contrib/zstd/lib/README.md +77 -0
  16. data/contrib/zstd/{common → lib/common}/bitstream.h +7 -4
  17. data/contrib/zstd/{common → lib/common}/entropy_common.c +19 -23
  18. data/contrib/zstd/{common → lib/common}/error_private.c +0 -0
  19. data/contrib/zstd/{common → lib/common}/error_private.h +0 -0
  20. data/contrib/zstd/{common → lib/common}/fse.h +94 -34
  21. data/contrib/zstd/{common → lib/common}/fse_decompress.c +18 -19
  22. data/contrib/zstd/{common → lib/common}/huf.h +52 -20
  23. data/contrib/zstd/{common → lib/common}/mem.h +17 -13
  24. data/contrib/zstd/lib/common/pool.c +194 -0
  25. data/contrib/zstd/lib/common/pool.h +56 -0
  26. data/contrib/zstd/lib/common/threading.c +80 -0
  27. data/contrib/zstd/lib/common/threading.h +104 -0
  28. data/contrib/zstd/{common → lib/common}/xxhash.c +3 -1
  29. data/contrib/zstd/{common → lib/common}/xxhash.h +11 -15
  30. data/contrib/zstd/{common → lib/common}/zstd_common.c +1 -11
  31. data/contrib/zstd/{common → lib/common}/zstd_errors.h +16 -2
  32. data/contrib/zstd/{common → lib/common}/zstd_internal.h +17 -1
  33. data/contrib/zstd/{compress → lib/compress}/fse_compress.c +138 -91
  34. data/contrib/zstd/{compress → lib/compress}/huf_compress.c +218 -67
  35. data/contrib/zstd/{compress → lib/compress}/zstd_compress.c +231 -108
  36. data/contrib/zstd/{compress → lib/compress}/zstd_opt.h +44 -25
  37. data/contrib/zstd/lib/compress/zstdmt_compress.c +739 -0
  38. data/contrib/zstd/lib/compress/zstdmt_compress.h +78 -0
  39. data/contrib/zstd/{decompress → lib/decompress}/huf_decompress.c +28 -23
  40. data/contrib/zstd/{decompress → lib/decompress}/zstd_decompress.c +814 -176
  41. data/contrib/zstd/{common → lib/deprecated}/zbuff.h +60 -39
  42. data/contrib/zstd/lib/deprecated/zbuff_common.c +26 -0
  43. data/contrib/zstd/lib/deprecated/zbuff_compress.c +145 -0
  44. data/contrib/zstd/lib/deprecated/zbuff_decompress.c +74 -0
  45. data/contrib/zstd/lib/dictBuilder/cover.c +1029 -0
  46. data/contrib/zstd/{dictBuilder → lib/dictBuilder}/divsufsort.c +0 -0
  47. data/contrib/zstd/{dictBuilder → lib/dictBuilder}/divsufsort.h +0 -0
  48. data/contrib/zstd/{dictBuilder → lib/dictBuilder}/zdict.c +68 -18
  49. data/contrib/zstd/lib/dictBuilder/zdict.h +201 -0
  50. data/contrib/zstd/{legacy → lib/legacy}/zstd_legacy.h +122 -7
  51. data/contrib/zstd/{legacy → lib/legacy}/zstd_v01.c +34 -3
  52. data/contrib/zstd/{legacy → lib/legacy}/zstd_v01.h +8 -0
  53. data/contrib/zstd/{legacy → lib/legacy}/zstd_v02.c +45 -12
  54. data/contrib/zstd/{legacy → lib/legacy}/zstd_v02.h +8 -0
  55. data/contrib/zstd/{legacy → lib/legacy}/zstd_v03.c +45 -12
  56. data/contrib/zstd/{legacy → lib/legacy}/zstd_v03.h +8 -0
  57. data/contrib/zstd/{legacy → lib/legacy}/zstd_v04.c +56 -33
  58. data/contrib/zstd/{legacy → lib/legacy}/zstd_v04.h +8 -0
  59. data/contrib/zstd/{legacy → lib/legacy}/zstd_v05.c +45 -18
  60. data/contrib/zstd/{legacy → lib/legacy}/zstd_v05.h +7 -0
  61. data/contrib/zstd/{legacy → lib/legacy}/zstd_v06.c +43 -16
  62. data/contrib/zstd/{legacy → lib/legacy}/zstd_v06.h +7 -0
  63. data/contrib/zstd/{legacy → lib/legacy}/zstd_v07.c +57 -23
  64. data/contrib/zstd/{legacy → lib/legacy}/zstd_v07.h +8 -0
  65. data/contrib/zstd/lib/libzstd.pc.in +14 -0
  66. data/contrib/zstd/{zstd.h → lib/zstd.h} +206 -71
  67. data/ext/depend +2 -0
  68. data/ext/extconf.rb +4 -4
  69. data/ext/extzstd.c +1 -1
  70. data/ext/zstd_common.c +5 -5
  71. data/ext/zstd_compress.c +3 -3
  72. data/ext/zstd_decompress.c +2 -2
  73. data/ext/zstd_dictbuilder.c +2 -2
  74. data/ext/zstd_legacy_v01.c +1 -1
  75. data/ext/zstd_legacy_v02.c +1 -1
  76. data/ext/zstd_legacy_v03.c +1 -1
  77. data/ext/zstd_legacy_v04.c +1 -1
  78. data/ext/zstd_legacy_v05.c +1 -1
  79. data/ext/zstd_legacy_v06.c +1 -1
  80. data/ext/zstd_legacy_v07.c +1 -1
  81. data/gemstub.rb +9 -5
  82. data/lib/extzstd/version.rb +1 -1
  83. metadata +73 -51
  84. data/contrib/zstd/compress/zbuff_compress.c +0 -319
  85. data/contrib/zstd/decompress/zbuff_decompress.c +0 -252
  86. data/contrib/zstd/dictBuilder/zdict.h +0 -111
@@ -0,0 +1,33 @@
1
+ Additional Grant of Patent Rights Version 2
2
+
3
+ "Software" means the Zstandard software distributed by Facebook, Inc.
4
+
5
+ Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
6
+ ("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
7
+ (subject to the termination provision below) license under any Necessary
8
+ Claims, to make, have made, use, sell, offer to sell, import, and otherwise
9
+ transfer the Software. For avoidance of doubt, no license is granted under
10
+ Facebook’s rights in any patent claims that are infringed by (i) modifications
11
+ to the Software made by you or any third party or (ii) the Software in
12
+ combination with any software or other technology.
13
+
14
+ The license granted hereunder will terminate, automatically and without notice,
15
+ if you (or any of your subsidiaries, corporate affiliates or agents) initiate
16
+ directly or indirectly, or take a direct financial interest in, any Patent
17
+ Assertion: (i) against Facebook or any of its subsidiaries or corporate
18
+ affiliates, (ii) against any party if such Patent Assertion arises in whole or
19
+ in part from any software, technology, product or service of Facebook or any of
20
+ its subsidiaries or corporate affiliates, or (iii) against any party relating
21
+ to the Software. Notwithstanding the foregoing, if Facebook or any of its
22
+ subsidiaries or corporate affiliates files a lawsuit alleging patent
23
+ infringement against you in the first instance, and you respond by filing a
24
+ patent infringement counterclaim in that lawsuit against that party that is
25
+ unrelated to the Software, the license granted hereunder will not terminate
26
+ under section (i) of this paragraph due to such counterclaim.
27
+
28
+ A "Necessary Claim" is a claim of a patent owned by Facebook that is
29
+ necessarily infringed by the Software standing alone.
30
+
31
+ A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
32
+ or contributory infringement or inducement to infringe any patent, including a
33
+ cross-claim or counterclaim.
@@ -1,61 +1,141 @@
1
- Zstandard library files
2
- ================================
1
+ __Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm,
2
+ targeting real-time compression scenarios at zlib-level and better compression ratios.
3
3
 
4
- The __lib__ directory contains several directories.
5
- Depending on target use case, it's enough to include only files from relevant directories.
4
+ It is provided as an open-source BSD-licensed **C** library,
5
+ and a command line utility producing and decoding `.zst` and `.gz` files.
6
+ For other programming languages,
7
+ you can consult a list of known ports on [Zstandard homepage](http://www.zstd.net/#other-languages).
6
8
 
9
+ |Branch |Status |
10
+ |------------|---------|
11
+ |master | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=master)](https://travis-ci.org/facebook/zstd) |
12
+ |dev | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=dev)](https://travis-ci.org/facebook/zstd) |
7
13
 
8
- #### API
14
+ As a reference, several fast compression algorithms were tested and compared
15
+ on a server running Linux Mint Debian Edition (`Linux version 4.8.0-1-amd64`),
16
+ with a Core i7-6700K CPU @ 4.0GHz,
17
+ using [lzbench v1.6], an open-source in-memory benchmark by @inikep
18
+ compiled with GCC 6.3.0,
19
+ on the [Silesia compression corpus].
9
20
 
10
- Zstandard's stable API is exposed within [zstd.h](zstd.h),
11
- at the root of `lib` directory.
21
+ [lzbench v1.6]: https://github.com/inikep/lzbench
22
+ [Silesia compression corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
12
23
 
24
+ | Compressor name | Ratio | Compression| Decompress.|
25
+ | --------------- | ------| -----------| ---------- |
26
+ | **zstd 1.1.3 -1** | 2.877 | 430 MB/s | 1110 MB/s |
27
+ | zlib 1.2.8 -1 | 2.743 | 110 MB/s | 400 MB/s |
28
+ | brotli 0.5.2 -0 | 2.708 | 400 MB/s | 430 MB/s |
29
+ | quicklz 1.5.0 -1 | 2.238 | 550 MB/s | 710 MB/s |
30
+ | lzo1x 2.09 -1 | 2.108 | 650 MB/s | 830 MB/s |
31
+ | lz4 1.7.5 | 2.101 | 720 MB/s | 3600 MB/s |
32
+ | snappy 1.1.3 | 2.091 | 500 MB/s | 1650 MB/s |
33
+ | lzf 3.6 -1 | 2.077 | 400 MB/s | 860 MB/s |
13
34
 
14
- #### Advanced API
35
+ [zlib]:http://www.zlib.net/
36
+ [LZ4]: http://www.lz4.org/
15
37
 
16
- Some additional API may be useful if you're looking into advanced features :
17
- - common/error_public.h : transforms `size_t` function results into an `enum`,
18
- for precise error handling.
19
- - ZSTD_STATIC_LINKING_ONLY : if you define this macro _before_ including `zstd.h`,
20
- it will give access to advanced and experimental API.
21
- These APIs shall ___never be used with dynamic library___ !
22
- They are not "stable", their definition may change in the future.
23
- Only static linking is allowed.
38
+ Zstd can also offer stronger compression ratios at the cost of compression speed.
39
+ Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib] or lzma.
24
40
 
41
+ The following tests were run on a Core i7-3930K CPU @ 4.5GHz, using [lzbench], an open-source in-memory benchmark by @inikep compiled with GCC 5.2.1, on the [Silesia compression corpus].
25
42
 
26
- #### Modular build
43
+ Compression Speed vs Ratio | Decompression Speed
44
+ ---------------------------|--------------------
45
+ ![Compression Speed vs Ratio](doc/images/Cspeed4.png "Compression Speed vs Ratio") | ![Decompression Speed](doc/images/Dspeed4.png "Decompression Speed")
27
46
 
28
- Directory `common/` is required in all circumstances.
29
- You can select to support compression only, by just adding files from the `compress/` directory,
30
- In a similar way, you can build a decompressor-only library with the `decompress/` directory.
47
+ Several algorithms can produce higher compression ratios, but at slower speeds, falling outside of the graph.
48
+ For a larger picture including very slow modes, [click on this link](doc/images/DCspeed5.png) .
31
49
 
32
- Other optional functionalities provided are :
33
50
 
34
- - `dictBuilder/` : source files to create dictionaries.
35
- The API can be consulted in `dictBuilder/zdict.h`.
36
- This module also depends on `common/` and `compress/` .
51
+ ### The case for Small Data compression
37
52
 
38
- - `legacy/` : source code to decompress previous versions of zstd, starting from `v0.1`.
39
- This module also depends on `common/` and `decompress/` .
40
- Library compilation must include directive `ZSTD_LEGACY_SUPPORT = 1` .
41
- The main API can be consulted in `legacy/zstd_legacy.h`.
42
- Advanced API from each version can be found in their relevant header file.
43
- For example, advanced API for version `v0.4` is in `legacy/zstd_v04.h` .
53
+ Previous charts provide results applicable to typical file and stream scenarios (several MB). Small data comes with different perspectives.
44
54
 
55
+ The smaller the amount of data to compress, the more difficult it is to compress. This problem is common to all compression algorithms, and reason is, compression algorithms learn from past data how to compress future data. But at the beginning of a new data set, there is no "past" to build upon.
45
56
 
46
- #### Obsolete streaming API
57
+ To solve this situation, Zstd offers a __training mode__, which can be used to tune the algorithm for a selected type of data.
58
+ Training Zstandard is achieved by provide it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression.
59
+ Using this dictionary, the compression ratio achievable on small data improves dramatically.
47
60
 
48
- Streaming is now provided within `zstd.h`.
49
- Older streaming API is still provided within `common/zbuff.h`.
50
- It is considered obsolete, and will be removed in a future version.
51
- Consider migrating towards newer streaming API.
61
+ The following example uses the `github-users` [sample set](https://github.com/facebook/zstd/releases/tag/v1.1.3), created from [github public API](https://developer.github.com/v3/users/#get-all-users).
62
+ It consists of roughly 10K records weighting about 1KB each.
52
63
 
64
+ Compression Ratio | Compression Speed | Decompression Speed
65
+ ------------------|-------------------|--------------------
66
+ ![Compression Ratio](doc/images/dict-cr.png "Compression Ratio") | ![Compression Speed](doc/images/dict-cs.png "Compression Speed") | ![Decompression Speed](doc/images/dict-ds.png "Decompression Speed")
53
67
 
54
- #### Miscellaneous
55
68
 
56
- The other files are not source code. There are :
69
+ These compression gains are achieved while simultaneously providing _faster_ compression and decompression speeds.
57
70
 
58
- - LICENSE : contains the BSD license text
59
- - Makefile : script to compile or install zstd library (static and dynamic)
60
- - libzstd.pc.in : for pkg-config (`make install`)
61
- - README.md : this file
71
+ Training works if there is some correlation in a family of small data samples. The more data-specific a dictionary is, the more efficient it is (there is no _universal dictionary_).
72
+ Hence, deploying one dictionary per type of data will provide the greatest benefits.
73
+ Dictionary gains are mostly effective in the first few KB. Then, the compression algorithm will gradually use previously decoded content to better compress the rest of the file.
74
+
75
+ #### Dictionary compression How To :
76
+
77
+ 1) Create the dictionary
78
+
79
+ `zstd --train FullPathToTrainingSet/* -o dictionaryName`
80
+
81
+ 2) Compress with dictionary
82
+
83
+ `zstd -D dictionaryName FILE`
84
+
85
+ 3) Decompress with dictionary
86
+
87
+ `zstd -D dictionaryName --decompress FILE.zst`
88
+
89
+
90
+ ### Build
91
+
92
+ Once you have the repository cloned, there are multiple ways provided to build Zstandard.
93
+
94
+ #### Makefile
95
+
96
+ If your system is compatible with a standard `make` (or `gmake`) binary generator,
97
+ you can simply run it at the root directory.
98
+ It will generate `zstd` within root directory.
99
+
100
+ Other available options include :
101
+ - `make install` : create and install zstd binary, library and man page
102
+ - `make test` : create and run `zstd` and test tools on local platform
103
+
104
+ #### cmake
105
+
106
+ A `cmake` project generator is provided within `build/cmake`.
107
+ It can generate Makefiles or other build scripts
108
+ to create `zstd` binary, and `libzstd` dynamic and static libraries.
109
+
110
+ #### Meson
111
+
112
+ A Meson project is provided within `contrib/meson`.
113
+
114
+ #### Visual Studio (Windows)
115
+
116
+ Going into `build` directory, you will find additional possibilities :
117
+ - Projects for Visual Studio 2005, 2008 and 2010
118
+ + VS2010 project is compatible with VS2012, VS2013 and VS2015
119
+ - Automated build scripts for Visual compiler by @KrzysFR , in `build/VS_scripts`,
120
+ which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution.
121
+
122
+
123
+ ### Status
124
+
125
+ Zstandard is currently deployed within Facebook. It is used daily to compress and decompress very large amounts of data in multiple formats and use cases.
126
+ Zstandard is considered safe for production environments.
127
+
128
+ ### License
129
+
130
+ Zstandard is [BSD-licensed](LICENSE). We also provide an [additional patent grant](PATENTS).
131
+
132
+ ### Contributing
133
+
134
+ The "dev" branch is the one where all contributions will be merged before reaching "master".
135
+ If you plan to propose a patch, please commit into the "dev" branch or its own feature branch.
136
+ Direct commit to "master" are not permitted.
137
+ For more information, please read [CONTRIBUTING](CONTRIBUTING.md).
138
+
139
+ ### Miscellaneous
140
+
141
+ Zstd entropy stage is provided by [Huff0 and FSE, from Finite State Entropy library](https://github.com/Cyan4973/FiniteStateEntropy).
@@ -0,0 +1,44 @@
1
+ Testing
2
+ =======
3
+
4
+ Zstandard CI testing is split up into three sections:
5
+ short, medium, and long tests.
6
+
7
+ Short Tests
8
+ -----------
9
+ Short tests run on CircleCI for new commits on every branch and pull request.
10
+ They consist of the following tests:
11
+ - Compilation on all supported targets (x86, x86_64, ARM, AArch64, PowerPC, and PowerPC64)
12
+ - Compilation on various versions of gcc, clang, and g++
13
+ - `tests/playTests.sh` on x86_64, without the tests on long data (CLI tests)
14
+ - Small tests (`tests/legacy.c`, `tests/longmatch.c`, `tests/symbols.c`) on x64_64
15
+
16
+ Medium Tests
17
+ ------------
18
+ Medium tests run on every commit and pull request to `dev` branch, on TravisCI.
19
+ They consist of the following tests:
20
+ - The following tests run with UBsan and Asan on x86_64 and x86, as well as with
21
+ Msan on x86_64
22
+ - `tests/playTests.sh --test-long-data`
23
+ - Fuzzer tests: `tests/fuzzer.c`, `tests/zstreamtest.c`, and `tests/decodecorpus.c`
24
+ - `tests/zstreamtest.c` under Tsan (streaming mode, including multithreaded mode)
25
+ - Valgrind Test (`make -C tests valgrindTest`) (testing CLI and fuzzer under valgrind)
26
+ - Fuzzer tests (see above) on ARM, AArch64, PowerPC, and PowerPC64
27
+
28
+ Long Tests
29
+ ----------
30
+ Long tests run on all commits to `master` branch,
31
+ and once a day on the current version of `dev` branch,
32
+ on TravisCI.
33
+ They consist of the following tests:
34
+ - Entire test suite (including fuzzers and some other specialized tests) on:
35
+ - x86_64 and x86 with UBsan and Asan
36
+ - x86_64 with Msan
37
+ - ARM, AArch64, PowerPC, and PowerPC64
38
+ - Streaming mode fuzzer with Tsan (for the `zstdmt` testing)
39
+ - ZlibWrapper tests, including under valgrind
40
+ - Versions test (ensuring `zstd` can decode files from all previous versions)
41
+ - `pzstd` with asan and tsan, as well as in 32-bits mode
42
+ - Testing `zstd` with legacy mode off
43
+ - Testing `zbuff` (old streaming API)
44
+ - Entire test suite and make install on OS X
@@ -0,0 +1,178 @@
1
+ version: 1.0.{build}
2
+ environment:
3
+ matrix:
4
+ - COMPILER: "gcc"
5
+ PLATFORM: "mingw64"
6
+ MAKE_PARAMS: '"make test && make lib && make -C tests test-symbols fullbench-dll fullbench-lib"'
7
+ - COMPILER: "gcc"
8
+ PLATFORM: "mingw32"
9
+ MAKE_PARAMS: '"make -C tests test-zstd test-fullbench test-fuzzer test-invalidDictionaries"'
10
+ - COMPILER: "gcc"
11
+ PLATFORM: "clang"
12
+ MAKE_PARAMS: '"make -C tests zstd fullbench fuzzer paramgrill datagen CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion""'
13
+ - COMPILER: "visual"
14
+ CONFIGURATION: "Debug"
15
+ PLATFORM: "x64"
16
+ - COMPILER: "visual"
17
+ CONFIGURATION: "Debug"
18
+ PLATFORM: "Win32"
19
+ - COMPILER: "visual"
20
+ CONFIGURATION: "Release"
21
+ PLATFORM: "x64"
22
+ - COMPILER: "visual"
23
+ CONFIGURATION: "Release"
24
+ PLATFORM: "Win32"
25
+
26
+ install:
27
+ - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
28
+ - MKDIR bin
29
+ - if [%COMPILER%]==[gcc] SET PATH_ORIGINAL=%PATH%
30
+ - if [%COMPILER%]==[gcc] (
31
+ SET "PATH_MINGW32=c:\MinGW\bin;c:\MinGW\usr\bin" &&
32
+ SET "PATH_MINGW64=c:\msys64\mingw64\bin;c:\msys64\usr\bin" &&
33
+ COPY C:\msys64\usr\bin\make.exe C:\MinGW\bin\make.exe &&
34
+ COPY C:\MinGW\bin\gcc.exe C:\MinGW\bin\cc.exe
35
+ ) else (
36
+ IF [%PLATFORM%]==[x64] (SET ADDITIONALPARAM=/p:LibraryPath="C:\Program Files\Microsoft SDKs\Windows\v7.1\lib\x64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\lib\amd64;")
37
+ )
38
+
39
+ build_script:
40
+ - ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION%
41
+ - if [%PLATFORM%]==[mingw32] SET PATH=%PATH_MINGW32%;%PATH_ORIGINAL%
42
+ - if [%PLATFORM%]==[mingw64] SET PATH=%PATH_MINGW64%;%PATH_ORIGINAL%
43
+ - if [%PLATFORM%]==[clang] SET PATH=%PATH_MINGW64%;%PATH_ORIGINAL%
44
+ - if [%COMPILER%]==[gcc] (
45
+ ECHO *** &&
46
+ ECHO *** Building %PLATFORM% &&
47
+ ECHO *** &&
48
+ make -v &&
49
+ cc -v &&
50
+ ECHO %MAKE_PARAMS% &&
51
+ sh -c %MAKE_PARAMS%
52
+ )
53
+ - if [%PLATFORM%]==[clang] COPY tests\fuzzer.exe tests\fuzzer_clang.exe
54
+ - if [%COMPILER%]==[gcc] if [%PLATFORM%]==[mingw64] (
55
+ COPY programs\zstd.exe bin\zstd.exe &&
56
+ appveyor PushArtifact bin\zstd.exe
57
+ )
58
+ - if [%COMPILER%]==[gcc] if [%PLATFORM%]==[mingw32] (
59
+ COPY programs\zstd.exe bin\zstd32.exe &&
60
+ appveyor PushArtifact bin\zstd32.exe
61
+ )
62
+ - if [%COMPILER%]==[gcc] make clean
63
+ - if [%COMPILER%]==[visual] (
64
+ ECHO *** &&
65
+ ECHO *** Building Visual Studio 2008 %PLATFORM%\%CONFIGURATION% in %APPVEYOR_BUILD_FOLDER% &&
66
+ ECHO *** &&
67
+ msbuild "build\VS2008\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v90 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
68
+ DIR build\VS2008\bin\%PLATFORM%\%CONFIGURATION%\*.exe &&
69
+ MD5sum build/VS2008/bin/%PLATFORM%/%CONFIGURATION%/*.exe &&
70
+ COPY build\VS2008\bin\%PLATFORM%\%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2008_%PLATFORM%_%CONFIGURATION%.exe &&
71
+ ECHO *** &&
72
+ ECHO *** Building Visual Studio 2010 %PLATFORM%\%CONFIGURATION% &&
73
+ ECHO *** &&
74
+ msbuild "build\VS2010\zstd.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
75
+ DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
76
+ MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
77
+ msbuild "build\VS2010\zstd.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
78
+ DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
79
+ MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
80
+ COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2010_%PLATFORM%_%CONFIGURATION%.exe &&
81
+ ECHO *** &&
82
+ ECHO *** Building Visual Studio 2012 %PLATFORM%\%CONFIGURATION% &&
83
+ ECHO *** &&
84
+ msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
85
+ DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
86
+ MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
87
+ msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
88
+ DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
89
+ MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
90
+ COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2012_%PLATFORM%_%CONFIGURATION%.exe &&
91
+ ECHO *** &&
92
+ ECHO *** Building Visual Studio 2013 %PLATFORM%\%CONFIGURATION% &&
93
+ ECHO *** &&
94
+ msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
95
+ DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
96
+ MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
97
+ msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
98
+ DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
99
+ MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
100
+ COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2013_%PLATFORM%_%CONFIGURATION%.exe &&
101
+ ECHO *** &&
102
+ ECHO *** Building Visual Studio 2015 %PLATFORM%\%CONFIGURATION% &&
103
+ ECHO *** &&
104
+ msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
105
+ DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
106
+ MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
107
+ msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
108
+ DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
109
+ MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
110
+ COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2015_%PLATFORM%_%CONFIGURATION%.exe &&
111
+ COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe tests\
112
+ )
113
+
114
+ test_script:
115
+ - ECHO Testing %COMPILER% %PLATFORM% %CONFIGURATION%
116
+ - SET FUZZERTEST=-T1mn
117
+ - if [%COMPILER%]==[gcc] if [%PLATFORM%]==[clang] (
118
+ tests\fuzzer_clang.exe %FUZZERTEST% &&
119
+ ECHO *** &&
120
+ ECHO *** Building cmake for %PLATFORM% &&
121
+ ECHO *** &&
122
+ mkdir build\cmake\build &&
123
+ cd build\cmake\build &&
124
+ cmake -G "Visual Studio 14 2015 Win64" .. &&
125
+ cd ..\..\.. &&
126
+ make clean &&
127
+ ECHO *** &&
128
+ ECHO *** Building pzstd for %PLATFORM% &&
129
+ ECHO *** &&
130
+ make -C contrib\pzstd googletest-mingw64 &&
131
+ make -C contrib\pzstd pzstd.exe &&
132
+ make -C contrib\pzstd tests &&
133
+ make -C contrib\pzstd check &&
134
+ make -C contrib\pzstd clean
135
+ )
136
+ - if [%COMPILER%]==[visual] if [%CONFIGURATION%]==[Release] (
137
+ CD tests &&
138
+ SET ZSTD=./zstd.exe &&
139
+ sh -e playTests.sh --test-large-data &&
140
+ fullbench.exe -i1 &&
141
+ fullbench.exe -i1 -P0 &&
142
+ fuzzer_VS2008_%PLATFORM%_Release.exe %FUZZERTEST% &&
143
+ fuzzer_VS2010_%PLATFORM%_Release.exe %FUZZERTEST% &&
144
+ fuzzer_VS2012_%PLATFORM%_Release.exe %FUZZERTEST% &&
145
+ fuzzer_VS2013_%PLATFORM%_Release.exe %FUZZERTEST% &&
146
+ fuzzer_VS2015_%PLATFORM%_Release.exe %FUZZERTEST%
147
+ )
148
+
149
+ branches:
150
+ only:
151
+ - dev
152
+ - master
153
+
154
+ artifacts:
155
+ - path: bin\zstd.exe
156
+ - path: bin\zstd32.exe
157
+
158
+ deploy:
159
+ - provider: GitHub
160
+ auth_token:
161
+ secure: LgJo8emYc3sFnlNWkGl4/VYK3nk/8+RagcsqDlAi3xeqNGNutnKjcftjg84uJoT4
162
+ artifact: bin\zstd.exe
163
+ force_update: true
164
+ on:
165
+ branch: autobuild
166
+ COMPILER: gcc
167
+ PLATFORM: "mingw64"
168
+ appveyor_repo_tag: true
169
+ - provider: GitHub
170
+ auth_token:
171
+ secure: LgJo8emYc3sFnlNWkGl4/VYK3nk/8+RagcsqDlAi3xeqNGNutnKjcftjg84uJoT4
172
+ artifact: bin\zstd32.exe
173
+ force_update: true
174
+ on:
175
+ branch: autobuild
176
+ COMPILER: gcc
177
+ PLATFORM: "mingw32"
178
+ appveyor_repo_tag: true
@@ -0,0 +1,75 @@
1
+ dependencies:
2
+ override:
3
+ - sudo dpkg --add-architecture i386
4
+ - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; sudo apt-get -y -qq update
5
+ - sudo apt-get -y install gcc-powerpc-linux-gnu gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
6
+ - sudo apt-get -y install libstdc++-6-dev clang gcc g++ gcc-5 gcc-6
7
+ - sudo apt-get -y install linux-libc-dev:i386 libc6-dev-i386
8
+
9
+ test:
10
+ override:
11
+ - ? |
12
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; make all && make clean; fi &&
13
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gnu90build && make clean; fi
14
+ :
15
+ parallel: true
16
+ - ? |
17
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make c99build && make clean; fi &&
18
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gnu99build && make clean; fi
19
+ :
20
+ parallel: true
21
+ - ? |
22
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make c11build && make clean; fi &&
23
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make cmakebuild && make clean; fi
24
+ :
25
+ parallel: true
26
+ - ? |
27
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make gppbuild && make clean; fi &&
28
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc5build && make clean; fi
29
+ :
30
+ parallel: true
31
+ - ? |
32
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make gcc6build && make clean; fi &&
33
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make clangbuild && make clean; fi
34
+ :
35
+ parallel: true
36
+ - ? |
37
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make m32build && make clean; fi &&
38
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make armbuild && make clean; fi
39
+ :
40
+ parallel: true
41
+ - ? |
42
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make aarch64build && make clean; fi &&
43
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make ppcbuild && make clean; fi
44
+ :
45
+ parallel: true
46
+ - ? |
47
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make ppc64build && make clean; fi &&
48
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then true && make clean; fi #could add another test here
49
+ :
50
+ parallel: true
51
+ - ? |
52
+ if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make shortest && make clean; fi &&
53
+ if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make -C tests test-legacy test-longmatch test-symbols && make clean; fi
54
+ :
55
+ parallel: true
56
+
57
+ post:
58
+ - echo Circle CI tests finished
59
+
60
+ # Longer tests
61
+ #- make -C tests test-zstd-nolegacy && make clean
62
+ #- pyenv global 3.4.4; make -C tests versionsTest && make clean
63
+ #- make zlibwrapper && make clean
64
+ #- gcc -v; make -C tests test32 MOREFLAGS="-I/usr/include/x86_64-linux-gnu" && make clean
65
+ #- make uasan && make clean
66
+ #- make asan32 && make clean
67
+ #- make -C tests test32 CC=clang MOREFLAGS="-g -fsanitize=address -I/usr/include/x86_64-linux-gnu"
68
+ # Valgrind tests
69
+ #- CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make clean
70
+ #- make -C tests valgrindTest && make clean
71
+ # ARM, AArch64, PowerPC, PowerPC64 tests
72
+ #- make ppctest && make clean
73
+ #- make ppc64test && make clean
74
+ #- make armtest && make clean
75
+ #- make aarch64test && make clean