snappy 0.3.0-java → 0.4.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d74af9c3e3f2fef63ef2854d4981cef05dd82512f0c7d5bbfb0fe217fb10c576
4
- data.tar.gz: e7570cc0e8de765514257d78ff6f26e6bb47eef32caf5a2b2009c4bdd45da3d9
3
+ metadata.gz: 01372c70f22ef3b26296c74a90a073fd2f2ea105a1fd345fb590cb3e815b2196
4
+ data.tar.gz: c44be58bcd9fe310eeafffd03eb5dcc69551e51fec06a632aed2249d223b2807
5
5
  SHA512:
6
- metadata.gz: de6a09a41690131a13386d6a959cbf6ae4c40a51b65b4e9b53e14b25f60fc93595d6a925073a468211798bba6a3b904d8d67e18171405e1b957c4c9521c5ea97
7
- data.tar.gz: 84b004e7605154d42634600b609234cd4ed31835762b2b6826a4ed3071427179a88d636eb60625f7eec4c60e11d7d454325a526a4e37afeb6910e22e10329dfd
6
+ metadata.gz: adaa5c6d9c551fd1775030048780a0aace01eb9549a62f8feeccbaadebbc1ede7460dcb5b6297dc3832d57e56a4dfae6934546f3769adcf117fbfbd18e81e30d
7
+ data.tar.gz: 803236ccb55a26525cbd1c51b19b3672c11f9ae432e05b6958f3b495b65e549431aa61c4d33742c65819a3cb78c76581438fa5c4cd7c83da70fba21e4b74b49c
@@ -7,10 +7,10 @@ jobs:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
- ruby: [2.5, 2.6, 2.7, 3.0, 3.1, jruby]
10
+ ruby: [2.7, 3.0, 3.1, 3.2, 3.3, jruby]
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v4
14
14
  with:
15
15
  submodules: true
16
16
  - name: Set up Ruby
data/README.md CHANGED
@@ -9,7 +9,7 @@ see https://github.com/google/snappy
9
9
 
10
10
  ```bash
11
11
  $ brew install snappy
12
- $ brew install autoconf automake libtool
12
+ $ brew install autoconf automake cmake libtool
13
13
  ```
14
14
 
15
15
  ### Ubuntu
@@ -26,6 +26,22 @@ $ apk install snappy
26
26
  $ apk install build-base libexecinfo automake autoconf libtool
