[R-SIG-Mac] any advice on libtiff? (and rtiff)

Simon Urbanek simon.urbanek at r-project.org
Thu Apr 29 18:19:38 CEST 2010

On Apr 28, 2010, at 6:25 PM, Carl Witthoft wrote:

> Hi, I know rtiff does not compile 'cause it can't find libtiff (per cran check logs).

Unfortunately rtiff forces wrong flags (that it checks with the wrong compilers and flags) and it allows no way around it so the best way forward would be if Eric could address this (details below).

The correct flags for the static build are PKG_LIBS="-ltiff -ljpeg -lz" because libtiff relies on JPEG and libz, but rtiff does not allow that.

I'm CCing Eric in the hope that this can be addressed in the package:

First, configure will check with CPPFLAGS, CFLAGS, LIBS etc. yet those all are ignored since there is
which is wrong - that's not what configure actually checked at all. AC_CHECK_LIB modifies LIBS to reflect the correct flags so it should be at the very least

Second, the R compiler settings are ignored so the checks are actually run with the wrong compiler (this is crucial because let's say if you compile for R_ARCH=/x86_64 then the checks will be run with the default architecture of the compiler such as i386 which is completely different).

Also to make it more R friendly it is a good idea to initialize LIBS="$PKG_LIBS" so that the commonly used PKG_LIBS are respected (this is optional). So the configure.in could look something like

AC_INIT([rtiff], [1.1], [eric.kort at vai.org])

if test -z "${R_HOME}"; then
  echo "could not determine R_HOME"
  exit 1
CC=`"${RBIN}" CMD config CC`;

# Checks for programs.

# Checks for libtiff.
AC_CHECK_LIB([tiff], [TIFFOpen], [], [
                echo Error: Could not find libtiff.
                exit -1




> I'm just wondering if anyone has successfully installed libtiff, either from source or via MacPorts?  And if so,  is it then possible to build rtiff from the source and have everything work?
> So far I've (naively) tried building libtiff3.9.2 from sources, but even though "make" seems to happily complete its job,  nothing seems to be installed anywhere useful.
> Or should I just bite the bullet and install the Gtk tiff tools and that big graphics package (something-BE, I forget the name just now)?
> thanks
> Carl
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list