Skip to content
Back to formatted view

Raw Message

Message-ID: <CAK7Q9bcu4jjTnj0aTP87byRQfn0kkcN9JaS2WA=6kEs4PJtuFg@mail.gmail.com>
Date: 2023-04-15T17:00:50Z
From: Debartha Paul
Subject: pcre2.h not found error while building R in windows

Hi. I am Debartha Paul, a Master's student in Statistics at Presidency
University, Kolkata, India. I was trying to build R from scratch using
RTools as described in https://contributor.r-project.org/rdevguide/ and
https://cran.r-project.org/bin/windows/base/howto-R-devel.html but when I
run `make all recommended`, I get an error message as follows:
```

grep.c:75:10: fatal error: pcre2.h: No such file or directory
   75 | # include<pcre2.h>
      |          ^~~~~~~~~
compilation terminated.
make[4]: *** [../gnuwin32/MkRules:155: grep.o] Error 1
make[3]: *** [Makefile:129: rlibs] Error 2
make[2]: *** [Makefile:194: ../../bin/x64/R.dll] Error 2
make[1]: *** [Makefile:114: rbuild] Error 2
make: *** [Makefile:17: all] Error 2

```
I ran `pacman -Q` inside my `MSYS2 MSYS` bash but discovered that `pcre2`
exists.
However, upon running `pacman -Q` from RTools bash, I found that it is not
being found, and only a subset of the original file list is available now. But
the surprising fact (to me at least) is that when I open my RTools folder,
where its installed, I did find the`pcre2` header file inside one of the
folders named `x86_x64-w64-mingw32.static.posix`. More surprisingly, none
of the header files, listed inside this folder, is being listed in `pacman
-Q`  when I run it from inside `RTools` bash. I dived deeper and found that
the folder that `pacman -Q` is returning from lies in `var`: another folder
inside RTools, separate from `x86_x64-w64-mingw32.static.posix`.

I brought this issue up in the recently concluded Office Hours of the
R-Contributors Slack, but unfortunately, I couldn't get any satisfactory
solution, nor a reason, on why this is happening.

I tried `pacman -Sy pcre2` from RTools bash, and the result was that I can
now see `pcre2` in the subset that I mentioned earlier, but still, the
problem persists. Needless to say that I even updated both my MSYS bash
packages and RTools bash packages using `pacman -Syuu` from both.

Finally, I was using `rtools43-5493-5475.exe` and fearing that it might be
the cause, I uninstalled and installed the latest
version(`rtools43-5550-5548.exe`), but it didn't do anything to improve my
output.

At this point, I am confused as to why this is happening, and I would be
glad if anyone guides me towards a solution to this problem. I am using a
Windows 11 machine and would be happy to give further information if the
need arises.

With thanks and regards
Debartha Paul
Masters Student (1st Year)

Department of Statistics
Presidency University
Kolkata

	[[alternative HTML version deleted]]