新闻详情

新闻详情

首页 / 资讯中心 / 详情

编译测试pixz压缩工具

发布时间:2026/9/28 19:34:57来源:尧图网络
编译测试pixz压缩工具
pixz是一个并行xz压缩工具它支持并行压缩和解压。从存储库 https://github.com/vasi/pixz 下载源代码解压缩到/par/pixz-1.0.7。configure提示缺少libarchive包。root6ae32a5ffcde:/par/pixz-1.0.7# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports the include directive... yes (GNU style) checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for gcc option to accept ISO C99... none needed checking for gcc option to accept ISO Standard C... (cached) none needed checking for src/pixz.1... yes checking for ceil in -lm... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking if compiler needs -Werror to reject unknown flags... no checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBARCHIVE... no configure: error: Package requirements (libarchive) were not met: Package libarchive, required by virtual:world, not found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBARCHIVE_CFLAGS and LIBARCHIVE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.希望不用apt安装libarchive而从源代码编译。从https://libarchive.org/downloads/下载源代码解压缩到/par/libarchive-3.8.9。使用cmake .和make -j8命令编译libarchive库编译好的库文件和源代码都在par/libarchive-3.8.9/libarchive目录下。按照错误提示在configure命令行中添加LIBARCHIVE_CFLAGS和LIBARCHIVE_LIBS环境变量root6ae32a5ffcde:/par/pixz-1.0.7# ./configure LIBARCHIVE_CFLAGS/par/libarchive-3.8.9/libarchive LIBARCHIVE_LIBS/par/libarchive-3.8.9/libarchive ... config.status: creating Makefile config.status: creating src/Makefile config.status: creating test/Makefile config.status: creating config.h config.status: executing depfiles commands root6ae32a5ffcde:/par/pixz-1.0.7# make -j8 make all-recursive make[1]: Entering directory /par/pixz-1.0.7 Making all in src make[2]: Entering directory /par/pixz-1.0.7/src gcc -DHAVE_CONFIG_H -I. -I.. /par/libarchive-3.8.9/libarchive -Wall -Wno-unknown-pragmas -g -O2 -MT pixz-common.o -MD -MP -MF .deps/pixz-common.Tpo -c -o pixz-common.o test -f common.c || echo ./common.c ... gcc: warning: /par/libarchive-3.8.9/libarchive: linker input file unused because linking not done mv -f .deps/pixz-common.Tpo .deps/pixz-common.Po gcc -Wall -Wno-unknown-pragmas -g -O2 -o pixz pixz-common.o pixz-cpu.o pixz-endian.o pixz-list.o pixz-pixz.o pixz-read.o pixz-write.o -lm /par/libarchive-3.8.9/libarchive -llzma -lm /usr/bin/ld: cannot find /par/libarchive-3.8.9/libarchive: file format not recognized collect2: error: ld returned 1 exit status make[2]: *** [Makefile:412: pixz] Error 1 make[2]: Leaving directory /par/pixz-1.0.7/src make[1]: *** [Makefile:377: all-recursive] Error 1 make[1]: Leaving directory /par/pixz-1.0.7 make: *** [Makefile:318: all] Error 2生成makefile成功编译出错因为LIBARCHIVE_LIBS需要是动态库文件名而不是搜索目录, 如果写成静态链接库名称则报错如下root6ae32a5ffcde:/par/pixz-1.0.7# ./configure LIBARCHIVE_CFLAGS/par/libarchive-3.8.9/libarchive LIBARCHIVE_LIBS/par/libarchive-3.8.9/libarchive/libarchive.a root6ae32a5ffcde:/par/pixz-1.0.7# make -j8 make all-recursive make[1]: Entering directory /par/pixz-1.0.7 Making all in src make[2]: Entering directory /par/pixz-1.0.7/src gcc -Wall -Wno-unknown-pragmas -g -O2 -o pixz pixz-common.o pixz-cpu.o pixz-endian.o pixz-list.o pixz-pixz.o pixz-read.o pixz-write.o -lm /par/libarchive-3.8.9/libarchive/libarchive.a -llzma -lm /usr/bin/ld: /par/libarchive-3.8.9/libarchive/libarchive.a(archive_string.c.o): in function get_sconv_object: archive_string.c:(.text.get_sconv_object0x279): undefined reference to libiconv_open /usr/bin/ld: archive_string.c:(.text.get_sconv_object0x2cb): undefined reference to libiconv_open /usr/bin/ld: archive_string.c:(.text.get_sconv_object0x3e5): undefined reference to libiconv_close ... collect2: error: ld returned 1 exit status make[2]: *** [Makefile:412: pixz] Error 1 make[2]: Leaving directory /par/pixz-1.0.7/src make[1]: *** [Makefile:377: all-recursive] Error 1 make[1]: Leaving directory /par/pixz-1.0.7 make: *** [Makefile:318: all] Error 2LIBARCHIVE_LIBS改成动态库文件名就可以了。root6ae32a5ffcde:/par/pixz-1.0.7# ./configure LIBARCHIVE_CFLAGS/par/libarchive-3.8.9/libarchive LIBARCHIVE_LIBS/par/libarchive-3.8.9/libarchive/libarchive.so ... config.status: creating Makefile config.status: creating src/Makefile config.status: creating test/Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands root6ae32a5ffcde:/par/pixz-1.0.7# make -j8 make all-recursive make[1]: Entering directory /par/pixz-1.0.7 Making all in src make[2]: Entering directory /par/pixz-1.0.7/src gcc -Wall -Wno-unknown-pragmas -g -O2 -o pixz pixz-common.o pixz-cpu.o pixz-endian.o pixz-list.o pixz-pixz.o pixz-read.o pixz-write.o -lm /par/libarchive-3.8.9/libarchive/libarchive.so -llzma -lm make[2]: Leaving directory /par/pixz-1.0.7/src Making all in test make[2]: Entering directory /par/pixz-1.0.7/test make[2]: Nothing to be done for all. make[2]: Leaving directory /par/pixz-1.0.7/test make[2]: Entering directory /par/pixz-1.0.7 make[2]: Leaving directory /par/pixz-1.0.7 make[1]: Leaving directory /par/pixz-1.0.7编好的二进制文件在pixz-1.0.7/src目录下。root6ae32a5ffcde:/par/pixz-1.0.7# src/pixz Refusing to output to a TTY pixz: Parallel Indexing XZ compression, fully compatible with XZ Basic usage: pixz input output.pxz # Compress a file in parallel pixz -d input.pxz output # Decompress Tarballs: pixz input.tar output.tpxz # Compress and index a tarball pixz -d input.tpxz output.tar # Decompress pixz -l input.tpxz # List tarball contents very fast pixz -x path/to/file input.tpxz | tar x # Extract one file very fast tar -Ipixz -cf output.tpxz dir # Make tar use pixz automatically Input and output: pixz input output.pxz # Same as pixz input output.pxz pixz -i input -o output.pxz # Ditto pixz [-d] input # Automatically choose output filename Other flags: -0, -1 ... -9 Set compression level, from fastest to strongest -p NUM Use a maximum of NUM CPU-intensive threads -t Dont assume input is in tar format -k Keep original input (do not remove it) -c ignored -h Print this help pixz 1.0.7 (C) 2009-2012 Dave Vasilevsky davevasilevsky.ca https://github.com/vasi/pixz You may use this software under the FreeBSD License用它来测试压缩和解压。并和xz命令对比。root6ae32a5ffcde:/par/pixz-1.0.7# cd .. root6ae32a5ffcde:/par# pixz-1.0.7/src/pixz 1y.csv 1y.pxz root6ae32a5ffcde:/par# pixz-1.0.7/src/pixz -l 1y.pxz 268837 / 16777216 159479 / 16777216 ... 265727 / 16777216 519429 / 16777216 146829 / 16473668 root6ae32a5ffcde:/par# root6ae32a5ffcde:/par# time xz -1 1y.csv -k -f real 0m25.174s user 0m12.151s sys 0m1.057s root6ae32a5ffcde:/par# time pixz-1.0.7/src/pixz -1 1y.csv 1y1.pxz real 0m26.298s user 0m12.014s sys 0m2.234s root6ae32a5ffcde:/par# ls -l 1y* -rwxrwxrwx 1 root root 888888900 Sep 20 04:13 1y.csv -rwxrwxrwx 1 root root 400017165 Sep 20 04:13 1y.csv.lz4 -rwxrwxrwx 1 root root 22061280 Sep 20 04:13 1y.csv.xz --------- -rwxrwxrwx 1 root root 18418873 Sep 24 09:38 1y.kanzi -rwxrwxrwx 1 root root 400331957 Sep 20 09:16 1y.parquet -rwxrwxrwx 1 root root 15995932 Sep 26 10:21 1y.pxz -------默认级别 -rwxrwxrwx 1 root root 22042116 Sep 26 10:35 1y1.pxz --------级别1 最快 -rwxrwxrwx 1 root root 101690581 Sep 20 09:16 1yzst.parquet root6ae32a5ffcde:/par# root6ae32a5ffcde:/par# time pixz-1.0.7/src/pixz -d 1y1.pxz 1y1.csv real 0m3.822s user 0m2.377s sys 0m0.297s root6ae32a5ffcde:/par# time xz -d 1y.csv.xz -f real 0m15.329s user 0m2.596s sys 0m0.987s同样的压缩级别压缩时间和压缩率和xz一样解压快了好几倍。
网站建设高端定制企业官网
RELATED

