### Install zstandard to a staging directory Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/meson/README.md This command demonstrates how to install the built zstandard library into a specified staging directory, which is useful for packaging or isolated deployments without affecting the system-wide installation. ```sh DESTDIR=./staging ninja install ``` -------------------------------- ### FastCover Dictionary Builder Usage Examples Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/experimental_dict_builders/fastCover/README.md Illustrative examples demonstrating how to invoke the FastCover Dictionary Builder with various combinations of input files/directories, output dictionary names, and dictionary IDs. ```Shell make ARG="in=../../../lib/dictBuilder out=dict100 dictID=520" ``` ```Shell make ARG="in=../../../lib/dictBuilder in=../../../lib/compress" ``` -------------------------------- ### Simple Compression with Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Demonstrates how to compress a single file using the Zstandard library's basic compression mode. This example introduces the fundamental usage of the `ZSTD_compress()` function. ```APIDOC ZSTD_compress() ``` -------------------------------- ### Zstandard: Advanced Compression Command Example Source: https://github.com/tencent/mars/blob/master/mars/zstd/programs/zstd.1.md An example command demonstrating how to set advanced Zstandard compression options via the `--zstd` flag, mimicking predefined level 19 for files larger than 256 KB. ```shell --zstd=wlog=23,clog=23,hlog=22,slog=6,mml=3,tlen=48,strat=6 ``` -------------------------------- ### Build zstandard with Meson Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/meson/README.md This snippet provides the standard steps to set up, compile, and install the zstandard library using the Meson build system. It enables binary programs and contrib binaries for the build. ```sh meson setup -Dbin_programs=true -Dbin_contrib=true builddir cd builddir ninja # to build ninja install # to install ``` -------------------------------- ### CMake: Define Executable, Installation, and VS Startup Project Source: https://github.com/tencent/mars/blob/master/samples/Windows/CMakeLists.txt This CMake snippet defines the main executable for the project, specifies its source files including a resource file, and configures its installation destination. It also sets the project as the startup project in Visual Studio for development convenience. ```CMake add_executable(${PROJECT_NAME} WIN32 ${SELF_SRC_FILES} Sample.rc) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${SELF_LIBS_OUT}) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME}) ``` -------------------------------- ### Streaming Compression with Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Demonstrates how to compress a single file using Zstandard's streaming API. This example introduces the `ZSTD_compressStream()` function for incremental compression. ```APIDOC ZSTD_compressStream() ``` -------------------------------- ### Build with Dictionary and Compression Libraries Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/README.md Example `make` command to build the project, specifying input paths for dictionary builder and compression libraries. This command configures the build process to incorporate specific external components. ```Shell make ARG="in=../../../lib/dictBuilder in=../../../lib/compress" ``` -------------------------------- ### Example: Build Dictionary from Multiple Input Sources Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/experimental_dict_builders/randomDictBuilder/README.md This example illustrates how to combine data from multiple input directories to build a single random dictionary. It uses `../../../lib/dictBuilder` and `../../../lib/compress` as input sources, demonstrating the flexibility of the `in=` argument. ```Shell make ARG="in=../../../lib/dictBuilder in=../../../lib/compress" ``` -------------------------------- ### Example Console Output: Original Zlib Source: https://github.com/tencent/mars/blob/master/mars/zstd/zlibWrapper/README.md This snippet displays the console output from `test/example.c` when compiled and executed using the original zlib library, demonstrating its standard compression and decompression capabilities. ```Shell zlib version 1.2.8 = 0x1280, compile flags = 0x65 uncompress(): hello, hello! gzread(): hello, hello! gzgets() after gzseek: hello! inflate(): hello, hello! large_inflate(): OK after inflateSync(): hello, hello! inflate with dictionary: hello, hello! ``` -------------------------------- ### Install pzstd Executable to Binary Directory Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/contrib/pzstd/CMakeLists.txt This CMake command defines an installation rule for the 'pzstd' executable. It specifies that the runtime executable should be placed in the 'bin' directory during the installation process. ```CMake install(TARGETS pzstd RUNTIME DESTINATION "bin") ``` -------------------------------- ### Initialize CMake Project and Set Installation Prefix Source: https://github.com/tencent/mars/blob/master/mars/xlog/CMakeLists.txt Sets the minimum required CMake version, defines the installation directory, and declares the project name 'xlog'. The installation prefix is forced to the binary directory. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") project (xlog) set(SELF_LIBS_OUT ${CMAKE_SYSTEM_NAME}.out) ``` -------------------------------- ### Set Minimum CMake Version and Installation Prefix Source: https://github.com/tencent/mars/blob/master/mars/sdt/CMakeLists.txt Configures the minimum required CMake version (3.6) for the project and defines the installation directory. The installation prefix is set to the binary directory and cached, ensuring consistent builds and installations. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") ``` -------------------------------- ### Build Zstandard CLI and Library with Makefile Source: https://github.com/tencent/mars/blob/master/mars/zstd/README.md Instructions for building the Zstandard command-line interface, library, and man pages using standard `make` or `gmake`. This section covers basic compilation, installation, and running self-tests to verify functionality on the local platform. ```bash make ``` ```bash make install ``` ```bash make check ``` -------------------------------- ### Dictionary-Based Compression with Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Demonstrates how to compress multiple files using a pre-trained dictionary, which can significantly improve compression ratios for similar data. This example introduces `ZSTD_createCDict()` for creating a compression dictionary and `ZSTD_compress_usingCDict()` for compressing with it. ```APIDOC ZSTD_createCDict() ZSTD_compress_usingCDict() ``` -------------------------------- ### Initialize CMake Project and Set Installation Prefix for Comm Library Source: https://github.com/tencent/mars/blob/master/mars/comm/CMakeLists.txt This snippet sets the minimum required CMake version, defines the installation directory for the built artifacts, and declares the project name as 'comm'. It also prints the installation prefix to the console for debugging or informational purposes. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") project (comm) ``` -------------------------------- ### Apply Compilation Flags and Display Installation Paths Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/CMakeLists.txt This section includes standard GNU installation directories, applies Zstandard-specific compilation flags by calling ADD_ZSTD_COMPILATION_FLAGS(), and defines the XXH_NAMESPACE preprocessor macro. It also outputs the configured installation prefix and library directory for user reference. ```CMake include(GNUInstallDirs) #----------------------------------------------------------------------------- # Add extra compilation flags #----------------------------------------------------------------------------- include(AddZstdCompilationFlags) ADD_ZSTD_COMPILATION_FLAGS() # Always hide XXHash symbols add_definitions(-DXXH_NAMESPACE=ZSTD_) #----------------------------------------------------------------------------- # Installation variables #----------------------------------------------------------------------------- message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") message(STATUS "CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR}") ``` -------------------------------- ### Streaming Decompression with Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Shows how to decompress a single file compressed by Zstandard, compatible with both simple and streaming compression modes. The decompressed result is sent to standard output. This example introduces the `ZSTD_decompressStream()` function. ```APIDOC ZSTD_decompressStream() ``` -------------------------------- ### Building Zstandard Libraries with Makefile Source: https://github.com/tencent/mars/blob/master/mars/zstd/lib/README.md Instructions for compiling Zstandard static and dynamic libraries using the provided Makefile, including standard targets for generation and installation. The default scope includes compression, decompression, dictionary builder, and legacy format support. ```Makefile make ``` ```Makefile make install ``` ```Makefile make lib-mt ``` -------------------------------- ### Simple Decompression with Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Illustrates how to decompress a single file that was compressed using Zstandard's simple compression mode. The decompressed result is retained in memory. This example introduces the `ZSTD_decompress()` function. ```APIDOC ZSTD_decompress() ``` -------------------------------- ### Example Console Output: Zstd Wrapper Enabled Source: https://github.com/tencent/mars/blob/master/mars/zstd/zlibWrapper/README.md This snippet shows the console output from `test/example.c` after modifying it to use the Zstd wrapper and enabling Zstd compression. It highlights that some functions were turned off due to currently unsupported features with the wrapper. ```Shell zlib version 1.2.8 = 0x1280, compile flags = 0x65 uncompress(): hello, hello! gzread(): hello, hello! gzgets() after gzseek: hello! inflate(): hello, hello! large_inflate(): OK inflate with dictionary: hello, hello! ``` -------------------------------- ### Generate and Install Pkg-config File for ZSTD on Unix with CMake Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/lib/CMakeLists.txt This CMake block handles the generation and installation of the `libzstd.pc` pkg-config file, specifically for Unix-like systems. It sets necessary variables like `PREFIX`, `LIBDIR`, and `VERSION`, then uses a custom target to process a template file and installs the resulting `.pc` file to the appropriate pkg-config directory. ```CMake if (UNIX) # pkg-config set(PREFIX "${CMAKE_INSTALL_PREFIX}") set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") set(VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}") add_custom_target(libzstd.pc ALL ${CMAKE_COMMAND} -DIN="${LIBRARY_DIR}/libzstd.pc.in" -DOUT="libzstd.pc" -DPREFIX="${PREFIX}" -DVERSION="${VERSION}" -P "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake" COMMENT "Creating pkg-config file") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "${LIBDIR}/pkgconfig") endif () ``` -------------------------------- ### UNIX-Specific Utilities, Symlinks, and Manpage Installation Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/programs/CMakeLists.txt This block configures UNIX-specific build targets, including creating symbolic links for 'zstdcat' and 'unzstd', installing utility scripts ('zstdgrep', 'zstdless'), and preparing and installing manpages. It also defines a 'zstd-frugal' executable with reduced functionality. ```CMake if (UNIX) add_custom_target(zstdcat ALL ${CMAKE_COMMAND} -E create_symlink zstd zstdcat DEPENDS zstd COMMENT "Creating zstdcat symlink") add_custom_target(unzstd ALL ${CMAKE_COMMAND} -E create_symlink zstd unzstd DEPENDS zstd COMMENT "Creating unzstd symlink") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstdcat DESTINATION "${CMAKE_INSTALL_BINDIR}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unzstd DESTINATION "${CMAKE_INSTALL_BINDIR}") install(PROGRAMS ${PROGRAMS_DIR}/zstdgrep DESTINATION "${CMAKE_INSTALL_BINDIR}") install(PROGRAMS ${PROGRAMS_DIR}/zstdless DESTINATION "${CMAKE_INSTALL_BINDIR}") add_custom_target(zstd.1 ALL ${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstd.1 . COMMENT "Copying manpage zstd.1") add_custom_target(zstdgrep.1 ALL ${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstdgrep.1 . COMMENT "Copying manpage zstdgrep.1") add_custom_target(zstdless.1 ALL ${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstdless.1 . COMMENT "Copying manpage zstdless.1") add_custom_target(zstdcat.1 ALL ${CMAKE_COMMAND} -E create_symlink zstd.1 zstdcat.1 DEPENDS zstd.1 COMMENT "Creating zstdcat.1 symlink") add_custom_target(unzstd.1 ALL ${CMAKE_COMMAND} -E create_symlink zstd.1 unzstd.1 DEPENDS zstd.1 COMMENT "Creating unzstd.1 symlink") # Define MAN_INSTALL_DIR if necessary if (MAN_INSTALL_DIR) else () set(MAN_INSTALL_DIR ${CMAKE_INSTALL_MANDIR}/man1) endif () install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstd.1 ${CMAKE_CURRENT_BINARY_DIR}/zstdcat.1 ${CMAKE_CURRENT_BINARY_DIR}/unzstd.1 ${CMAKE_CURRENT_BINARY_DIR}/zstdgrep.1 ${CMAKE_CURRENT_BINARY_DIR}/zstdless.1 DESTINATION "${MAN_INSTALL_DIR}") add_executable(zstd-frugal ${PROGRAMS_DIR}/zstdcli.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${PROGRAMS_DIR}/fileio.c) target_link_libraries(zstd-frugal ${PROGRAMS_ZSTD_LINK_TARGET}) set_property(TARGET zstd-frugal APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_NOBENCH;ZSTD_NODICT") endif () ``` -------------------------------- ### Dictionary-Based Decompression with Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Illustrates how to decompress multiple files using the same dictionary that was used for compression. The decompressed result remains in memory. This example introduces `ZSTD_createDDict()` for creating a decompression dictionary and `ZSTD_decompress_usingDDict()` for decompressing with it. ```APIDOC ZSTD_createDDict() ZSTD_decompress_usingDDict() ``` -------------------------------- ### Build and Install Mars Boost Static Library Source: https://github.com/tencent/mars/blob/master/mars/boost/CMakeLists.txt This snippet defines the `mars-boost` project as a static library using all collected source files. It then configures the installation of this static library, placing its archive in a platform-specific output directory. ```CMake add_library(${PROJECT_NAME} STATIC ${SELF_SRC_FILES}) install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CMAKE_SYSTEM_NAME}.out) ``` -------------------------------- ### Build and Install the Main 'zstd' Executable Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/programs/CMakeLists.txt This snippet defines the main 'zstd' executable, specifying its source files and linking it against the appropriate Zstandard library (static or shared). It also handles platform-specific linking for Solaris/SunOS and installs the compiled executable to the binary directory. ```CMake add_executable(zstd ${PROGRAMS_DIR}/zstdcli.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${PROGRAMS_DIR}/fileio.c ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/dibio.c ${PlatformDependResources}) target_link_libraries(zstd ${PROGRAMS_ZSTD_LINK_TARGET}) if (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") target_link_libraries(zstd rt) endif () install(TARGETS zstd RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ``` -------------------------------- ### Example: Build Dictionary with Custom Output and ID Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/experimental_dict_builders/randomDictBuilder/README.md This example demonstrates building a random dictionary from the `../../../lib/dictBuilder` input. The output dictionary will be named `dict100` and assigned a dictionary ID of `520`. This showcases specifying both output file and metadata. ```Shell make ARG="in=../../../lib/dictBuilder out=dict100 dictID=520" ``` -------------------------------- ### General CMake Configuration for Tencent Mars Project Source: https://github.com/tencent/mars/blob/master/mars/CMakeLists.txt This snippet defines the minimum CMake version, sets the installation prefix, includes global directories, and adds subdirectories for core modules like `comm`, `boot`, `boost`, `app`, `baseevent`, `xlog`, `sdt`, and `stn`. It also configures options for building the ZSTD library and includes project-specific utility files. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") include_directories(openssl/include) add_subdirectory(comm comm) add_subdirectory(boot boot) add_subdirectory(boost boost) add_subdirectory(app app) add_subdirectory(baseevent baseevent) add_subdirectory(xlog xlog) add_subdirectory(sdt sdt) add_subdirectory(stn stn) # for zstd option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON) option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF) set(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zstd") set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib) include(GNUInstallDirs) add_subdirectory(zstd/build/cmake/lib zstd) project (mars) include(comm/utils.cmake) include_directories(.) include_directories(..) set(SELF_LIBS_OUT ${CMAKE_SYSTEM_NAME}.out) ``` -------------------------------- ### Compiling and Generating ZSTD Manual with gen_html Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/gen_html/README.md These commands demonstrate the typical workflow for compiling the `gen_html` program using `make` and then executing it to generate the `zstd` manual. The example uses version 1.1.1 and specifies the input and output file paths. ```Shell make ./gen_html.exe 1.1.1 ../../lib/zstd.h zstd_manual.html ``` -------------------------------- ### CMake Build Configuration for Mars Boot Module Source: https://github.com/tencent/mars/blob/master/mars/boot/CMakeLists.txt This snippet demonstrates the CMake configuration for building the 'boot' module. It covers setting the minimum required CMake version, defining the installation prefix, including common utility CMake files, specifying global and relative include directories, collecting source files using `file(GLOB)`, and applying platform-specific build flags and source inclusions for MSVC and Android. ```CMake cmake_minimum_required(VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") project(boot) include(../comm/utils.cmake) include(../comm/CMakeExtraFlags.txt) include_directories(.) include_directories(src) include_directories(..) include_directories(../..) include_directories(../comm) include_directories(../../..) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.h) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) source_group(src FILES ${SELF_TEMP_SRC_FILES}) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) if (MSVC) add_definitions(/FI"../../comm/projdef.h") include_directories(../comm/windows) elseif (ANDROID) if (NOT CPP_CALL_BACK) file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) endif () if (NATIVE_CALLBACK) add_definitions(-DNATIVE_CALLBACK) endif () list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) endif () BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") ``` -------------------------------- ### Initialize CMake Project and Global Settings Source: https://github.com/tencent/mars/blob/master/mars/boost/CMakeLists.txt This snippet sets the minimum required CMake version, defines the installation prefix, and adds global compile options like suppressing warnings. It also declares the project name and includes common utility files and directories. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") add_compile_options(-w) # 屏蔽所有编译警告 project (mars-boost) include(../comm/utils.cmake) include_directories(.) include_directories(..) add_definitions(-DBOOST_NO_EXCEPTIONS) ``` -------------------------------- ### Multiple Simple File Compression with Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Shows how to compress multiple files in simple mode via a single command line. This technique demonstrates memory preservation by minimizing `malloc()` and `free()` calls through resource reuse. It introduces the `ZSTD_compressCCtx()` function. ```APIDOC ZSTD_compressCCtx() ``` -------------------------------- ### Configure Build System for Alarm Project Source: https://github.com/tencent/mars/blob/master/mars/comm/alarm/CMakeLists.txt This CMake script defines the build process for the 'alarm' project. It sets the minimum required CMake version, specifies the installation directory, includes common CMake utility files and flags, defines a comprehensive list of include directories, and dynamically discovers source files. It also incorporates conditional logic to apply specific compiler definitions and include paths for MSVC and Android platforms, finally invoking a function to build the project with unit tests. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") project (alarm) include(../comm/CMakeUtils.txt) include(../comm/CMakeExtraFlags.txt) include_directories(.) include_directories(src) include_directories(..) include_directories(../..) include_directories(../comm) include_directories(../../..) include_directories(../boot) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.h) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) source_group(src FILES ${SELF_TEMP_SRC_FILES}) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) if(MSVC) add_definitions(/FI"../../comm/projdef.h") include_directories(../comm/windows) elseif(ANDROID) if(NOT CPP_CALL_BACK) file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) endif() if(NATIVE_CALLBACK) message("applogic native callback") add_definitions(-DNATIVE_CALLBACK) endif() list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) endif() BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") ``` -------------------------------- ### Install Static ZSTD Library Target with CMake Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/lib/CMakeLists.txt This CMake snippet defines the installation rule for the static ZSTD library target (`libzstd_static`). It specifies that the archive component of the static library should be installed to `CMAKE_INSTALL_LIBDIR`. This installation is conditional on `ZSTD_BUILD_STATIC` being enabled. ```CMake if (ZSTD_BUILD_STATIC) install(TARGETS libzstd_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif () ``` -------------------------------- ### Configure CMake Build for Tencent Mars App Module Source: https://github.com/tencent/mars/blob/master/mars/app/CMakeLists.txt This CMakeLists.txt defines the build rules for the 'app' module of the Tencent Mars project. It sets up the minimum CMake version, defines the installation prefix, includes common utility scripts, specifies include directories, discovers source files, and applies platform-specific compiler definitions for MSVC and Android, finally invoking a unit test build function. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") project (app) include(../comm/utils.cmake) include(../comm/CMakeExtraFlags.txt) include_directories(.) include_directories(src) include_directories(..) include_directories(../..) include_directories(../comm) include_directories(../../..) include_directories(../boot) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.h) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) source_group(src FILES ${SELF_TEMP_SRC_FILES}) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) if(MSVC) add_definitions(/FI"../../comm/projdef.h") include_directories(../comm/windows) elseif(ANDROID) if(NOT CPP_CALL_BACK) file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) endif() if(NATIVE_CALLBACK) message("applogic native callback") add_definitions(-DNATIVE_CALLBACK) endif() list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) endif() BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") ``` -------------------------------- ### Configure CMake Build for baseevent Project Source: https://github.com/tencent/mars/blob/master/mars/baseevent/CMakeLists.txt This snippet defines the CMake build process for the 'baseevent' project. It sets the minimum required CMake version, configures the installation directory, includes shared utility and flag files, and specifies necessary include paths. It gathers source files, groups them, and applies conditional logic for MSVC (adding a precompiled header definition and Windows-specific includes) and Android (including JNI source files). The project is then built with unit testing enabled. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") project (baseevent) include(../comm/utils.cmake) include(../comm/CMakeExtraFlags.txt) include_directories(.) include_directories(src) include_directories(..) include_directories(../..) include_directories(../comm) include_directories(../../..) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) source_group(src FILES ${SELF_TEMP_SRC_FILES}) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) if(MSVC) add_definitions(/FI"../../comm/projdef.h") include_directories(../comm/windows) elseif(ANDROID) file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) endif() BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") ``` -------------------------------- ### Optimized Multiple Streaming Compression with Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Illustrates how to compress multiple files in streaming mode using a single command line, focusing on memory efficiency. This method employs a memory usage preservation technique, reducing the impact of `malloc()`, `free()`, and `memset()` by reusing existing resources, building upon core streaming functions like `ZSTD_compressStream()`. ```APIDOC ZSTD_compressStream() ``` -------------------------------- ### CMake Project and Directory Setup for Zstandard Tests Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/tests/CMakeLists.txt Configures the CMake project name, enables current directory includes, and defines key source, programs, and tests directories for the Zstandard build. It also sets up include paths for various Zstandard library components, ensuring all necessary headers are found during compilation. ```CMake project(tests) set(CMAKE_INCLUDE_CURRENT_DIR TRUE) # Define programs directory, where sources and header files are located set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib) set(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs) set(TESTS_DIR ${ZSTD_SOURCE_DIR}/tests) include_directories(${TESTS_DIR} ${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${LIBRARY_DIR}/compress ${LIBRARY_DIR}/dictBuilder) ``` -------------------------------- ### Using Zstandard with Long Distance Matching Mode Source: https://github.com/tencent/mars/blob/master/mars/zstd/programs/README.md Demonstrates various Zstandard compression levels with and without the `--long` flag, highlighting their impact on compression ratio, compression speed, and decompression speed. The examples are based on an ideal use case (multiple clang versions) and a less ideal one (Silesia corpus). ```Shell zstd -1 zstd -5 zstd -10 zstd -1 --long zstd -5 --long zstd -10 --long ``` -------------------------------- ### Build Zstandard Binary with Buck Source: https://github.com/tencent/mars/blob/master/mars/zstd/README.md Detailed command for building the Zstandard binary using the Buck build system. The output binary will be generated in the specified `buck-out/gen/programs/` directory relative to the repository root. ```bash buck build programs:zstd ``` -------------------------------- ### CMake Configuration for ZSTD HTML Manual Generation Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/contrib/gen_html/CMakeLists.txt This CMake script defines the build process for creating the Zstandard (ZSTD) library's HTML manual. It sets up project directories, includes necessary paths, compiles a C++ utility (`gen_html`) responsible for parsing `zstd.h`, and then uses this utility to generate `zstd_manual.html`. A custom target ensures the manual is updated during the build, and the generated file is installed to the system's documentation directory. ```CMake project(gen_html) include(GetZstdLibraryVersion) set(CMAKE_INCLUDE_CURRENT_DIR TRUE) # Define programs directory, where sources and header files are located set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib) set(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs) set(GENHTML_DIR ${ZSTD_SOURCE_DIR}/contrib/gen_html) set(GENHTML_BINARY ${PROJECT_BINARY_DIR}/gen_html${CMAKE_EXECUTABLE_SUFFIX}) include_directories(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${GENHTML_DIR}) add_executable(gen_html ${GENHTML_DIR}/gen_html.cpp) GetZstdLibraryVersion(${LIBRARY_DIR}/zstd.h VMAJOR VMINOR VRELEASE) set(LIBVERSION "${VMAJOR}.${VMINOR}.${VRELEASE}") add_custom_target(zstd_manual.html ALL ${GENHTML_BINARY} "${LIBVERSION}" "${LIBRARY_DIR}/zstd.h" "${PROJECT_BINARY_DIR}/zstd_manual.html" DEPENDS gen_html COMMENT "Update zstd manual") install(FILES "${PROJECT_BINARY_DIR}/zstd_manual.html" DESTINATION "${CMAKE_INSTALL_DOCDIR}") ``` -------------------------------- ### Install Shared ZSTD Library Target with CMake Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/lib/CMakeLists.txt This CMake snippet defines the installation rules for the shared ZSTD library target (`libzstd_shared`). It specifies that runtime components go to `CMAKE_INSTALL_BINDIR`, while library and archive components are installed to `CMAKE_INSTALL_LIBDIR`. This is conditional on `ZSTD_BUILD_SHARED` being enabled. ```CMake if (ZSTD_BUILD_SHARED) install(TARGETS libzstd_shared RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif() ``` -------------------------------- ### Configure Build for STN Component using CMake Source: https://github.com/tencent/mars/blob/master/mars/stn/CMakeLists.txt This CMake script defines the build environment for the 'stn' project. It specifies the minimum CMake version, sets the installation directory, includes common build utilities and flags, and defines all necessary include directories. The script dynamically discovers source files in 'src' and the project root, organizing them into source groups. It also contains conditional logic to apply specific build settings for MSVC (e.g., preprocessor definitions, Windows-specific includes) and Android (e.g., JNI source files, native callback definitions). The build process concludes by invoking a 'BuildWithUnitTest' function, indicating integration with a testing framework. ```CMake cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") project (stn) include(../comm/utils.cmake) include(../comm/CMakeExtraFlags.txt) include_directories(.) include_directories(src) include_directories(..) include_directories(../..) include_directories(../comm) include_directories(../../..) include_directories(../openssl/include) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) source_group(src FILES ${SELF_TEMP_SRC_FILES}) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.h) list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) if(MSVC) add_definitions(/FI"../../comm/projdef.h") include_directories(../comm/windows) elseif(ANDROID) if(NOT CPP_CALL_BACK) file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) endif() if(NATIVE_CALLBACK) message("stn native callback") add_definitions(-DNATIVE_CALLBACK) endif() list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) endif() BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") ``` -------------------------------- ### Zstandard CLI Options and Arguments Reference Source: https://github.com/tencent/mars/blob/master/mars/zstd/programs/README.md Detailed documentation for the `zstd` command-line tool, listing all available options for compression, decompression, dictionary management, benchmarking, and general utility. It includes basic usage, advanced arguments, dictionary builder options, and benchmark-specific parameters. ```APIDOC Usage : zstd [args] [FILE(s)] [-o file] FILE : a filename with no FILE, or when FILE is - , read standard input Arguments : -# : # compression level (1-19, default: 3) -d : decompression -D file: use `file` as Dictionary -o file: result stored into `file` (only if 1 input file) -f : overwrite output without prompting and (de)compress links --rm : remove source file(s) after successful de/compression -k : preserve source file(s) (default) -h/-H : display help/long help and exit Advanced arguments : -V : display Version number and exit -v : verbose mode; specify multiple times to increase verbosity -q : suppress warnings; specify twice to suppress errors too -c : force write to standard output, even if it is the console -l : print information about zstd compressed files --ultra : enable levels beyond 19, up to 22 (requires more memory) --long : enable long distance matching (requires more memory) --no-dictID : don't write dictID into header (dictionary compression) --[no-]check : integrity check (default: enabled) -r : operate recursively on directories --format=gzip : compress files to the .gz format --format=xz : compress files to the .xz format --format=lzma : compress files to the .lzma format --test : test compressed file integrity --[no-]sparse : sparse mode (default: disabled) -M# : Set a memory usage limit for decompression -- : All arguments after "--" are treated as files Dictionary builder : --train ## : create a dictionary from a training set of files --train-cover[=k=#,d=#,steps=#,split=#,shrink[=#]] : use the cover algorithm with optional args --train-fastcover[=k=#,d=#,f=#,steps=#,split=#,shrink[=#],accel=#] : use the fastcover algorithm with optional args --train-legacy[=s=#] : use the legacy algorithm with selectivity (default: 9) -o file : `file` is dictionary name (default: dictionary) --maxdict=# : limit dictionary to specified size (default: 112640) --dictID=# : force dictionary ID to specified value (default: random) Benchmark arguments : -b# : benchmark file(s), using # compression level (default: 3) -e# : test all compression levels from -bX to # (default: 1) -i# : minimum evaluation time in seconds (default: 3s) -B# : cut file into independent blocks of size # (default: no block) --priority=rt : set process priority to real-time ``` -------------------------------- ### Get Zstandard Frame Content Size Source: https://github.com/tencent/mars/blob/master/mars/zstd/doc/zstd_manual.html `src` should point to the start of a ZSTD encoded frame. `srcSize` must be at least as large as the frame header (any size >= `ZSTD_frameHeaderSize_max` is large enough). Returns the decompressed size of the `src` frame content if known, `ZSTD_CONTENTSIZE_UNKNOWN` if the size cannot be determined, or `ZSTD_CONTENTSIZE_ERROR` if an error occurred (e.g., invalid magic number, `srcSize` too small). Note: a 0 return value means the frame is valid but "empty". ```APIDOC #define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1) #define ZSTD_CONTENTSIZE_ERROR (0ULL - 2) unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize); ``` -------------------------------- ### Querying Streaming Context Memory Usage in Zstandard Source: https://github.com/tencent/mars/blob/master/mars/zstd/examples/README.md Provides an example of how to determine the amount of memory consumed by a Zstandard streaming context. This snippet introduces the `ZSTD_sizeof_CStream()` function. ```APIDOC ZSTD_sizeof_CStream() ``` -------------------------------- ### Run FastCover Dictionary Builder Tests Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/experimental_dict_builders/fastCover/README.md Executes the test suite for the FastCover Dictionary Builder to ensure proper functionality. ```Shell make test ``` -------------------------------- ### Basic Zstd Command-Line Usage Synopsis Source: https://github.com/tencent/mars/blob/master/mars/zstd/programs/zstd.1.md Illustrates the fundamental command-line syntax for zstd, zstdmt, unzstd, and zstdcat. It shows how to specify input and output files and highlights equivalent commands for common operations. ```Shell zstd [OPTIONS] [-|_INPUT-FILE_] [-o _OUTPUT-FILE_] zstdmt is equivalent to zstd -T0 unzstd is equivalent to zstd -d zstdcat is equivalent to zstd -dcf ``` -------------------------------- ### Displaying PZstandard Help Options Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/pzstd/README.md Shows the command to display all available command-line options and their descriptions for PZstandard, including default thread settings. ```Shell pzstd --help ``` -------------------------------- ### Run Dictionary Builder Benchmarking Tests Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/README.md Execute the predefined test suite for the Dictionary Builder using the 'make test' command, typically defined in a Makefile. ```Shell make test ``` -------------------------------- ### Zstandard Dictionary Creation and Usage Source: https://github.com/tencent/mars/blob/master/mars/zstd/README.md Learn how to create a Zstandard dictionary from a training set of similar small data samples. This dictionary can then be used during compression and decompression to achieve significantly better compression ratios and speeds for small, correlated data, as the algorithm can leverage pre-learned patterns. ```bash zstd --train FullPathToTrainingSet/* -o dictionaryName ``` ```bash zstd -D dictionaryName FILE ``` ```bash zstd -D dictionaryName --decompress FILE.zst ``` -------------------------------- ### List Source Files for Tencent Mars Sample CMake Project Source: https://github.com/tencent/mars/blob/master/samples/Windows/CMakeLists.txt This comprehensive list defines all source files (`.cpp`, `.cc`) that are part of the 'sample' project. It includes business logic files, UI-related files, and a large number of generated Protobuf files, as well as core Google Protobuf library source files, indicating a heavy reliance on Protobuf for data serialization. ```CMake set(SELF_SRC_FILES Business/ChatCGITask.cpp Business/GetConvListCGITask.cpp Business/HelloCGITask.cpp Business/MarsWrapper.cpp ChatDlg.cpp MainDlg.cpp PingServerDlg.cpp proto/generate/chat.pb.cc proto/generate/main.pb.cc proto/generate/messagepush.pb.cc proto/protobuf/google/protobuf/any.cc proto/protobuf/google/protobuf/any.pb.cc proto/protobuf/google/protobuf/api.pb.cc proto/protobuf/google/protobuf/arena.cc proto/protobuf/google/protobuf/arenastring.cc proto/protobuf/google/protobuf/descriptor.cc proto/protobuf/google/protobuf/descriptor.pb.cc proto/protobuf/google/protobuf/descriptor_database.cc proto/protobuf/google/protobuf/duration.pb.cc proto/protobuf/google/protobuf/dynamic_message.cc proto/protobuf/google/protobuf/empty.pb.cc proto/protobuf/google/protobuf/extension_set.cc proto/protobuf/google/protobuf/extension_set_heavy.cc proto/protobuf/google/protobuf/field_mask.pb.cc proto/protobuf/google/protobuf/generated_message_reflection.cc proto/protobuf/google/protobuf/generated_message_table_driven.cc proto/protobuf/google/protobuf/generated_message_util.cc proto/protobuf/google/protobuf/io/coded_stream.cc proto/protobuf/google/protobuf/io/gzip_stream.cc proto/protobuf/google/protobuf/io/printer.cc proto/protobuf/google/protobuf/io/strtod.cc proto/protobuf/google/protobuf/io/tokenizer.cc proto/protobuf/google/protobuf/io/zero_copy_stream.cc proto/protobuf/google/protobuf/io/zero_copy_stream_impl.cc proto/protobuf/google/protobuf/io/zero_copy_stream_impl_lite.cc proto/protobuf/google/protobuf/map_field.cc proto/protobuf/google/protobuf/message.cc proto/protobuf/google/protobuf/message_lite.cc proto/protobuf/google/protobuf/reflection_ops.cc proto/protobuf/google/protobuf/repeated_field.cc proto/protobuf/google/protobuf/service.cc proto/protobuf/google/protobuf/source_context.pb.cc proto/protobuf/google/protobuf/struct.pb.cc proto/protobuf/google/protobuf/stubs/atomicops_internals_x86_gcc.cc proto/protobuf/google/protobuf/stubs/atomicops_internals_x86_msvc.cc proto/protobuf/google/protobuf/stubs/bytestream.cc proto/protobuf/google/protobuf/stubs/common.cc proto/protobuf/google/protobuf/stubs/int128.cc proto/protobuf/google/protobuf/stubs/mathlimits.cc proto/protobuf/google/protobuf/stubs/once.cc proto/protobuf/google/protobuf/stubs/status.cc proto/protobuf/google/protobuf/stubs/statusor.cc proto/protobuf/google/protobuf/stubs/stringpiece.cc proto/protobuf/google/protobuf/stubs/stringprintf.cc proto/protobuf/google/protobuf/stubs/structurally_valid.cc proto/protobuf/google/protobuf/stubs/strutil.cc proto/protobuf/google/protobuf/stubs/substitute.cc proto/protobuf/google/protobuf/stubs/time.cc proto/protobuf/google/protobuf/text_format.cc proto/protobuf/google/protobuf/timestamp.pb.cc proto/protobuf/google/protobuf/type.pb.cc proto/protobuf/google/protobuf/unknown_field_set.cc proto/protobuf/google/protobuf/util/delimited_message_util.cc proto/protobuf/google/protobuf/util/field_comparator.cc proto/protobuf/google/protobuf/util/field_mask_util.cc proto/protobuf/google/protobuf/util/internal/datapiece.cc proto/protobuf/google/protobuf/util/internal/default_value_objectwriter.cc proto/protobuf/google/protobuf/util/internal/error_listener.cc proto/protobuf/google/protobuf/util/internal/field_mask_utility.cc proto/protobuf/google/protobuf/util/internal/json_escaping.cc proto/protobuf/google/protobuf/util/internal/json_objectwriter.cc proto/protobuf/google/protobuf/util/internal/json_stream_parser.cc proto/protobuf/google/protobuf/util/internal/object_writer.cc proto/protobuf/google/protobuf/util/internal/protostream_objectsource.cc proto/protobuf/google/protobuf/util/internal/protostream_objectwriter.cc proto/protobuf/google/protobuf/util/internal/proto_writer.cc ``` -------------------------------- ### ZSTD_CCtx_setParametersUsingCCtxParams Source: https://github.com/tencent/mars/blob/master/mars/zstd/doc/zstd_manual.html Apply a set of ZSTD_CCtx_params to the compression context. This can be done even after compression is started, if nbWorkers==0, this will have no impact until a new compression is started. if nbWorkers>=1, new parameters will be picked up at next job, with a few restrictions (windowLog, pledgedSrcSize, nbWorkers, jobSize, and overlapLog are not updated). ```C size_t ZSTD_CCtx_setParametersUsingCCtxParams( ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params); ``` -------------------------------- ### FastCover Dictionary Builder Command-Line Arguments Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/experimental_dict_builders/fastCover/README.md Defines the available command-line arguments for configuring the FastCover Dictionary Builder, including input/output paths, dictionary ID, size limits, and training parameters. ```APIDOC Permitted Arguments: Input File/Directory (in=fileName): required: true description: file/directory used to build dictionary; if directory, will operate recursively for files inside directory; can include multiple files/directories, each following "in=" Output Dictionary (out=dictName): required: false default: fastCoverDict description: name of the output dictionary Dictionary ID (dictID=#): required: false type: nonnegative number default: 0 description: unique identifier for the dictionary Maximum Dictionary Size (maxdict=#): required: false type: positive number (bytes) default: 110KB description: maximum size of the dictionary in bytes Size of Selected Segment (k=#): required: false type: positive number (bytes) default: 200 description: size of the selected segment in bytes Size of Dmer (d=#): required: false type: 6 or 8 default: 8 description: size of Dmer Number of steps (steps=#): required: false type: positive number default: 32 description: number of optimization steps Percentage of samples used for training(split=#): required: false type: positive number default: 100 description: percentage of samples to use for training ``` -------------------------------- ### Install ZSTD Library Header Files with CMake Source: https://github.com/tencent/mars/blob/master/mars/zstd/build/cmake/lib/CMakeLists.txt This CMake command installs the public header files for the ZSTD library, including core, deprecated, dictionary builder, and error definition headers. All specified files are copied to the standard include directory defined by `CMAKE_INSTALL_INCLUDEDIR`. ```CMake install(FILES ${LIBRARY_DIR}/zstd.h ${LIBRARY_DIR}/deprecated/zbuff.h ${LIBRARY_DIR}/dictBuilder/zdict.h ${LIBRARY_DIR}/dictBuilder/cover.h ${LIBRARY_DIR}/common/zstd_errors.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ``` -------------------------------- ### General Usage for Building FastCover Dictionary Source: https://github.com/tencent/mars/blob/master/mars/zstd/contrib/experimental_dict_builders/fastCover/README.md Provides the general command structure for building a FastCover dictionary by passing arguments to the `make` command. Notes that the optimized version runs if 'k' or 'd' parameters are omitted. ```Shell make ARG="[arguments]" ```