Commit Graph

103 Commits (9d666bb5aa68f65f0313fc6ee327b8bd42ecbec6)

Author SHA1 Message Date
Dmitri Shubin 4607f80f5a Don't hardcode installation directories in CMakeLists.txt
Use paths provided by GNUInstallDirs module instead.
2019-09-16 11:36:37 +03:00
Yann Collet be3d2e2de8
Merge pull request #1679 from ephiepark/dev
Restructure the source files
2019-07-19 15:29:07 -07:00
Ephraim Park 1dc98de279 Restructure the source files 2019-07-15 17:39:18 -07:00
Yann Collet b26818fe73
Merge pull request #1626 from LeeYoung624/dev
add cmake lz4 support
2019-06-19 13:35:33 -07:00
Yann Collet 837ff9d206
Merge pull request #1647 from LeeYoung624/cmake_bug_fix
CMake bug fix: didn't install zstdless and zstdgrep.
2019-06-14 17:32:05 -07:00
LeeYoung624 a4c0c27410 Install zstdless & zstdgrep as 'PROGRAMS' in CMake 2019-06-12 09:57:28 +08:00
Lee bc400ed13b
Merge pull request #4 from facebook/dev
merge
2019-06-11 11:25:26 +08:00
l00292966 b31df043a0 add cmake lz4 support
add some instructions for build/cmake/README.md
2019-06-03 18:22:50 +08:00
Jonathan Scott 3f5737afd7 CMake: Check for existing custom target 'uninstall' 2019-05-25 17:30:04 -07:00
Josh Soref a880ca239b Spelling (#1582)
* spelling: accidentally

* spelling: across

* spelling: additionally

* spelling: addresses

* spelling: appropriate

* spelling: assumed

* spelling: available

* spelling: builder

* spelling: capacity

* spelling: compiler

* spelling: compressibility

* spelling: compressor

* spelling: compression

* spelling: contract

* spelling: convenience

* spelling: decompress

* spelling: description

* spelling: deflate

* spelling: deterministically

* spelling: dictionary

* spelling: display

* spelling: eliminate

* spelling: preemptively

* spelling: exclude

* spelling: failure

* spelling: independence

* spelling: independent

* spelling: intentionally

* spelling: matching

* spelling: maximum

* spelling: meaning

* spelling: mishandled

* spelling: memory

* spelling: occasionally

* spelling: occurrence

* spelling: official

* spelling: offsets

* spelling: original

* spelling: output

* spelling: overflow

* spelling: overridden

* spelling: parameter

* spelling: performance

* spelling: probability

* spelling: receives

* spelling: redundant

* spelling: recompression

* spelling: resources

* spelling: sanity

* spelling: segment

* spelling: series

* spelling: specified

* spelling: specify

* spelling: subtracted

* spelling: successful

* spelling: return

* spelling: translation

* spelling: update

* spelling: unrelated

* spelling: useless

* spelling: variables

* spelling: variety

* spelling: verbatim

* spelling: verification

* spelling: visited

* spelling: warming

* spelling: workers

* spelling: with
2019-04-12 11:18:11 -07:00
Yann Collet fbdd30d68e fixed cmake build script for test programs 2019-04-10 17:47:01 -07:00
Yann Collet 2c6b14ed22 fixed Windows header
cmake build script: added timefn
2019-04-10 14:54:13 -07:00
Nehal J Wani 7ac2052dbc
[libzstd] Specify soversion and version correctly for CMake build
Fixes #1512
2019-03-23 17:37:37 +05:30
Hans Johnson 62c0dd7aff ENH: Simplify conditional logic
Based on excellent comment in #1489, the logic
to set cmake policies was simplified.  This will
provide an easier mechanism for maintaining the
conditional logic across many versions of cmake.
2019-01-08 14:25:56 -06:00
Erik Webb 9448a3790d Check CMake minor version support for VERSION_LESS_EQUAL
VERSION_LESS_EQUAL is only available to CMake 3.7+. This adds additional
logic to check that CMAKE_MINOR_VERSION is at least 7.

Fixes #1489
2019-01-03 15:26:20 -05:00
Hans Johnson 97d1de3d22 Provide forward compatible cmake paradigms
Automatically extract version information
from the zstd.h file.  Use naming of variables
consisent with modern cmake and https://semver.org/
(Semantic Versioning 2.0.0, MAJOR, MINOR, PATCH)

Modern versions of cmake provide consistent
paradigms for configuring project external
interface values.

This set of changes provide a back port of
some of cmake 3+ paradigms back to cmake 2.8.9.
Set and allow use of the current cmake policies
for newer versions of cmake when available to
allow for modern compiler features to be
utilized when available.

NOTE: The intent is that future modifications to
cmake will enable (conditional on cmake version support)
the ability to support modern linkage, and target
export mechanisms.  Those future changes will
make incorporating zstd into other packages
much easier.

This patch also allows the more rigourous error
checking of commmon cmake errors to be preformed
by cmake (i.e. more stringent syntax checking and
create errors for common hard to find misuses of
cmake variables).

This patch also provides support for modern
compiler support options by cmake (like
enabling interprocedural optimization
if link time optimizations are known to be supported
by the compiler envirionment.  IPO can be supported
by setting the CMAKE_INTERPROCEDURAL_OPTIMIZATION variable
for newer versions of cmake.
2018-12-28 13:47:35 -06:00
Yann Collet 23c73fe3e2
Merge pull request #1474 from hjmjohnson/cmake-set-default-build-type
Cmake set default build type
2018-12-28 11:02:22 -08:00
Yann Collet 6746de8dd6
Merge pull request #1478 from hjmjohnson/remove-duplicates-validation
BUG: list sub-command REMOVE_DUPLICATES requires list to be present
2018-12-28 10:50:03 -08:00
Hans Johnson 1a279ae85a BUG: list sub-command REMOVE_DUPLICATES requires list to be present
When compiling without c++ enabled, some variables are not present.
This is a check enforced in recent Cmake versions.

CMake Error at CMakeModules/AddZstdCompilationFlags.cmake:54 (list):
  list sub-command REMOVE_DUPLICATES requires list to be present.
Call Stack (most recent call first):
  CMakeLists.txt:53 (ADD_ZSTD_COMPILATION_FLAGS)
2018-12-26 13:26:59 -06:00
Hans Johnson 77ef7847f7 Improve setting the default build type
The CMAKE_BUILD_TYPE variable is a CACHE variable
and should be set in a way that persists and is
documented in the CACHE.  Also set the default
values for the gui to ease selection of types.

These changes provide better support for GUI
configurators that support cmake.
2018-12-26 13:23:21 -06:00
Hans Johnson 304df8b883 ENH: Update to -DZSTD_LEGACY_SUPPORT=5 2018-12-26 13:18:39 -06:00
Hans Johnson 443b5c40e4 DOC: Provide documentation for cmake best practices. 2018-12-24 07:06:31 -06:00
Hans Johnson d3fc848ddd STYLE: Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the block.
This is no longer the preferred style.
2018-12-22 19:32:39 -06:00
Hans Johnson 2f1ff84119 STYLE: Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command names
became case-insensitive.  Now the preferred style is lower-case.
2018-12-22 19:32:39 -06:00
Yann Collet f15312e884 fixed cmake build script 2018-11-13 13:16:41 -08:00
Antoine Pitrou 2186fbcf67 Allow creating debug builds with CMake
Only set the build type to Release if the user didn't select any.
See discussion in https://github.com/facebook/zstd/pull/1278#issuecomment-436327923
and below.
2018-11-06 21:24:29 +01:00
Yann Collet 2b4914082e created zstd_decompress_block module
isolate all logic associated with block decompression
into its own module.

zstd_decompress is still in charge
of context creation/destruction,
frames, headers, streaming, special blocks, etc.

Compressed blocks themselves are now handled within zstd_decompress_block .
2018-10-25 16:28:41 -07:00
Yann Collet ccd2d426fc separate DDict logic into its own module
created zstd_ddict.c within lib/decompress
2018-10-23 17:25:49 -07:00
Yann Collet f2cff22804
Merge pull request #1368 from rkjain89/test-branch
Moving Code To util.c
2018-10-19 16:31:10 -07:00
Sam Russell 490f652974 Add man pages for zstdgrep and zstdless 2018-10-15 22:25:03 +13:00
Rohit Jain b91f982e1e Adding chagnes for cmake and VStudio 2018-10-12 14:08:13 -07:00
Yann Collet 33d643124d fixed fullbench-lib target 2018-10-04 18:12:36 -07:00
Yann Collet 9ac8f2d7b9 fixed VS2017Community build script
reported by @epicabsol
2018-10-03 18:42:44 -07:00
Jennifer Liu 9d6ed9def3 Merge fastCover into DictBuilder (#1274)
* Minor fix

* Run non-optimize FASTCOVER 5 times in benchmark

* Merge fastCover into dictBuilder

* Fix mixed declaration issue

* Add fastcover to symbol.c

* Add fastCover.c and cover.h to build

* Change fastCover.c to fastcover.c

* Update benchmark to run FASTCOVER in dictBuilder

* Undo spliting fastcover_param into cover_param and f

* Remove convert param functions

* Assign f to parameter

* Add zdict.h to Makefile in lib

* Add cover.h to BUCK

* Cast 1 to U64 before shifting

* Remove trimming of zero freq head and tail in selectSegment and rebenchmark

* Remove f as a separate parameter of tryParam

* Read 8 bytes when d is 6

* Add trimming off zero frequency head and tail

* Use best functions from COVER and remove trimming part(which leads to worse compression ratio after previous bugs were fixed)

* Add finalize= argument to FASTCOVER to specify percentage of training samples passed to ZDICT_finalizeDictionary

* Change nbDmer to always read 8 bytes even when d=6

* Add skip=# argument to allow skipping dmers in computeFrequency in FASTCOVER

* Update comments and benchmarking result

* Change default method of ZDICT_trainFromBuffer to ZDICT_optimizeTrainFromBuffer_fastCover

* Add dictType enum and fix bug about passing zParam when converting to coverParam

* Combine finalize and skip into a single parameter

* Update acceleration parameters and benchmark on 3 sample sets

* Change default splitPoint of FASTCOVER to 0.75 and benchmark first 3 sample sets

* Initialize variables outside of for loop in benchmark.c

* Update benchmark result for hg-manifest

* Remove cover.h from install-includes

* Add explanation of f

* Set default compression level for trainFromBuffer to 3

* Add assertion of fastCoverParams in DiB_trainFromFiles

* Add checkTotalCompressedSize function + some minor fixes

* Add test for multithreading fastCovr

* Initialize segmentFreqs in every FASTCOVER_selectSegment and move mutex_unnlock to end of COVER_best_finish

* Free segmentFreqs

* Initialize segmentFreqs before calling FASTCOVER_buildDictionary instead of in FASTCOVER_selectSegment

* Add FASTCOVER_MEMMULT

* Minor fix

* Update benchmarking result
2018-08-23 12:06:20 -07:00
Timo Gurr e400a86f17 Use GNUInstallDirs DOCDIR for installing the manual 2018-08-17 13:50:00 +02:00
Eden Zik a6df961497 Cmake now builds with CMAKE_BUILD_TYPE=Release by default, both while
being invoked from the main Makefile (via cmakebuild) or directly from
the build/cmake directory. Suggested by @pdknsk (#1081).
2018-08-13 20:28:52 -04:00
cyan4973 e85b4c56b2 speed up appveyor tests 2018-07-30 17:13:13 +02:00
oleid 4e196b2ac3
Correct multithread logic, fixing 'unsupported parameter' error
The original conditions only worked, when both, static and shared variants where built, resulting in an inconsistency between programs and library. The program was built with MT support enabled, the library not. That lead to error 11 'unsupported parameter' when compressing anything with the command line tool.

When changing the AND condition to `ZSTD_MULTITHREAD_SUPPORT AND (ZSTD_BUILD_SHARED OR ZSTD_BUILD_SHARED)`, cmake stopps complaining one of the targets wasn't built. This commit works for any case.
2018-06-26 08:36:41 +02:00
Yann Collet 507bef196d added debug.h for cmake 2018-06-14 19:48:40 -04:00
Yann Collet 2d76defbfe grouped all histogram functions into hist.c
renamed functions with HIST_* prefix
2018-06-13 19:49:31 -04:00
Nick Terrell 268cc2a516 Fix CMake build
`MAN_INSTALL_DIR` was undefined.

Tested with `make cmakebuild`, and saw that the man pages got installed to the right place:

```
-- Installing: /Users/terrelln/install_test_dir/lib/pkgconfig/libzstd.pc
-- Installing: /Users/terrelln/install_test_dir/include/zstd.h
-- Installing: /Users/terrelln/install_test_dir/include/zbuff.h
-- Installing: /Users/terrelln/install_test_dir/include/zdict.h
-- Installing: /Users/terrelln/install_test_dir/include/zstd_errors.h
-- Installing: /Users/terrelln/install_test_dir/lib/libzstd.1.3.4.dylib
-- Installing: /Users/terrelln/install_test_dir/lib/libzstd.dylib
-- Installing: /Users/terrelln/install_test_dir/lib/libzstd.a
-- Installing: /Users/terrelln/install_test_dir/bin/zstd
-- Up-to-date: /Users/terrelln/install_test_dir/bin/zstd
-- Installing: /Users/terrelln/install_test_dir/bin/zstdcat
-- Installing: /Users/terrelln/install_test_dir/bin/unzstd
-- Installing: /Users/terrelln/install_test_dir/share/man/man1/zstd.1
-- Installing: /Users/terrelln/install_test_dir/share/man/man1/zstdcat.1
-- Installing: /Users/terrelln/install_test_dir/share/man/man1/unzstd.1
-- Installing: /Users/terrelln/install_test_dir/bin/zstdmt
-- Installing: /Users/terrelln/install_test_dir/bin/pzstd
-- Installing: /Users/terrelln/install_test_dir/zstd_manual.html
```
2018-03-26 14:59:26 -07:00
Varunram 0034c759b0 Update man page variables in CMakeLists 2018-03-21 14:10:42 +05:30
Varunram 90c598f089 Add missing checks to CMakeLists;closes #1023 2018-03-18 15:48:58 +05:30
Alexey Ivanov 22303da601 CMake: fixed multithreading build on Windows
`ZSTD_MULTITHREAD_SUPPORT` option fixed for Windows.

Signed-off-by: Alexey Ivanov <alexey.ivanes@gmail.com>
2018-01-17 10:27:52 +03:00
Alexey Ivanov 403e2db139 CMake: use GNUInstallDirs for library install dir
Libraries now will be installed in the correct directory on x86_64 linux systems,
and can be changed with `-DCMAKE_INSTALL_LIBDIR=<dirname>` option.
2018-01-15 22:48:46 +03:00
Yann Collet 72c0f4574c cmake: fixed lib/CMakeLists.txt
changed file name from zstd_compress.h to zstd_compress_internal.h
2017-11-10 09:39:11 -08:00
Stella Lau 360428c5d9 Move ldm functions to their own file 2017-09-06 18:09:26 -07:00
Nick Terrell a4eac0db29 Update build scripts 2017-09-05 17:10:29 -07:00
Yann Collet b0cb081dc8 last batch of header files changed to reflect new license (#825)
only remains to update contrib/linux-kernel (@terrelln)
2017-08-31 12:20:50 -07:00
Yann Collet e21384fffb fixed more file headers after license change (#825) 2017-08-31 12:11:57 -07:00