27
27
  ```
28
28
 
29
+ ### Windows
30
+
31
+ [Ruby Installer](https://rubyinstaller.org/) 3.0 and earlier:
32
+
33
+ ```bash
34
+ (in MSYS2 shell)
35
+ $ pacman -S mingw-w64-x86_64-snappy
36
+ ```
37
+
38
+ Ruby Installer 3.1 and later:
39
+
40
+ ```bash
41
+ (in MSYS2 shell)
42
+ pacman -S mingw-w64-ucrt-x86_64-snappy
43
+ ```
44
+
29
45
  ## Installation
30
46
 
31
47
  Add this line to your application's Gemfile:
data/ext/extconf.rb CHANGED
@@ -1,25 +1,27 @@
1
- require 'mkmf'
2
- require 'fileutils'
1
+ require "mkmf"
2
+ require "fileutils"
3
3
 
4
4
  $CXXFLAGS += " -std=c++11 "
5
5
 
6
- unless pkg_config('libsnappy') || have_library('snappy')
6
+ have_libsnappy = pkg_config("libsnappy") || have_library("snappy")
7
+ unless have_libsnappy
7
8
  # build vendor/snappy
8
9
  pwd = File.dirname File.expand_path __FILE__
9
- dir = File.join pwd, '..', 'vendor', 'snappy'
10
+ dir = File.join pwd, "..", "vendor", "snappy"
10
11
 
11
12
  Dir.chdir(dir) do
12
- FileUtils.mkdir_p 'build'
13
- Dir.chdir(File.join(dir, 'build')) do
14
- `cmake .. -DCMAKE_BUILD_TYPE=Release`
13
+ FileUtils.rm_rf "build"
14
+ FileUtils.mkdir_p "build"
15
+ Dir.chdir(File.join(dir, "build")) do
16
+ `cmake .. -DCMAKE_BUILD_TYPE=Release -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF`
15
17
  end
16
18
  end
17
19
 
18
20
  src = %w[
19
21
  config.h
20
22
  snappy-stubs-public.h
21
- ].map { |e| File.join dir, 'build', e }
22
- FileUtils.cp src, pwd, :verbose => true
23
+ ].map { |e| File.join dir, "build", e }
24
+ FileUtils.cp src, pwd, verbose: true
23
25
  src = %w[
24
26
  snappy-c.cc
25
27
  snappy-c.h
@@ -31,7 +33,7 @@ unless pkg_config('libsnappy') || have_library('snappy')
31
33
  snappy-stubs-internal.cc
32
34
  snappy-stubs-internal.h
33
35
  ].map { |e| File.join dir, e }
34
- FileUtils.cp src, pwd, :verbose => true
36
+ FileUtils.cp src, pwd, verbose: true
35
37
  end
36
38
 
37
- create_makefile 'snappy_ext'
39
+ create_makefile "snappy_ext"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snappy
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/snappy_ext.jar CHANGED
Binary file
data/snappy.gemspec CHANGED
@@ -32,5 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency "snappy-jars", "~> 1.1.0"
33
33
  else
34
34
  spec.extensions = ["ext/extconf.rb"]
35
+ spec.metadata['msys2_mingw_dependencies'] = 'snappy'
35
36
  end
36
37
  end
@@ -27,7 +27,7 @@
27
27
  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
28
 
29
29
  cmake_minimum_required(VERSION 3.1)
30
- project(Snappy VERSION 1.1.8 LANGUAGES C CXX)
30
+ project(Snappy VERSION 1.1.10 LANGUAGES C CXX)
31
31
 
32
32
  # C++ standard can be overridden when this is used as a sub-project.
33
33
  if(NOT CMAKE_CXX_STANDARD)
@@ -37,12 +37,59 @@ if(NOT CMAKE_CXX_STANDARD)
37
37
  set(CMAKE_CXX_EXTENSIONS OFF)
38
38
  endif(NOT CMAKE_CXX_STANDARD)
39
39
 
40
+ # https://github.com/izenecloud/cmake/blob/master/SetCompilerWarningAll.cmake
41
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
42
+ # Use the highest warning level for Visual Studio.
43
+ set(CMAKE_CXX_WARNING_LEVEL 4)
44
+ if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
45
+ string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
46
+ else(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
47
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
48
+ endif(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
49
+
50
+ # Disable C++ exceptions.
51
+ string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
52
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-")
53
+ add_definitions(-D_HAS_EXCEPTIONS=0)
54
+
55
+ # Disable RTTI.
56
+ string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
57
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
58
+ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
59
+ # Use -Wall for clang and gcc.
60
+ if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
61
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
62
+ endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
63
+
64
+ # Use -Wextra for clang and gcc.
65
+ if(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
66
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
67
+ endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
68
+
69
+ # Use -Werror for clang only.
70
+ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
71
+ if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
72
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
73
+ endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
74
+ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
75
+
76
+ # Disable C++ exceptions.
77
+ string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
78
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
79
+
80
+ # Disable RTTI.
81
+ string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
82
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
83
+ endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
84
+
40
85
  # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make
41
86
  # it prominent in the GUI.
42
87
  option(BUILD_SHARED_LIBS "Build shared libraries(DLLs)." OFF)
43
88
 
44
89
  option(SNAPPY_BUILD_TESTS "Build Snappy's own tests." ON)
45
90
 
91
+ option(SNAPPY_BUILD_BENCHMARKS "Build Snappy's benchmarks" ON)
92
+
46
93
  option(SNAPPY_FUZZING_BUILD "Build Snappy for fuzzing." OFF)
47
94
 
48
95
  option(SNAPPY_REQUIRE_AVX "Target processors with AVX support." OFF)
@@ -55,8 +102,6 @@ include(TestBigEndian)
55
102
  test_big_endian(SNAPPY_IS_BIG_ENDIAN)
56
103
 
57
104
  include(CheckIncludeFile)
58
- check_include_file("byteswap.h" HAVE_BYTESWAP_H)
59
- check_include_file("sys/endian.h" HAVE_SYS_ENDIAN_H)
60
105
  check_include_file("sys/mman.h" HAVE_SYS_MMAN_H)
61
106
  check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H)
62
107
  check_include_file("sys/time.h" HAVE_SYS_TIME_H)
@@ -67,6 +112,7 @@ check_include_file("windows.h" HAVE_WINDOWS_H)
67
112
  include(CheckLibraryExists)
68
113
  check_library_exists(z zlibVersion "" HAVE_LIBZ)
69
114
  check_library_exists(lzo2 lzo1x_1_15_compress "" HAVE_LIBLZO2)
115
+ check_library_exists(lz4 LZ4_compress_default "" HAVE_LIBLZ4)
70
116
 
71
117
  include(CheckCXXCompilerFlag)
72
118
  CHECK_CXX_COMPILER_FLAG("/arch:AVX" HAVE_VISUAL_STUDIO_ARCH_AVX)
@@ -92,6 +138,10 @@ elseif (SNAPPY_REQUIRE_AVX)
92
138
  endif(HAVE_CLANG_MAVX)
93
139
  endif(SNAPPY_REQUIRE_AVX2)
94
140
 
141
+ # Used by googletest.
142
+ check_cxx_compiler_flag(-Wno-missing-field-initializers
143
+ SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
144
+
95
145
  include(CheckCXXSourceCompiles)
96
146
  check_cxx_source_compiles("
97
147
  int main() {
@@ -103,6 +153,13 @@ int main() {
103
153
  return __builtin_ctzll(0);
104
154
  }" HAVE_BUILTIN_CTZ)
105
155
 
156
+ check_cxx_source_compiles("
157
+ __attribute__((always_inline)) int zero() { return 0; }
158
+
159
+ int main() {
160
+ return zero();
161
+ }" HAVE_ATTRIBUTE_ALWAYS_INLINE)
162
+
106
163
  check_cxx_source_compiles("
107
164
  #include <tmmintrin.h>
108
165
 
@@ -115,26 +172,38 @@ int main() {
115
172
  return 0;
116
173
  }" SNAPPY_HAVE_SSSE3)
117
174
 
175
+ check_cxx_source_compiles("
176
+ #include <immintrin.h>
177
+ int main() {
178
+ return _mm_crc32_u32(0, 1);
179
+ }" SNAPPY_HAVE_X86_CRC32)
180
+
181
+ check_cxx_source_compiles("
182
+ #include <arm_neon.h>
183
+ #include <arm_acle.h>
184
+ int main() {
185
+ return __crc32cw(0, 1);
186
+ }" SNAPPY_HAVE_NEON_CRC32)
187
+
118
188
  check_cxx_source_compiles("
119
189
  #include <immintrin.h>
120
190
  int main() {
121
191
  return _bzhi_u32(0, 1);
122
192
  }" SNAPPY_HAVE_BMI2)
123
193
 
194
+ check_cxx_source_compiles("
195
+ #include <arm_neon.h>
196
+ int main() {
197
+ uint8_t val = 3, dup[8];
198
+ uint8x16_t v = vld1q_dup_u8(&val);
199
+ vst1q_u8(dup, v);
200
+ return 0;
201
+ }" SNAPPY_HAVE_NEON)
202
+
124
203
  include(CheckSymbolExists)
125
204
  check_symbol_exists("mmap" "sys/mman.h" HAVE_FUNC_MMAP)
126
205
  check_symbol_exists("sysconf" "unistd.h" HAVE_FUNC_SYSCONF)
127
206
 
128
- find_package(GTest QUIET)
129
- if(GTEST_FOUND)
130
- set(HAVE_GTEST 1)
131
- endif(GTEST_FOUND)
132
-
133
- find_package(Gflags QUIET)
134
- if(GFLAGS_FOUND)
135
- set(HAVE_GFLAGS 1)
136
- endif(GFLAGS_FOUND)
137
-
138
207
  configure_file(
139
208
  "cmake/config.h.in"
140
209
  "${PROJECT_BINARY_DIR}/config.h"
@@ -202,38 +271,92 @@ if(BUILD_SHARED_LIBS)
202
271
  set_target_properties(snappy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
203
272
  endif(BUILD_SHARED_LIBS)
204
273
 
205
- if(SNAPPY_BUILD_TESTS)
206
- enable_testing()
207
-
208
- add_executable(snappy_unittest "")
209
- target_sources(snappy_unittest
274
+ if(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS)
275
+ add_library(snappy_test_support "")
276
+ target_sources(snappy_test_support
210
277
  PRIVATE
211
- "snappy_unittest.cc"
212
278
  "snappy-test.cc"
279
+ "snappy-test.h"
280
+ "snappy_test_data.cc"
281
+ "snappy_test_data.h"
282
+ "${PROJECT_BINARY_DIR}/config.h"
213
283
  )
214
- target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H)
215
- target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES})
284
+
285
+ # Test files include snappy-test.h, HAVE_CONFIG_H must be defined.
286
+ target_compile_definitions(snappy_test_support PUBLIC -DHAVE_CONFIG_H)
287
+
288
+ target_link_libraries(snappy_test_support snappy)
216
289
 
217
290
  if(HAVE_LIBZ)
218
- target_link_libraries(snappy_unittest z)
291
+ target_link_libraries(snappy_test_support z)
219
292
  endif(HAVE_LIBZ)
220
293
  if(HAVE_LIBLZO2)
221
- target_link_libraries(snappy_unittest lzo2)
294
+ target_link_libraries(snappy_test_support lzo2)
222
295
  endif(HAVE_LIBLZO2)
296
+ if(HAVE_LIBLZ4)
297
+ target_link_libraries(snappy_test_support lz4)
298
+ endif(HAVE_LIBLZ4)
223
299
 
224
- target_include_directories(snappy_unittest
225
- BEFORE PRIVATE
300
+ target_include_directories(snappy_test_support
301
+ BEFORE PUBLIC
226
302
  "${PROJECT_SOURCE_DIR}"
227
- "${GTEST_INCLUDE_DIRS}"
228
- "${GFLAGS_INCLUDE_DIRS}"
229
303
  )
304
+ endif(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS)
305
+
306
+ if(SNAPPY_BUILD_TESTS)
307
+ enable_testing()
308
+
309
+ # Prevent overriding the parent project's compiler/linker settings on Windows.
310
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
311
+ set(install_gtest OFF)
312
+ set(install_gmock OFF)
313
+ set(build_gmock ON)
314
+
315
+ # This project is tested using GoogleTest.
316
+ add_subdirectory("third_party/googletest")
317
+
318
+ # GoogleTest triggers a missing field initializers warning.
319
+ if(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
320
+ set_property(TARGET gtest
321
+ APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
322
+ set_property(TARGET gmock
323
+ APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
324
+ endif(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
325
+
326
+ add_executable(snappy_unittest "")
327
+ target_sources(snappy_unittest
328
+ PRIVATE
329
+ "snappy_unittest.cc"
330
+ )
331
+ target_link_libraries(snappy_unittest snappy_test_support gmock_main gtest)
230
332
 
231
333
  add_test(
232
334
  NAME snappy_unittest
233
335
  WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
234
336
  COMMAND "${PROJECT_BINARY_DIR}/snappy_unittest")
337
+
338
+ add_executable(snappy_test_tool "")
339
+ target_sources(snappy_test_tool
340
+ PRIVATE
341
+ "snappy_test_tool.cc"
342
+ )
343
+ target_link_libraries(snappy_test_tool snappy_test_support)
235
344
  endif(SNAPPY_BUILD_TESTS)
236
345
 
346
+ if(SNAPPY_BUILD_BENCHMARKS)
347
+ add_executable(snappy_benchmark "")
348
+ target_sources(snappy_benchmark
349
+ PRIVATE
350
+ "snappy_benchmark.cc"
351
+ )
352
+ target_link_libraries(snappy_benchmark snappy_test_support benchmark_main)
353
+
354
+ # This project uses Google benchmark for benchmarking.
355
+ set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
356
+ set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE)
357
+ add_subdirectory("third_party/benchmark")
358
+ endif(SNAPPY_BUILD_BENCHMARKS)
359
+
237
360
  if(SNAPPY_FUZZING_BUILD)
238
361
  add_executable(snappy_compress_fuzzer "")
239
362
  target_sources(snappy_compress_fuzzer
@@ -6,7 +6,7 @@ just a few small guidelines you need to follow.
6
6
  ## Contributor License Agreement
7
7
 
8
8
  Contributions to this project must be accompanied by a Contributor License
9
- Agreement. You (or your employer) retain the copyright to your contribution,
9
+ Agreement. You (or your employer) retain the copyright to your contribution;
10
10
  this simply gives us permission to use and redistribute your contributions as
11
11
  part of the project. Head over to <https://cla.developers.google.com/> to see
12
12
  your current agreements on file or to sign a new one.
@@ -15,12 +15,17 @@ You generally only need to submit a CLA once, so if you've already submitted one
15
15
  (even if it was for a different project), you probably don't need to do it
16
16
  again.
17
17
 
18
- ## Code reviews
18
+ ## Code Reviews
19
19
 
20
20
  All submissions, including submissions by project members, require review. We
21
21
  use GitHub pull requests for this purpose. Consult
22
22
  [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
23
23
  information on using pull requests.
24
24
 
25
- Please make sure that all the automated checks (CLA, AppVeyor, Travis) pass for
26
- your pull requests. Pull requests whose checks fail may be ignored.
25
+ See [the README](README.md#contributing-to-the-snappy-project) for areas
26
+ where we are likely to accept external contributions.
27
+
28
+ ## Community Guidelines
29
+
30
+ This project follows [Google's Open Source Community
31
+ Guidelines](https://opensource.google/conduct/).
data/vendor/snappy/NEWS CHANGED
@@ -1,3 +1,15 @@
1
+ Snappy v1.1.10, Mar 8th 2023:
2
+
3
+ * Performance improvements
4
+
5
+ * Compilation fixes for various environments
6
+
7
+ Snappy v1.1.9, May 4th 2021:
8
+
9
+ * Performance improvements.
10
+
11
+ * Google Test and Google Benchmark are now bundled in third_party/.
12
+
1
13
  Snappy v1.1.8, January 15th 2020:
2
14
 
3
15
  * Small performance improvements.
@@ -1,5 +1,6 @@
1
1
  Snappy, a fast compressor/decompressor.
2
2
 
3
+ [![Build Status](https://github.com/google/snappy/actions/workflows/build.yml/badge.svg)](https://github.com/google/snappy/actions/workflows/build.yml)
3
4
 
4
5
  Introduction
5
6
  ============
@@ -69,6 +70,7 @@ You need the CMake version specified in [CMakeLists.txt](./CMakeLists.txt)
69
70
  or later to build:
70
71
 
71
72
  ```bash
