6

I am trying to do a build and local install of R 4.0.4 on Red Hat Linux 6.8. There were several unmet dependencies which I resolved by doing local installations (following the procedure in this). However, I couldn't resolve the issue of pcre2 with that procedure. This is the configure command I run:

./configure --with-pcre2 --prefix=$HOME/bin/R-4.0.4 --enable-R-shlib LDFLAGS="-L/$HOME/local/zlib-1.2.11/lib -L/$HOME/local/bzip2-1.0.8/lib -L/$HOME/local/xz-5.2.5/lib -L/$HOME/local/pcre2-10.00/lib" CPPFLAGS="-I/$HOME/local/zlib-1.2.11/include"

This is the error I get:

checking whether PCRE support suffices... no
configure: error: PCRE2 library and headers are required, or use --with-pcre1 and PCRE >= 8.32 with UTF-8 support

I also tried configure with a local installation of pcre-8.44 and --with-pcre1 flag but I get the same error.

What should I do so that the configure script detects the pcre2 local installation?

AdminBee
  • 22,803

5 Answers5

5

I solved my problem like this:

  1. wget https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.gz
  2. tar -zxvf pcre2-10.42.tar.gz
  3. cd pcre2-10.42
  4. ./configure
  5. make -j 24
  6. sudo make install

I am using Ubuntu 20.04 and R version 4.1.0

2

Try

sudo apt install libpcre2-posix2 libpcre2-dev

1

I had this problem and the solution turned out to be that R's ./configure needed the pcre2-config program to be in my PATH. So, this should solve it:

PATH="${PATH}:/$HOME/local/pcre2-10.00/bin" ./configure --with-pcre2 --prefix=$HOME/bin/R-4.0.4 --enable-R-shlib LDFLAGS="-L/$HOME/local/zlib-1.2.11/lib -L/$HOME/local/bzip2-1.0.8/lib -L/$HOME/local/xz-5.2.5/lib -L/$HOME/local/pcre2-10.00/lib" CPPFLAGS="-I/$HOME/local/zlib-1.2.11/include"
seanmk
  • 111
1

I installed R version 4.1.0 and solved this problem using:

./configure --prefix=/usr/lusers/mingy16/R-4.1.0 --with-pcre1

Akira Y
  • 11
0

I had the same issue and resolved it by installing the "pcre2-devel" package. I had pcre and pcre-devel packages, which worked for R 3.x as well as the pcre2 package, but the required "pcre2-devel" wasn't installed by default.

  • 1
    Thanks, can you please tell me how to install the pcre2-devel package? I couldn't find any source for that. Is it included in pcre2 source? – Dronacharya Mar 06 '21 at 05:35
  • I only had to run "yum install pcre2-devel" but it's present in the "rhel-7-server-optional-rpms" repository on my machine. I'm not sure what the repository for RHEL 6.8 is but you could review the repositories in /etc/yum.repos.d/redhat.repo and set "enabled=true" for the optional RPMS repository.

    You may want to shoot in the dark and try "yum install --enable-repo=rhel-6-server-optional-rpms pcre2-devel"

    – Teague Sterling Mar 08 '21 at 17:08
  • The only problem is I don't have sudo permissions. That's why I was doing local installs of the dependencies. Do you have any other suggestions? – Dronacharya Mar 10 '21 at 06:40