ropensci / rsvg

SVG renderer for R based on librsvg2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't install rsvg on macOS using brew install of R

adamhsparks opened this issue · comments

Hi Jeroen,
Me again. Now I've run into an install problem with rsvg.

I've installed librsvg, brew install librsvg, I've told R where the pkgconfig path is, PKG_CONFIG_PATH=/usr/local/lib/pkgconfig, but still can't get it installed.

Thinking maybe it was an issue you'd solved already on GitHub I tried the repository here, still not working.

remotes::install_github("jeroen/rsvg")
Downloading GitHub repo jeroen/rsvg@master
   checking for file/private/var/folders/_x/gqh2xrvn4qb0qs5d8795n8vr0000gn/T/RtmpPCVuL5/remotes11c746da678d7/jeroen-rsvg-6448a5c/DESCchecking for file/private/var/folders/_x/gqh2xrvn4qb0qs5d8795n8vr0000gn/T/RtmpPCVuL5/remotes11c746da678d7/jeroen-rsvg-6448a5c/DESCRIPTION’
─  preparingrsvg:checking DESCRIPTION meta-information ...cleaning srcrunningcleanup’
─  checking for LF line-endings in source and make files and shell scriptschecking for empty or unneeded directoriesbuildingrsvg_1.3.tar.gzInstalling package into/Users/adamsparks/Library/R/3.x/library’
(aslibis unspecified)
* installing *source* packagersvg...
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libffi', required by 'gobject-2.0', not found
Found pkg-config cflags and libs!
Using PKG_CFLAGS=
Using PKG_LIBS=-L/usr/local/Cellar/librsvg/2.44.13/lib -L/usr/local/Cellar/glib/2.60.0_1/lib -L/usr/local/Cellar/gdk-pixbuf/2.38.1/lib -L/usr/local/Cellar/glib/2.60.0_1/lib -L/usr/local/opt/gettext/lib -L/usr/local/Cellar/cairo/1.16.0/lib -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because librsvg-2.0 was not found. Try installing:
 * deb: librsvg2-dev (Debian, Ubuntu, etc)
 * rpm: librsvg2-devel (Fedora, EPEL)
 * csw: librsvg_dev, sunx11_devel (Solaris)
 * brew: librsvg (OSX)
If librsvg-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a librsvg-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘rsvg’
* removing ‘/Users/adamsparks/Library/R/3.x/library/rsvg’
* restoring previous ‘/Users/adamsparks/Library/R/3.x/library/rsvg’
Error in utils::install.packages(pkgs = pkgs, lib = lib, repos = myrepos,  :
  (converted from warning) installation of package ‘/var/folders/_x/gqh2xrvn4qb0qs5d8795n8vr0000gn/T//RtmpPCVuL5/file11c7446d8c7f0/rsvg_1.3.tar.gz’ had non-zero exit status

I was able to get the package installed by dealing with the libffi error. To fix that, after confirming that libffi was installed using brew, I found the path for the libffi.pc file and ran R with the PKG_CONFIG_PATH set accordingly, e.g.:

PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.2.1/lib/pkgconfig R

Then rsvg could be installed:

R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin18.6.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("rsvg")
Installing package into ‘/usr/local/lib/R/3.6/site-library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Secure CRAN mirrors

 1: 0-Cloud [https]                   2: Algeria [https]
 3: Australia (Canberra) [https]      4: Australia (Melbourne 1) [https]
[...]
Selection: 3
trying URL 'https://cran.csiro.au/src/contrib/rsvg_1.3.tar.gz'
Content type 'application/x-gzip' length 6926 bytes
==================================================
downloaded 6926 bytes

* installing *source* package ‘rsvg’ ...
** package ‘rsvg’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/Cellar/libffi/3.2.1/lib/libffi-3.2.1/include -I/usr/local/Cellar/librsvg/2.44.14_1/include/librsvg-2.0 -I/usr/local/Cellar/gdk-pixbuf/2.38.1_1/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/glib/2.60.4_1/include -I/usr/local/Cellar/cairo/1.16.0_2/include/cairo -I/usr/local/Cellar/glib/2.60.4_1/include -I/usr/local/Cellar/glib/2.60.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.60.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.43/include -I/usr/local/Cellar/pixman/0.38.4/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.13.1/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libpng/1.6.37/include/libpng16
Using PKG_LIBS=-L/usr/local/Cellar/librsvg/2.44.14_1/lib -L/usr/local/Cellar/glib/2.60.4_1/lib -L/usr/local/Cellar/gdk-pixbuf/2.38.1_1/lib -L/usr/local/Cellar/glib/2.60.4_1/lib -L/usr/local/opt/gettext/lib -L/usr/local/Cellar/cairo/1.16.0_2/lib -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo
** libs
"clang" -I"/usr/local/Cellar/r/3.6.0_3/lib/R/include" -DNDEBUG -I/usr/local/Cellar/libffi/3.2.1/lib/libffi-3.2.1/include -I/usr/local/Cellar/librsvg/2.44.14_1/include/librsvg-2.0 -I/usr/local/Cellar/gdk-pixbuf/2.38.1_1/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/glib/2.60.4_1/include -I/usr/local/Cellar/cairo/1.16.0_2/include/cairo -I/usr/local/Cellar/glib/2.60.4_1/include -I/usr/local/Cellar/glib/2.60.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.60.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.43/include -I/usr/local/Cellar/pixman/0.38.4/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.13.1/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libpng/1.6.37/include/libpng16  -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include  -fPIC  -g -O2  -c rsvg.c -o rsvg.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/3.6.0_3/lib/R/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o rsvg.so rsvg.o -L/usr/local/Cellar/librsvg/2.44.14_1/lib -L/usr/local/Cellar/glib/2.60.4_1/lib -L/usr/local/Cellar/gdk-pixbuf/2.38.1_1/lib -L/usr/local/Cellar/glib/2.60.4_1/lib -L/usr/local/opt/gettext/lib -L/usr/local/Cellar/cairo/1.16.0_2/lib -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -L/usr/local/Cellar/r/3.6.0_3/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
installing to /usr/local/lib/R/3.6/site-library/00LOCK-rsvg/00new/rsvg/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rsvg)

The downloaded source packages are in
	‘/private/var/folders/ks/17y51dmd6hb8rdcqqxnd5qgw0000gn/T/Rtmp6xd8Vo/downloaded_packages’
>

Thanks for that, @jasonrig