73
+ git submodule update --init
72
74
  mkdir build
73
75
  cd build && cmake ../ && make
74
76
  ```
@@ -107,42 +109,57 @@ information.
107
109
  Tests and benchmarks
108
110
  ====================
109
111
 
110
- When you compile Snappy, snappy_unittest is compiled in addition to the
111
- library itself. You do not need it to use the compressor from your own library,
112
- but it contains several useful components for Snappy development.
113
-
114
- First of all, it contains unit tests, verifying correctness on your machine in
115
- various scenarios. If you want to change or optimize Snappy, please run the
116
- tests to verify you have not broken anything. Note that if you have the
117
- Google Test library installed, unit test behavior (especially failures) will be
118
- significantly more user-friendly. You can find Google Test at
119
-
120
- https://github.com/google/googletest
121
-
122
- You probably also want the gflags library for handling of command-line flags;
123
- you can find it at
124
-
125
- https://gflags.github.io/gflags/
126
-
127
- In addition to the unit tests, snappy contains microbenchmarks used to
128
- tune compression and decompression performance. These are automatically run
129
- before the unit tests, but you can disable them using the flag
130
- --run_microbenchmarks=false if you have gflags installed (otherwise you will
131
- need to edit the source).
132
-
133
- Finally, snappy can benchmark Snappy against a few other compression libraries
134
- (zlib, LZO, LZF, and QuickLZ), if they were detected at configure time.
135
- To benchmark using a given file, give the compression algorithm you want to test
136
- Snappy against (e.g. --zlib) and then a list of one or more file names on the
137
- command line. The testdata/ directory contains the files used by the
138
- microbenchmark, which should provide a reasonably balanced starting point for
139
- benchmarking. (Note that baddata[1-3].snappy are not intended as benchmarks; they
140
- are used to verify correctness in the presence of corrupted data in the unit
141
- test.)
142
-
112
+ When you compile Snappy, the following binaries are compiled in addition to the
113
+ library itself. You do not need them to use the compressor from your own
114
+ library, but they are useful for Snappy development.
115
+
116
+ * `snappy_benchmark` contains microbenchmarks used to tune compression and
117
+ decompression performance.
118
+ * `snappy_unittests` contains unit tests, verifying correctness on your machine
119
+ in various scenarios.
120
+ * `snappy_test_tool` can benchmark Snappy against a few other compression
121
+ libraries (zlib, LZO, LZF, and QuickLZ), if they were detected at configure
122
+ time. To benchmark using a given file, give the compression algorithm you want
123
+ to test Snappy against (e.g. --zlib) and then a list of one or more file names
124
+ on the command line.
125
+
126
+ If you want to change or optimize Snappy, please run the tests and benchmarks to
127
+ verify you have not broken anything.
128
+
129
+ The testdata/ directory contains the files used by the microbenchmarks, which
130
+ should provide a reasonably balanced starting point for benchmarking. (Note that
131
+ baddata[1-3].snappy are not intended as benchmarks; they are used to verify
132
+ correctness in the presence of corrupted data in the unit test.)
133
+
134
+ Contributing to the Snappy Project
135
+ ==================================
136
+
137
+ In addition to the aims listed at the top of the [README](README.md) Snappy
138
+ explicitly supports the following:
139
+
140
+ 1. C++11
141
+ 2. Clang (gcc and MSVC are best-effort).
142
+ 3. Low level optimizations (e.g. assembly or equivalent intrinsics) for:
143
+ 1. [x86](https://en.wikipedia.org/wiki/X86)
144
+ 2. [x86-64](https://en.wikipedia.org/wiki/X86-64)
145
+ 3. ARMv7 (32-bit)
146
+ 4. ARMv8 (AArch64)
147
+ 4. Supports only the Snappy compression scheme as described in
148
+ [format_description.txt](format_description.txt).
149
+ 5. CMake for building
150
+
151
+ Changes adding features or dependencies outside of the core area of focus listed
152
+ above might not be accepted. If in doubt post a message to the
153
+ [Snappy discussion mailing list](https://groups.google.com/g/snappy-compression).
154
+
155
+ We are unlikely to accept contributions to the build configuration files, such
156
+ as `CMakeLists.txt`. We are focused on maintaining a build configuration that
157
+ allows us to test that the project works in a few supported configurations
158
+ inside Google. We are not currently interested in supporting other requirements,
159
+ such as different operating systems, compilers, or build systems.
143
160
 
144
161
  Contact
145
162
  =======
146
163
 
147
- Snappy is distributed through GitHub. For the latest version, a bug tracker,
148
- and other information, see https://github.com/google/snappy.
164
+ Snappy is distributed through GitHub. For the latest version and other
165
+ information, see https://github.com/google/snappy.
@@ -1,62 +1,66 @@
1
1
  #ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
2
2
  #define THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
3
3
 
4
+ /* Define to 1 if the compiler supports __attribute__((always_inline)). */
5
+ #cmakedefine01 HAVE_ATTRIBUTE_ALWAYS_INLINE
6
+
4
7
  /* Define to 1 if the compiler supports __builtin_ctz and friends. */
5
- #cmakedefine HAVE_BUILTIN_CTZ 1
8
+ #cmakedefine01 HAVE_BUILTIN_CTZ
6
9
 
7
10
  /* Define to 1 if the compiler supports __builtin_expect. */
8
- #cmakedefine HAVE_BUILTIN_EXPECT 1
9
-
10
- /* Define to 1 if you have the <byteswap.h> header file. */
11
- #cmakedefine HAVE_BYTESWAP_H 1
11
+ #cmakedefine01 HAVE_BUILTIN_EXPECT
12
12
 
13
13
  /* Define to 1 if you have a definition for mmap() in <sys/mman.h>. */
14
- #cmakedefine HAVE_FUNC_MMAP 1
14
+ #cmakedefine01 HAVE_FUNC_MMAP
15
15
 
16
16
  /* Define to 1 if you have a definition for sysconf() in <unistd.h>. */
17
- #cmakedefine HAVE_FUNC_SYSCONF 1
18
-
19
- /* Define to 1 to use the gflags package for command-line parsing. */
20
- #cmakedefine HAVE_GFLAGS 1
21
-
22
- /* Define to 1 if you have Google Test. */
23
- #cmakedefine HAVE_GTEST 1
17
+ #cmakedefine01 HAVE_FUNC_SYSCONF
24
18
 
25
19
  /* Define to 1 if you have the `lzo2' library (-llzo2). */
