s-u / Cairo

R graphics device using cairo graphics library for creating high-quality output
12 stars 10 forks source link

Updating issue, OS X Monterey(amd64) #30

Closed akhst7 closed 2 years ago

akhst7 commented 2 years ago

Hi, Updating to 1.5-14 from the source failed with a 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 guess thexlib-backend.c can't locate /opt/X11/include/X11/Intrinsic.h, although I set up the path in the env as follows;

XCFLAGS=-I/opt/X11/include/X11
XLIBS=-L/opt/X11/lib

Are there any other ways to specific the path to intrinsic.h ?

> R.version
               _                           
platform       x86_64-apple-darwin17.0     
arch           x86_64                      
os             darwin17.0                  
system         x86_64, darwin17.0          
status                                     
major          4                           
minor          1.2                         
year           2021                        
month          11                          
day            01                          
svn rev        81115                       
language       R                           
version.string R version 4.1.2 (2021-11-01)
nickname       Bird Hippie          
~ ❯ neofetch                                                  11:10:14 AM
                    'c.          dmanjcm@IN-OTA-C07YJ0X9JYW0
                 ,xNMM.          ---------------------------
               .OMMMMo           OS: macOS 11.6.2 20G314 x86_64
               OMMM0,            Host: Macmini8,1
     .;loddo:' loolloddol;.      Kernel: 20.6.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 11 days, 1 hour, 29 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 96 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.8
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1920x1080
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Light)
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: iTerm2
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   Terminal Font: MesloLGS-NF-Regular 13
    kMMMMMMMMMMMMMMMMMMMMMMd     CPU: Intel i7-8700B (12) @ 3.20GHz
     ;KMMMMMMMWXXWMMMMMMMk.      GPU: Intel UHD Graphics 630
       .cooc,.    .,coo:.        Memory: 34015MiB / 65536MiB
s-u commented 2 years ago

@akhst7 you did not provide any details, but I would guess that you have two possible problems:

  1. XQuartz 2.8.1 is is buggy and is missing several .pc files so I suspect your pkg-config is broken (you'll see if you read the output, you can also test with pkg-config --libs x11)
  2. XCFLAGS/XLIBS are not valid variables - the flag override names are CAIRO_CFLAGS and CAIRO_LIBS. Again, check the output and adjust if you need to.

Please do include the full output when reporting issues as well as what exactly you're linking against, how you installed it etc. The most reliable way to get cairo flags is with pkg-config so fixing that is the preferred way.

s-u commented 2 years ago

FWIW: the recipes contain a patch with the missing files for XQuartz: https://github.com/R-macos/recipes/blob/master/other/tcltk/pkgconfig.patch - but you can just take them from older XQuartz versions which were not broken.

akhst7 commented 2 years ago

@s-u thanks for the binary. Cairo is installed but still I can't compile it and failed with the same "can't find Intrinsic.h error"even with setting CAIRO_CFLAGS and CAIRO_LIBS. I will play with this when I have time but thanks !!

s-u commented 2 years ago

@akhst7 I just had a report from another user and the problem there was Homebrew - it doesn't include the necessary files, so you have to use XQuartz. That user has success with setting C_INCLUDE_PATH=/opt/X11/include, but that mixes XQuartz with Homebrew which is bad idea since they use different libraries.

As for correct CAIRO_xx flags, for XQuartz 2.8.1 I get the following:

CAIRO_CFLAGS=-I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include -I/opt/X11/include/freetype2 -I/opt/X11/include/libpng16 -I/opt/X11/include
CAIRO_LIBS=-L/opt/X11/lib -lfreetype -lz -lpng16 -lz -lcairo -lXext -lXrender -lX11