相关资讯

更多精彩内容,欢迎继续阅读

较早相关资讯

最新相关资讯

多模型统一调度平台:API接入、词元计量与预算管控实战 2026/9/28 22:45:42

多模型统一调度平台:API接入、词元计量与预算管控实战

1. 从一张失控的账单说起:多模型接入到底难在哪去年下半年,我帮一家做智能客服的团队做技术复盘,他们当时的状态很有代表性:产品里同时接了四家不同厂商的大模型,分别负责意图识别、知识问答、话术润色和情绪判断。听起…

阅读更多 →
Genkit 代理 API 实战:TypeScript 多回合 AI 代理开发指南 2026/9/28 22:45:42

Genkit 代理 API 实战:TypeScript 多回合 AI 代理开发指南

多回合代理这件事,真正上手做过的人都知道,难点从来不在"让模型回一句话",而在于让它在多轮交互里记住上下文、按需调用工具、把中间状态存下来,还要在下一轮里接着用。Genkit 的代理 API 就是冲着这个场景来的&#xf…

阅读更多 →
superpowers实战:一条命令封装开发流程,让重复工作自动化 2026/9/28 22:45:35

superpowers实战:一条命令封装开发流程,让重复工作自动化

1. 项目概述与设计思路1.1 superpowers 到底是什么最近在 GitHub 上翻到一个叫 superpowers 的开源项目,被它的理念戳中了——把你日常开发里那些重复、琐碎、容易出错的步骤,全部封装成可用命令,相当于给终端装了“放大器”。它不是又一套语…

