Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
data compression with PAQ
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
tuam
l33t
l33t


Joined: 04 May 2004
Posts: 765
Location: CGN, Germany

PostPosted: Sun Apr 27, 2008 2:44 pm    Post subject: data compression with PAQ Reply with quote

Hi all,

PAQ is a compression program "that achieves very high compression rates at the expense of speed and memory."
http://cs.fit.edu/~mmahoney/compression/

It is really slow - my Core 2 Duo takes ~24 hours for compressing just 1GB (single-threaded), decompressing takes the same time
But it wins compression competitions (e.g. http://www.maximumcompression.com/data/summary_mf.php )

Usage
"paq8o9 file" for compressing (or add -7 to allow 1 GB of memory)
"paq8o9 -d file.paq8o9" for decompressing

You can download a tarball with the ebuild from http://www.daniel-peters.info/files/paq.tar.bz2

FF,

Daniel

Code:
# cat paq-8o_p9.ebuild
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit toolchain-funcs eutils

MY_PV="paq8o9"
DESCRIPTION="PAQ is a series of archivers that achieve very high compression rates at the expense of speed and memory."
HOMEPAGE="http://cs.fit.edu/~mmahoney/compression/"
SRC_URI="http://cs.fit.edu/~mmahoney/compression/${MY_PV}.zip"
RESTRICT="mirror"

LICENSE="GPL-2"
SLOT="8o9"
KEYWORDS="~arm ~x86 ~amd64"
IUSE="sse"

DEPEND="app-arch/unzip
        x86? ( dev-lang/yasm )
        amd64? ( dev-lang/yasm )"
RDEPEND=""

src_unpack() {
        unpack ${A}
        cd ${WORKDIR}
        epatch "${FILESDIR}/${MY_PV}-nopause.patch"
        epatch "${FILESDIR}/${MY_PV}-fix-stack.patch"
}

src_compile() {
        if use x86 ; then
                objectfile="paq7asm.o"
                use sse && sse="sse"
                yasm -f elf32 -o $objectfile paq7asm${sse}.asm || die "asm failed"
        elif use amd64 ; then
                objectfile="paq7asm.o"
                yasm -f elf64 -o $objectfile paq7asm-x86_64.asm || die "asm failed"
        else
                CXXFLAGS="-DNOASM ${CXXFLAGS}"
        fi
        $(tc-getCXX) ${MY_PV}.cpp -DUNIX $CXXFLAGS $objectfile -o ${MY_PV} || die "compile failed"
}

src_install() {
        dobin ${MY_PV}
}

pkg_postinst() {
        if has_version "<${CATEGORY}/${P}" ; then
                ewarn "Please note that archives created with older versions of PAQ"
                ewarn "require that exact version to be extracted."
                ewarn "I repeat: Do not remove older versions if you have created"
                ewarn "archives with them."
        fi
}

# cat files/paq8o9-nopause.patch
--- paq8o9.cpp.orig     2008-04-27 15:32:49.000000000 +0200
+++ paq8o9.cpp  2008-04-27 15:42:10.000000000 +0200
@@ -4250,6 +4250,7 @@
   catch(const char* s) {
     if (s) printf("%s\n", s);
   }
+  pause=false;
   if (pause) {
     printf("\nClose this window or press ENTER to continue...\n");
     getchar();

# cat files/paq8o9-fix-stack.patch
diff -urN work.orig/paq7asm.asm work/paq7asm.asm
--- work.orig/paq7asm.asm       2008-04-27 15:55:04.000000000 +0200
+++ work/paq7asm.asm    2008-04-27 15:54:27.000000000 +0200
@@ -136,4 +136,6 @@
   ja .loop
 .done:
   emms
-  ret
\ No newline at end of file
+  ret
+
+section .note.GNU-stack noalloc noexec nowrite progbits
diff -urN work.orig/paq7asmsse.asm work/paq7asmsse.asm
--- work.orig/paq7asmsse.asm    2008-04-27 15:55:04.000000000 +0200
+++ work/paq7asmsse.asm 2008-04-27 15:54:23.000000000 +0200
@@ -88,4 +88,6 @@
   ret

 align 16
-_mask  dd      10001h,10001h,10001h,10001h ; 8 copies of 1 in xmm1
\ No newline at end of file
+_mask  dd      10001h,10001h,10001h,10001h ; 8 copies of 1 in xmm1
+
+section .note.GNU-stack noalloc noexec nowrite progbits
diff -urN work.orig/paq7asm-x86_64.asm work/paq7asm-x86_64.asm
--- work.orig/paq7asm-x86_64.asm        2008-04-27 15:55:04.000000000 +0200
+++ work/paq7asm-x86_64.asm     2008-04-27 15:54:47.000000000 +0200
@@ -98,4 +98,6 @@
     sub rcx, 8
     ja .loop
 .done:
-    ret
\ No newline at end of file
+    ret
+
+section .note.GNU-stack noalloc noexec nowrite progbits

_________________
Logic clearly dictates that the needs of the many outweigh the needs of the few. - Spock
The needs of the one outweigh the needs of the many. - Kirk
I refuse to let arithmetic decide questions like that. - Picard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum