[R-SIG-Mac] Compiling Cairo package

Erich Neuwirth er|ch@neuw|rth @end|ng |rom un|v|e@@c@@t
Wed Dec 29 01:03:06 CET 2021


MacOS 11.6.2 (iMac Late 2014, Intel)
XQuartz 2.8.1 (xorg-server 1.20.11)
R 4.1.2

cd /opt/X11
❯ ls
bin     etc     include lib     libexec share   var

Just setting
Sys.setenv(C_INCLUDE_PATH="/opt/X11/include")

is sufficient, then package Cairo compiles


Also just setting
Sys.setenv(PKG_CONFIG_PATH="/opt/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig")
works

I got the same results on
MacOS 12.1 (MacBookPro 2021, M1)
everything else as on the Intel machine


> On 29.12.2021, at 00:17, Simon Urbanek <simon.urbanek using R-project.org> wrote:
> 
> Erich,
> 
> can you, please, send me the full output and the exact setup you used? I suspect you may be using XQuartz 2.8.0 or higher which has broken pkg-config files - latest XQuartz requires a patch to make any compilation against it work (see https://github.com/R-macos/recipes/blob/master/other/tcltk/pkgconfig.patch for what we do to compile Tk).
> 
> From what I can see the only line that has actually any effect at all is
> 
> Sys.setenv(C_INCLUDE_PATH="/opt/X11/include")
> 
> so all the others are likely not needed, but I'm not sure of your setup so can't test.
> 
> Cheers,
> Simon
> 
> 
> 
>> On Dec 27, 2021, at 4:00 AM, Erich Neuwirth <erich.neuwirth using univie.ac.at> wrote:
>> 
>> Duncan’s suggestion did not work
>> So I tried
>> 
>> Sys.setenv(LD_LIBRARY_PATH="/opt/X11:/opt/X11/lib")
>> system("export LD_LIBRARY_PATH")
>> Sys.setenv(C_INCLUDE_PATH="/opt/X11/include")
>> system("export C_INCLUDE_PATH")
>> Sys.getenv()
>> 
>> and then simply doing
>> 
>> install.packages(“Cairo”)
>> worked.
>> 
>> 
>>> On 26.12.2021, at 12:36, Duncan Murdoch <murdoch.duncan using gmail.com> wrote:
>>> 
>>> On 26/12/2021 6:04 a.m., Erich Neuwirth wrote:
>>>> I am trying to compile Cairo.
>>>> I get the following error
>>>> xlib-backend.c:34:10: fatal error: 'X11/Intrinsic.h' file not found
>>>> #include <X11/Intrinsic.h>      /*->    Xlib.h  Xutil.h Xresource.h .. */
>>>> I have X11/Intrinsic.h in /opt/X11/include
>>>> I tried
>>>> Sys.setenv(LD_LIBRARY_PATH="/opt/X11:/opt/X11/lib")
>>>> Sys.getenv("LD_LIBRARY_PATH")
>>>> system("export LD_LIBRARY_PATH”)
>>>> and compiled again, but I get the same error.
>>>> What do I need to do so Intrinsic.h is found by the compiler?
>>> 
>>> Usually the location of include files is set at configure time.  For R, I use
>>> 
>>> ../R-devel-src/configure --with-x --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib
>>> 
>>> It's not clear to me whether Cairo is the R package or an external library, but if it's the R package, you might try
>>> 
>>> install.packages("Cairo", type = "source", configure.args = "--x-includes=/opt/X11/include --x-libraries=/opt/X11/lib")
>>> 
>>> Duncan Murdoch
>>> 
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac using r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>> 
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac using r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 699 bytes
Desc: Message signed with OpenPGP
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20211229/849ee932/attachment.sig>


More information about the R-SIG-Mac mailing list