阅读更多 →
Flutter鸿蒙化适配:flavors_chef多环境配置实战指南 2026/9/28 22:45:29

Flutter鸿蒙化适配:flavors_chef多环境配置实战指南

先说结论:Flutter 项目做鸿蒙化适配,UI 层的坑其实不算多,真正让人反复折腾的是环境配置这件事。开发环境、测试环境、生产环境的 API 地址、应用标识、密钥全都不一致,Flutter 生态里 flavors_chef 是处理这类多环境配置比较顺手…

阅读更多 →
Kubernetes镜像预热全解析:从节点初始化到P2P分发 2026/9/28 22:45:29

Kubernetes镜像预热全解析:从节点初始化到P2P分发

我最近帮一个团队优化大规模任务调度,遇见一个特别扎眼的现象:上百个节点同时扩容,业务 Pod 全卡在ContainerCreating,排到 kubelet 一看日志,清一色在拉镜像。Kubernetes 节点提前拉取 / 预热镜像这个话题&#xff0c…

阅读更多 →
模型优化实战指南:从训练加速到推理部署的完整技术链路 2026/9/28 22:45:29

模型优化实战指南:从训练加速到推理部署的完整技术链路

1. 模型优化到底在优化什么:先搞清楚瓶颈再动手很多人一听到 Model-Optimizer 这个名字,下意识会以为又是一个调参工具、一个像 PyTorch 的torch.optim那样的优化器集合。其实这类项目解决的问题远不止“选一个优化器”这么简单。它面向的是一个更现实的…

阅读更多 →

今日资讯

本周资讯

本月资讯

看完文章仍有疑问?

联系尧图顾问,获取一对一建站咨询

立即免费咨询 📞 400-888-8888
📞 ✉