[R] Configuration: libpng needs zlib, but ...

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Nov 18 22:43:05 CET 2001


Despite your claim, libz *is* looked for before the png call, for example

configure:13761: checking for main in -lz
configure:13794: checking for png.h
configure:13822: checking if libpng version >= 1.0.5
configure:13839: checking for png_create_write_struct in -lpng

in R-devel.

The bit of code you quote is inside

  AC_CHECK_LIB(z, main, [

in R_BITMAP.

Looks like LIBS gets reset in the course of that nested construct,
and I'll leave deciphering that to the expert.


On Sun, 18 Nov 2001, Thomas Hoffmann wrote:

> I noticed that congigure reported libpng as "not found" although a
> recent version exists.
>
> Further looking into this issue told me, that the test failed because
> the test
> from R.m4
>
>         AC_CHECK_LIB(png, png_create_write_struct, [
>           BITMAP_LIBS="${BITMAP_LIBS} -lpng -lz"
>           AC_DEFINE(HAVE_PNG)
>         ], , ${LIBS})
>       ], AC_MSG_RESULT([no]))
>     ])
>
> did fail:
>
> gcc.exe -o conftest.exe -g -m486 -Zmt -Ig:/include -I/xfree86/include
> -Zmt -Zcrtdll -Zsysv-signals conftest.c -lpng -lsocket -lreadline -ldl
> -lncurses -lm -lcExt
> g:\lib/png.a(pngwrite.o): Undefined symbol _deflateEnd referenced from
> text segment
> g:\lib/png.a(pngwrite.o): Undefined symbol _deflate referenced from text
> segment
> g:\lib/png.a(png.o): Undefined symbol _inflateReset referenced from text
> segment
> g:\lib/png.a(png.o): Undefined symbol _crc32 referenced from text
> segment
> g:\lib/png.a(png.o): Undefined symbol _crc32 referenced from text
> segment
> ......
>
> This is because zlib is not included in the command line (-lz). And this
> has to do
> with the order of calls in configure in: libz is looked for AFTER the
> bitmap libs, so it
> is not in $(LIBS) yet:
>
> ......
> ## Bitmap headers and libraries.
> R_BITMAPS
>
> ## XDR headers and library routines.
> R_XDR
>
> ## zlib headers and libraries.
> R_ZLIB
>
> ## POSIX times.
> R_USES_LEAPSECONDS
> ......
>
> I think either the order in configure.in should be changed or in R.m4
> the zlib
> should be included into the OTHER-LIBRARIES branch of the macro.
>
> --
> Thomas Hoffmann                                    Telephone:
> 49-351-4598831
> thoffman at zappa.sax.de                                       Dresden,
> Germany
>
> ..sig under construction ...
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list