madler / pigz

A parallel implementation of gzip for modern multi-processor, multi-core machines.
http://zlib.net/pigz/
2.65k stars 176 forks source link

Installation fails with zlib >=1.2.6 #15

Closed smtalk closed 10 years ago

smtalk commented 10 years ago

[root@testing pigz-2.3.1]# make CPPFLAGS="-l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/" cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o pigz.o pigz.c pigz.c: In function ‘compress_thread’: pigz.c:1426: warning: ‘temp’ may be used uninitialized in this function cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o yarn.o yarn.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/deflate.o zopfli/deflate.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/blocksplitter.o zopfli/blocksplitter.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/tree.o zopfli/tree.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/lz77.o zopfli/lz77.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/cache.o zopfli/cache.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/hash.o zopfli/hash.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/util.o zopfli/util.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/squeeze.o zopfli/squeeze.c cc -O3 -Wall -Wextra -l/usr/local/zlib-128/lib/ -I/usr/local/zlib-128/include/ -c -o zopfli/katajainen.o zopfli/katajainen.c cc -o pigz pigz.o yarn.o zopfli/deflate.o zopfli/blocksplitter.o zopfli/tree.o zopfli/lz77.o zopfli/cache.o zopfli/hash.o zopfli/util.o zopfli/squeeze.o zopfli/katajainen.o -lpthread -lz -lm pigz.o: In function compress_thread': pigz.c:(.text+0x3f28): undefined reference todeflatePending' pigz.c:(.text+0x42b7): undefined reference to deflatePending' pigz.o: In functionsingle_compress': pigz.c:(.text+0x6b60): undefined reference to deflatePending' pigz.c:(.text+0x6b95): undefined reference todeflatePending' collect2: ld returned 1 exit status make: *\ [pigz] Error 1

It has no problems with zlib 1.2.3: [root@testing pigz-2.3.1]# make CPPFLAGS="-l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/" cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o pigz.o pigz.c pigz.c: In function ‘compress_thread’: pigz.c:1426: warning: ‘temp’ may be used uninitialized in this function cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o yarn.o yarn.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/deflate.o zopfli/deflate.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/blocksplitter.o zopfli/blocksplitter.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/tree.o zopfli/tree.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/lz77.o zopfli/lz77.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/cache.o zopfli/cache.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/hash.o zopfli/hash.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/util.o zopfli/util.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/squeeze.o zopfli/squeeze.c cc -O3 -Wall -Wextra -l/usr/local/zlib-123/lib/ -I/usr/local/zlib-123/include/ -c -o zopfli/katajainen.o zopfli/katajainen.c cc -o pigz pigz.o yarn.o zopfli/deflate.o zopfli/blocksplitter.o zopfli/tree.o zopfli/lz77.o zopfli/cache.o zopfli/hash.o zopfli/util.o zopfli/squeeze.o zopfli/katajainen.o -lpthread -lz -lm ln -f pigz unpigz

madler commented 10 years ago

It does work with later versions, including 1.2.8. (I am also the zlib author.) You must be mixing the zlib 1.2.8 header files with a zlib 1.2.3 shared or static library (or less than 1.2.6). Check carefully what exactly you're linking to.

smtalk commented 10 years ago

Yes, you was right :) I linked zlib library statically (I needed to edit the Makefile for that, changed -lz to /usr/local/zlib127/lib/libz.a) and it worked with no problems when doing "make CFLAGS="-I/usr/local/zlib127/include/"". This way zlib could be compiled from the source without replacing OS libraries or putting it into ld.so.conf, so we're able to use latest version of pigz with less blocks overhead than in zlib 1.2.3. Thank you for the answer and great product!