26
- #cmakedefine HAVE_LIBLZO2 1
20
+ #cmakedefine01 HAVE_LIBLZO2
27
21
 
28
22
  /* Define to 1 if you have the `z' library (-lz). */
29
- #cmakedefine HAVE_LIBZ 1
23
+ #cmakedefine01 HAVE_LIBZ
30
24
 
31
- /* Define to 1 if you have the <sys/endian.h> header file. */
32
- #cmakedefine HAVE_SYS_ENDIAN_H 1
25
+ /* Define to 1 if you have the `lz4' library (-llz4). */
26
+ #cmakedefine01 HAVE_LIBLZ4
33
27
 
34
28
  /* Define to 1 if you have the <sys/mman.h> header file. */
35
- #cmakedefine HAVE_SYS_MMAN_H 1
29
+ #cmakedefine01 HAVE_SYS_MMAN_H
36
30
 
37
31
  /* Define to 1 if you have the <sys/resource.h> header file. */
38
- #cmakedefine HAVE_SYS_RESOURCE_H 1
32
+ #cmakedefine01 HAVE_SYS_RESOURCE_H
39
33
 
40
34
  /* Define to 1 if you have the <sys/time.h> header file. */
41
- #cmakedefine HAVE_SYS_TIME_H 1
35
+ #cmakedefine01 HAVE_SYS_TIME_H
42
36
 
