Lines Matching +full:fullbench +full:- +full:dll
2 # LZ4 programs - Makefile
3 # Copyright (C) Yann Collet 2011-present
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 # - LZ4 homepage : http://www.lz4.org
23 # - LZ4 source repository : https://github.com/lz4/lz4
27 # fullbench : Precisely measure speed for each LZ4 function variant
37 DEBUGFLAGS = -g -DLZ4_DEBUG=$(DEBUGLEVEL)
38 CFLAGS ?= -O3 # can select custom optimization flags. For example : CFLAGS=-O2 make
39 CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow \
40 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes \
41 -Wpointer-arith -Wstrict-aliasing=1
43 CPPFLAGS+= -I$(LZ4DIR) -I$(PRGDIR) -DXXH_NAMESPACE=LZ4_
60 FUZZER_TIME := -T90s
61 NB_LOOPS ?= -i1
66 all: fullbench fuzzer frametest roundTripTest datagen
68 all32: CFLAGS+=-m32
72 $(MAKE) -C $(PRGDIR) $@ CFLAGS="$(CFLAGS)"
75 $(MAKE) -C $(LZ4DIR) $@ CFLAGS="$(CFLAGS)"
78 ln -sf $(LZ4) $(PRGDIR)/$@
80 lz4c32: # create a 32-bits version for 32/64 interop tests
81 $(MAKE) -C $(PRGDIR) $@ CFLAGS="-m32 $(CFLAGS)"
84 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
86 fullbench : DEBUGLEVEL=0 target
87 fullbench : lz4.o lz4hc.o lz4frame.o xxhash.o fullbench.c target
88 $(CC) $(FLAGS) $^ -o $@$(EXT)
91 $(MAKE) -C $(LZ4DIR) liblz4.a
93 fullbench-lib: fullbench.c $(LZ4DIR)/liblz4.a
94 $(CC) $(FLAGS) $^ -o $@$(EXT)
96 fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c target
97 $(MAKE) -C $(LZ4DIR) liblz4
98 $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/dll/liblz4.dll
101 $(CC) $(FLAGS) $^ -o $@$(EXT)
104 $(CC) $(FLAGS) $^ -o $@$(EXT)
107 $(CC) $(FLAGS) $^ -o $@$(EXT)
110 $(CC) $(FLAGS) -I$(PRGDIR) $^ -o $@$(EXT)
113 @$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
114 @$(MAKE) -C $(PRGDIR) $@ > $(VOID)
116 fullbench-dll$(EXT) fullbench-lib$(EXT) \
117 fullbench$(EXT) fullbench32$(EXT) \
122 @rm -fR $(TESTDIR)
127 $(PYTHON) test-lz4-versions.py
130 $(CC) $(FLAGS) $< -o $@$(EXT)
133 #-----------------------------------------------------------------------------
135 #-----------------------------------------------------------------------------
140 MD5:=md5 -r
151 test: test-lz4 test-lz4c test-frametest test-fullbench test-fuzzer test-install
153 test32: CFLAGS+=-m32
156 test-install: lz4 lib liblz4.pc
159 test-lz4-sparse: lz4 datagen
160 @echo "\n ---- test sparse file support ----"
161 ./datagen -g5M -P100 > tmplsdg5M
162 $(LZ4) -B4D tmplsdg5M | $(LZ4) -dv --sparse > tmplscB4
163 $(DIFF) -s tmplsdg5M tmplscB4
164 $(LZ4) -B5D tmplsdg5M | $(LZ4) -dv --sparse > tmplscB5
165 $(DIFF) -s tmplsdg5M tmplscB5
166 $(LZ4) -B6D tmplsdg5M | $(LZ4) -dv --sparse > tmplscB6
167 $(DIFF) -s tmplsdg5M tmplscB6
168 $(LZ4) -B7D tmplsdg5M | $(LZ4) -dv --sparse > tmplscB7
169 $(DIFF) -s tmplsdg5M tmplscB7
170 $(LZ4) tmplsdg5M | $(LZ4) -dv --no-sparse > tmplsnosparse
171 $(DIFF) -s tmplsdg5M tmplsnosparse
172 ls -ls tmpls*
173 …./datagen -s1 -g1200007 -P100 | $(LZ4) | $(LZ4) -dv --sparse > tmplsodd # Odd size file (to gene…
174 ./datagen -s1 -g1200007 -P100 | $(DIFF) -s - tmplsodd
175 ls -ls tmplsodd
178 echo "Hello World 1 !" | $(LZ4) | $(LZ4) -d -c
179 echo "Hello World 2 !" | $(LZ4) | $(LZ4) -d | cat
180 echo "Hello World 3 !" | $(LZ4) --no-frame-crc | $(LZ4) -d -c
182 ./datagen -P100 -g1M > tmplsdg1M
184 $(LZ4) -B5 -v tmplsdg1M tmplsc
185 $(LZ4) -d -v tmplsc tmplsr
186 $(LZ4) -d -v tmplsc >> tmplsr
187 ls -ls tmp*
191 test-lz4-contentSize: lz4 datagen
192 @echo "\n ---- test original size support ----"
193 ./datagen -g15M > tmplc1
194 $(LZ4) -v tmplc1 | $(LZ4) -t
195 $(LZ4) -v --content-size tmplc1 | $(LZ4) -d > tmplc2
196 $(DIFF) -s tmplc1 tmplc2
199 test-lz4-frame-concatenation: lz4 datagen
200 @echo "\n ---- test frame concatenation ----"
201 @echo -n > tmp-lfc-empty
202 @echo hi > tmp-lfc-nonempty
203 cat tmp-lfc-nonempty tmp-lfc-empty tmp-lfc-nonempty > tmp-lfc-src
204 @$(LZ4) -zq tmp-lfc-empty > tmp-lfc-empty.lz4
205 @$(LZ4) -zq tmp-lfc-nonempty > tmp-lfc-nonempty.lz4
206 cat tmp-lfc-nonempty.lz4 tmp-lfc-empty.lz4 tmp-lfc-nonempty.lz4 > tmp-lfc-concat.lz4
207 $(LZ4) -d tmp-lfc-concat.lz4 > tmp-lfc-result
208 sdiff tmp-lfc-src tmp-lfc-result
209 @$(RM) tmp-lfc-*
212 test-lz4-multiple: lz4 datagen
213 @echo "\n ---- test multiple files ----"
214 @./datagen -s1 > tmp-tlm1 2> $(VOID)
215 @./datagen -s2 -g100K > tmp-tlm2 2> $(VOID)
216 @./datagen -s3 -g1M > tmp-tlm3 2> $(VOID)
217 $(LZ4) -f -m tmp-tlm*
218 ls -ls tmp-tlm*
219 @$(RM) tmp-tlm1 tmp-tlm2 tmp-tlm3
220 $(LZ4) -df -m tmp-tlm*.lz4
221 ls -ls tmp-tlm*
222 $(LZ4) -f -m tmp-tlm1 notHere tmp-tlm2; echo $$?
223 @$(RM) tmp-tlm*
225 test-lz4-basic: lz4 datagen unlz4 lz4cat
226 @echo "\n ---- test lz4 basic compression/decompression ----"
227 ./datagen -g0 | $(LZ4) -v | $(LZ4) -t
228 ./datagen -g16KB | $(LZ4) -9 | $(LZ4) -t
229 ./datagen -g20KB > tmp-tlb-dg20k
230 $(LZ4) < tmp-tlb-dg20k | $(LZ4) -d > tmp-tlb-dec
231 $(DIFF) -q tmp-tlb-dg20k tmp-tlb-dec
232 $(LZ4) --no-frame-crc < tmp-tlb-dg20k | $(LZ4) -d > tmp-tlb-dec
233 $(DIFF) -q tmp-tlb-dg20k tmp-tlb-dec
234 ./datagen | $(LZ4) | $(LZ4) -t
235 ./datagen -g6M -P99 | $(LZ4) -9BD | $(LZ4) -t
236 ./datagen -g17M | $(LZ4) -9v | $(LZ4) -qt
237 ./datagen -g33M | $(LZ4) --no-frame-crc | $(LZ4) -t
238 ./datagen -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
239 @echo "hello world" > tmp-tlb-hw
240 $(LZ4) --rm -f tmp-tlb-hw tmp-tlb-hw.lz4
241 test ! -f tmp-tlb-hw # must fail (--rm)
242 test -f tmp-tlb-hw.lz4
243 $(PRGDIR)/lz4cat tmp-tlb-hw.lz4 # must display hello world
244 test -f tmp-tlb-hw.lz4
245 $(PRGDIR)/unlz4 --rm tmp-tlb-hw.lz4 tmp-tlb-hw
246 test -f tmp-tlb-hw
247 test ! -f tmp-tlb-hw.lz4 # must fail (--rm)
248 test ! -f tmp-tlb-hw.lz4.lz4 # must fail (unlz4)
249 $(PRGDIR)/lz4cat tmp-tlb-hw # pass-through mode
250 test -f tmp-tlb-hw
251 test ! -f tmp-tlb-hw.lz4 # must fail (lz4cat)
252 $(LZ4) tmp-tlb-hw tmp-tlb-hw.lz4 # creates tmp-tlb-hw.lz4
253 $(PRGDIR)/lz4cat < tmp-tlb-hw.lz4 > tmp-tlb3 # checks lz4cat works with stdin (#285)
254 $(DIFF) -q tmp-tlb-hw tmp-tlb3
255 $(PRGDIR)/lz4cat < tmp-tlb-hw > tmp-tlb2 # checks lz4cat works in pass-through mode
256 $(DIFF) -q tmp-tlb-hw tmp-tlb2
257 cp tmp-tlb-hw ./-d
258 $(LZ4) --rm -- -d -d.lz4 # compresses ./d into ./-d.lz4
259 test -f ./-d.lz4
260 test ! -f ./-d
261 mv ./-d.lz4 ./-z
262 $(LZ4) -d --rm -- -z tmp-tlb4 # uncompresses ./-z into tmp-tlb4
263 test ! -f ./-z
264 $(DIFF) -q tmp-tlb-hw tmp-tlb4
265 $(LZ4) -f tmp-tlb-hw
266 cat tmp-tlb-hw >> tmp-tlb-hw.lz4
267 $(LZ4) -f tmp-tlb-hw.lz4 # uncompress valid frame followed by invalid data
268 $(LZ4) -BX tmp-tlb-hw -c -q | $(LZ4) -tv # test block checksum
269 # ./datagen -g20KB generates the same file every single time
270 …annot save output of ./datagen -g20KB as input file to lz4 because the following shell commands ar…
271 …est "$(shell ./datagen -g20KB | $(LZ4) -c --fast | wc -c)" -lt "$(shell ./datagen -g20KB | $(LZ4) …
272 …test "$(shell ./datagen -g20KB | $(LZ4) -c -1 | wc -c)" -lt "$(shell ./datagen -g20KB| $(LZ4) -c -…
273 …./datagen -g20KB | $(LZ4) -c --fast=1 | wc -c)" -eq "$(shell ./datagen -g20KB| $(LZ4) -c --fast| w…
274 ! $(LZ4) -c --fast=0 tmp-tlb-dg20K # lz4 should fail when fast=0
275 ! $(LZ4) -c --fast=-1 tmp-tlb-dg20K # lz4 should fail when fast=-1
276 @$(RM) tmp-tlb*
280 test-lz4-dict: lz4 datagen
281 @echo "\n ---- test lz4 compression/decompression with dictionary ----"
282 ./datagen -g16KB > tmp-dict
283 ./datagen -g32KB > tmp-dict-sample-32k
284 < tmp-dict-sample-32k $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-32k
285 ./datagen -g128MB > tmp-dict-sample-128m
286 < tmp-dict-sample-128m $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-128m
287 touch tmp-dict-sample-0
288 < tmp-dict-sample-0 $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-0
290 …< tmp-dict-sample-32k $(LZ4) -D tmp-dict-sample-0 | $(LZ4) -dD tmp-dict-sample-0 | diff - tmp-dict…
291 …< tmp-dict-sample-0 $(LZ4) -D tmp-dict-sample-0 | $(LZ4) -dD tmp-dict-sample-0 | diff - tmp-dict-s…
293 @echo "\n ---- test lz4 dictionary loading ----"
294 ./datagen -g128KB > tmp-dict-data-128KB
295 set -e; \
297 ./datagen -g$$l > tmp-dict-$$l; \
298 …$(DD) if=tmp-dict-$$l of=tmp-dict-$$l-tail bs=1 count=65536 skip=$$((l > 65536 ? l - 65536 : 0)); \
299 …< tmp-dict-$$l $(LZ4) -D stdin tmp-dict-data-128KB | $(LZ4) -dD tmp-dict-$$l-tail | $(DIFF) -…
300 …< tmp-dict-$$l-tail $(LZ4) -D stdin tmp-dict-data-128KB | $(LZ4) -dD tmp-dict-$$l | $(DIFF) -…
303 @$(RM) tmp-dict*
305 test-lz4-hugefile: lz4 datagen
306 @echo "\n ---- test huge files compression/decompression ----"
307 ./datagen -g6GB | $(LZ4) -vB5D | $(LZ4) -qt
308 ./datagen -g6GB | $(LZ4) -v5BD | $(LZ4) -qt
309 # test large file size [2-4] GB
310 @./datagen -g3G -P100 | $(LZ4) -vv | $(LZ4) --decompress --force --sparse - tmphf1
311 @ls -ls tmphf1
312 …@./datagen -g3G -P100 | $(LZ4) --quiet --content-size | $(LZ4) --verbose --decompress --force --sp…
313 @ls -ls tmphf2
314 $(DIFF) -s tmphf1 tmphf2
317 test-lz4-testmode: lz4 datagen
318 @echo "\n ---- bench mode ----"
319 $(LZ4) -bi1
320 @echo "\n ---- test mode ----"
321 ! ./datagen | $(LZ4) -t
322 ! ./datagen | $(LZ4) -tf
323 @echo "\n ---- pass-through mode ----"
324 ! ./datagen | $(LZ4) -d > $(VOID)
325 ./datagen | $(LZ4) -df > $(VOID)
326 @echo "Hello World !" > tmp-tlt1
327 $(LZ4) -dcf tmp-tlt1
328 @echo "from underground..." > tmp-tlt2
329 $(LZ4) -dcfm tmp-tlt1 tmp-tlt2
330 @echo "\n ---- non-existing source ----"
331 ! $(LZ4) file-does-not-exist
332 ! $(LZ4) -f file-does-not-exist
333 ! $(LZ4) -fm file1-dne file2-dne
334 @$(RM) tmp-tlt
336 test-lz4-opt-parser: lz4 datagen
337 @echo "\n ---- test opt-parser ----"
338 ./datagen -g16KB | $(LZ4) -12 | $(LZ4) -t
339 ./datagen -P10 | $(LZ4) -12B4 | $(LZ4) -t
340 ./datagen -g256K | $(LZ4) -12B4D | $(LZ4) -t
341 ./datagen -g512K -P25 | $(LZ4) -12BD | $(LZ4) -t
342 ./datagen -g1M | $(LZ4) -12B5 | $(LZ4) -t
343 ./datagen -g2M -P99 | $(LZ4) -11B4D | $(LZ4) -t
344 ./datagen -g4M | $(LZ4) -11vq | $(LZ4) -qt
345 ./datagen -g8M | $(LZ4) -11B4 | $(LZ4) -t
346 ./datagen -g16M -P90 | $(LZ4) -11B5 | $(LZ4) -t
347 ./datagen -g32M -P10 | $(LZ4) -11B5D | $(LZ4) -t
349 test-lz4-essentials : lz4 datagen test-lz4-basic test-lz4-multiple \
350 test-lz4-frame-concatenation test-lz4-testmode \
351 test-lz4-contentSize test-lz4-dict
354 test-lz4: lz4 datagen test-lz4-essentials test-lz4-opt-parser \
355 test-lz4-sparse test-lz4-hugefile test-lz4-dict
358 test-lz4c: lz4c datagen
359 @echo "\n ---- test lz4c variant ----"
360 ./datagen -g256MB | $(LZ4)c -l -v | $(LZ4)c -t
362 test-lz4c32: CFLAGS+=-m32
363 test-lz4c32: test-lz4
365 test-interop-32-64: lz4 lz4c32 datagen
366 @echo "\n ---- test interoperability 32-bits -vs- 64 bits ----"
367 ./datagen -g16KB | $(LZ4)c32 -9 | $(LZ4) -t
368 ./datagen -P10 | $(LZ4) -9B4 | $(LZ4)c32 -t
369 ./datagen | $(LZ4)c32 | $(LZ4) -t
370 ./datagen -g1M | $(LZ4) -3B5 | $(LZ4)c32 -t
371 ./datagen -g256MB | $(LZ4)c32 -vqB4D | $(LZ4) -qt
372 ./datagen -g1G -P90 | $(LZ4) | $(LZ4)c32 -t
373 ./datagen -g6GB | $(LZ4)c32 -vq9BD | $(LZ4) -qt
375 test-lz4c32-basic: lz4c32 datagen
376 @echo "\n ---- test lz4c32 32-bits version ----"
377 ./datagen -g16KB | $(LZ4)c32 -9 | $(LZ4)c32 -t
378 ./datagen | $(LZ4)c32 | $(LZ4)c32 -t
379 ./datagen -g256MB | $(LZ4)c32 -vqB4D | $(LZ4)c32 -qt
380 ./datagen -g6GB | $(LZ4)c32 -vqB5D | $(LZ4)c32 -qt
382 test-platform:
383 @echo "\n ---- test lz4 $(QEMU_SYS) platform ----"
384 $(QEMU_SYS) ./datagen -g16KB | $(QEMU_SYS) $(LZ4) -9 | $(QEMU_SYS) $(LZ4) -t
385 $(QEMU_SYS) ./datagen | $(QEMU_SYS) $(LZ4) | $(QEMU_SYS) $(LZ4) -t
386 $(QEMU_SYS) ./datagen -g256MB | $(QEMU_SYS) $(LZ4) -vqB4D | $(QEMU_SYS) $(LZ4) -qt
387 ifneq ($(QEMU_SYS),qemu-arm-static)
388 $(QEMU_SYS) ./datagen -g3GB | $(QEMU_SYS) $(LZ4) -vqB5D | $(QEMU_SYS) $(LZ4) -qt
391 test-fullbench: fullbench
392 ./fullbench --no-prompt $(NB_LOOPS) $(TEST_FILES)
394 test-fullbench32: CFLAGS += -m32
395 test-fullbench32: test-fullbench
397 test-fuzzer: fuzzer
400 test-fuzzer32: CFLAGS += -m32
401 test-fuzzer32: test-fuzzer
403 test-frametest: frametest
406 test-frametest32: CFLAGS += -m32
407 test-frametest32: test-frametest
409 test-mem: lz4 datagen fuzzer frametest fullbench
410 @echo "\n ---- valgrind tests : memory analyzer ----"
411 valgrind --leak-check=yes --error-exitcode=1 ./datagen -g50M > $(VOID)
412 ./datagen -g16KB > ftmdg16K
413 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -9 -BD -f ftmdg16K $(VOID)
414 ./datagen -g16KB -s2 > ftmdg16K2
415 ./datagen -g16KB -s3 > ftmdg16K3
416 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) --force --multiple ftmdg16K ftmdg16K2 ftmdg16K3
417 ./datagen -g7MB > ftmdg7M
418 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -9 -B5D -f ftmdg7M ftmdg16K2
419 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -t ftmdg16K2
420 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -bi1 ftmdg7M
421 valgrind --leak-check=yes --error-exitcode=1 ./fullbench -i1 ftmdg7M ftmdg16K2
422 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -B4D -f -vq ftmdg7M $(VOID)
424 valgrind --leak-check=yes --error-exitcode=1 ./fuzzer -i64 -t1
425 valgrind --leak-check=yes --error-exitcode=1 ./frametest -i256
427 test-mem32: lz4c32 datagen
428 # unfortunately, valgrind doesn't seem to work with non-native binary...