[Rd] PCRE, and setting C-, LD- and CPP-FLAGS for a local r-devel installation

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Apr 9 12:36:20 CEST 2015

On 08/04/2015 17:51, Jesper Gådin wrote:
> Hello,
> Got some at the time surprising errors some days ago when building a local
> r-devel installation on a cluster, with apparent outdated or missing dev
> versions of some files. After reading the r-devel news (
> https://developer.r-project.org/blosxom.cgi/R-devel/NEWS), it turned out
> that " Use of the included versions of ‘zlib’, ‘bzlib’, ‘xz’ and PCRE is
> deprecated: these are frozen and will eventually be removed. ", and so I

Actually, the NEWS item is

     • The included versions of zlib, bzip2, xz and PCRE have been
       removed, so system versions are required (see the ‘R Installation
       and Administration’ manual).

At this stage you could have as well tried to install R 3.2.0RC ... 
R-devel has not yet diverged much.

> should have expected these errors.

The failure is

 > checking if PCRE version >= 8.10, < 10.0 and has UTF-8 support... no

Look in config.log to be sure (nothing is easy without that), but it 
looks like the problem is the last condition.  For 8.36 --enable-utf8 is 
a synonym for the preferred --enable-utf and so should have worked.

> Without being admin, I cannot system wide install or update the software
> needed to get the correct headers and libs. So I have to specify all flags
> myself. It went well with zlib, bzlib and xz, but not for pcre, which just
> does not want to work for me.
> My latest ./configure flag creation looks like this:
> #bzip2,zlib and xz
> bzip2_LD="/gulo/glob/jesper/software/bzip2-1.0.6"
> bzip2_CF="/gulo/glob/jesper/software/bzip2-1.0.6"
> zlib_LD="/gulo/glob/jesper/software/zlib-1.2.8"
> zlib_CF="/gulo/glob/jesper/software/zlib-1.2.8"
> xz_CF="/usr/include"
> xz_LD="/home/jesper/glob/software/xz/build/lib"
> pcre="pcre-8.36"
> pcre_CF1="/home/jesper/glob/software/$pcre/build/include"
> pcre_CF2="/home/jesper/glob/software/$pcre/sljit"
> pcre_CF3="/home/jesper/glob/software/$pcre"
> pcre_CF4="/usr/include"
> #The pcre was built like this:
> ./../configure --prefix=/home/jesper/glob/software/pcre-8.36/build
> --enable-utf8 --enable-unicode-properties
> make CPPFLAGS=-I/usr/include
> make install
> #step into the correct folder and then run ./configure
> cd /home/jesper/glob/software/2015-04-08-r-devel/build
> srcdir=".."
> $srcdir/configure \
>      LDFLAGS="-L$bzip2_LD -L$zlib_LD -L$xz_LD -L$pcre_LD"\
>      CFLAGS="-I$bzip2_CF -I$zlib_CF -I$xz_CF" \
>      CPPFLAGS="-I$pcre_CF1 -I$pcre_CF2 -I$pcre_CF3 -I$pcre_CF4"
> #the last rows of the ouput are
> checking for pcre_fullinfo in -lpcre... yes
> checking pcre.h usability... yes
> checking pcre.h presence... yes
> checking for pcre.h... yes
> checking pcre/pcre.h usability... no
> checking pcre/pcre.h presence... no
> checking for pcre/pcre.h... no
> checking if PCRE version >= 8.10, < 10.0 and has UTF-8 support... no
> checking whether PCRE support suffices... configure: error: pcre library
> and headers are required
> Hopefully, this is an easy question you. Have spent quite some time
> understanding the meaning of the flags and installing software-dependencies
> like a maniac. It has been very educative, but am now very much looking
> forward to your answers.
> /Jesper

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK

More information about the R-devel mailing list