43
37
  /* Define to 1 if you have the <sys/uio.h> header file. */
44
- #cmakedefine HAVE_SYS_UIO_H 1
38
+ #cmakedefine01 HAVE_SYS_UIO_H
45
39
 
46
40
  /* Define to 1 if you have the <unistd.h> header file. */
47
- #cmakedefine HAVE_UNISTD_H 1
41
+ #cmakedefine01 HAVE_UNISTD_H
48
42
 
49
43
  /* Define to 1 if you have the <windows.h> header file. */
50
- #cmakedefine HAVE_WINDOWS_H 1
44
+ #cmakedefine01 HAVE_WINDOWS_H
51
45
 
52
46
  /* Define to 1 if you target processors with SSSE3+ and have <tmmintrin.h>. */
53
47
  #cmakedefine01 SNAPPY_HAVE_SSSE3
54
48
 
49
+ /* Define to 1 if you target processors with SSE4.2 and have <crc32intrin.h>. */
50
+ #cmakedefine01 SNAPPY_HAVE_X86_CRC32
51
+
55
52
  /* Define to 1 if you target processors with BMI2+ and have <bmi2intrin.h>. */
56
53
  #cmakedefine01 SNAPPY_HAVE_BMI2
57
54
 
55
+ /* Define to 1 if you target processors with NEON and have <arm_neon.h>. */
56
+ #cmakedefine01 SNAPPY_HAVE_NEON
57
+
58
+ /* Define to 1 if you have <arm_neon.h> and <arm_acle.h> and want to optimize
59
+ compression speed by using __crc32cw from <arm_acle.h>. */
60
+ #cmakedefine01 SNAPPY_HAVE_NEON_CRC32
61
+
58
62
  /* Define to 1 if your processor stores words with the most significant byte
59
63
  first (like Motorola and SPARC, unlike Intel and VAX). */
60
- #cmakedefine SNAPPY_IS_BIG_ENDIAN 1
64
+ #cmakedefine01 SNAPPY_IS_BIG_ENDIAN
61
65
 
62
66
  #endif // THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_