Skip to content

Instantly share code, notes, and snippets.

@egaudrain
Created January 8, 2026 12:51
Show Gist options
  • Select an option

  • Save egaudrain/00028654341c6fbf51564971eb80e113 to your computer and use it in GitHub Desktop.

Select an option

Save egaudrain/00028654341c6fbf51564971eb80e113 to your computer and use it in GitHub Desktop.
Use Cairo in R on macOS
  1. Install the quartz-wm package in MacPorts:
sudo port install quartz-wm
  1. Create symlinks in the right place:
sudo mkdir -p /opt/X11/lib
sudo ln -s /opt/local/lib/libSM.6.dylib /opt/X11/lib/libSM.6.dylib
sudo ln -s /opt/local/lib/libICE.6.dylib /opt/X11/lib/libICE.6.dylib
sudo ln -s /opt/local/lib/libX11.6.dylib /opt/X11/lib/libX11.6.dylib
sudo ln -s /opt/local/lib/libXext.6.dylib /opt/X11/lib/libXext.6.dylib
sudo ln -s /opt/local/lib/libXrender.1.dylib /opt/X11/lib/libXrender.1.dylib
sudo ln -s /opt/local/lib/libXt.6.dylib /opt/X11/lib/libXt.6.dylib      
sudo ln -s /opt/local/lib/libXmu.6.dylib /opt/X11/lib/libXmu.6.dylib
  1. Install the Cairo package in R. I installed the source package:
install.packages("Cairo", type="source")

but it might probably work with the binary install too.

Note, not everything was tested to be required... this is just the recipe that worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment