ropensci / rsvg

SVG renderer for R based on librsvg2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot install package

guydotan opened this issue · comments

Not sure if this is an issue with R 4.0.0 but i cannot install this package anymore. This is preventing ggimage package from working...

  • installing source package ‘rsvg’ ...
    ** package ‘rsvg’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ./configure: line 19: pkg-config: command not found
    Using PKG_CFLAGS=-I/usr/local/opt/librsvg/include
    Using PKG_LIBS=-L/usr/local/opt/librsvg/lib -lrsvg
    --------------------------- [ANTICONF] --------------------------------
    Configuration failed to find the librsvg-2.0 library. 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 MESSAGE] ---------------------------
    :1:10: fatal error: 'librsvg/rsvg.h' file not found
    #include <librsvg/rsvg.h>
    ^~~~~~~~~~~~~~~~
    1 error generated.

ERROR: configuration failed for package ‘rsvg’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rsvg’
    Warning in install.packages :
    installation of package ‘rsvg’ had non-zero exit status

You need to install pkgconfig. What is your OS?

I am running OSX. Just tried installing pkgconfig, does not seem to help.

However, I was able to get the package to work (as well as gg_image) when responding No to:
Do you want to install from sources the package which needs compilation? (Yes/no/cancel)

Hi @jeroen,
I'm on Ubuntu 18.04 and run into the same problem (R version 3.6.3).

Package librsvg-2.0 was not found in the pkg-config search path.

But it's there?: /usr/lib/x86_64-linux-gnu/pkgconfig/librsvg-2.0.pc
Also:
echo $PKG_CONFIG_PATH results in
/usr/lib/x86_64-linux-gnu/pkgconfig

The rest of the error message:

Perhaps you should add the directory containing `librsvg-2.0.pc' to the PKG_CONFIG_PATH environment variable
No package 'librsvg-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lrsvg
...
<stdin>:1:26: fatal error: librsvg/rsvg.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘rsvg’

Could you please point me towards the solution?

Best,
David

It could be that some dependency is missing. What do you see if you run in the shell: pkg-config --libs librsvg-2.0 ?

It should not be needed to set PKG_CONFIG_PATH if you installed librsvg using apt-get. In fact it is better to not set it.

thanks for your reply! when I run the command this appears:

Package librsvg-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `librsvg-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'librsvg-2.0' found

I tried sudo apt-get install librsvg2-bin and the same for librsvg2-dev. Both are already at the newest version.

That is strange, do you have any environment variables set that affect the result? Try with

unset PKG_CONFIG_LIBDIR
unset PKG_CONFIG_PATH
pkg-config --libs librsvg-2.0

Thank you for your swfit reply, @jeroen!
I executed your commands. When running pkg-config --libs librsvg-2.0 I get this result:

Package librsvg-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `librsvg-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'librsvg-2.0' found

However, librsvg2-dev is already the newest version (2.40.20-2ubuntu0.2). (Or which library do I have to install?)

I am not aware of any changed environment variables.

I don't understand, I just tested this on ubuntu 18.04 and it works for me. There must be something wrong with your config.

Can you show the output for:

which pkg-config
pkg-config --variable pc_path pkg-config
env | grep PKG_CONFIG
pkg-config --list-all
  • which pkg-config:
    -- /home/linuxbrew/.linuxbrew/bin/pkg-config - aha! that might be the reason? I had to install that the other day

  • pkg-config --variable pc_path pkg-config:
    -- /home/linuxbrew/.linuxbrew/lib/pkgconfig:/home/linuxbrew/.linuxbrew/share/pkgconfig:/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/os/linux/pkgconfig

  • env | grep PKG_CONFIG:
    -- nothing

  • pkg-config --list-all:

xrender          Xrender - X Render Library
xcb-shm          XCB Shm - XCB Shm Extension
xi               Xi - X Input Extension Library
recordproto      RecordProto - Record extension headers
xcb-xv           XCB Xv - XCB Xv Extension
xcb-damage       XCB Damage - XCB Damage Extension
openssl          OpenSSL - Secure Sockets Layer and cryptography libraries and tools
libbsd-ctor      libbsd-ctor - Automatic constructor functions for libbsd
dri3proto        DRI3Proto - DRI3 extension headers
blkid            blkid - Block device id library
formw            formw - ncurses 6.2 add-on library
xcb-dri2         XCB DRI2 - XCB DRI2 Extension
xcb-dri3         XCB DRI3 - XCB DRI3 Extension
pthread-stubs    pthread stubs - Meta package for pthread symbols - defaults to heavyweight ones if the C runtime does not provide lightweight ones.
xcb-xtest        XCB XTEST - XCB XTEST Extension
renderproto      RenderProto - Render extension headers
hmsbeagle-1      hmsbeagle - A library to calculate phylogenetic likelihoods.
xcb-xinput       XCB XInput - XCB XInput Extension (EXPERIMENTAL)
menu             menuw - ncurses 6.2 add-on library
xdmcp            Xdmcp - X Display Manager Control Protocol library
form             formw - ncurses 6.2 add-on library
xt               Xt - X Toolkit Library
smartcols        smartcols - table or tree library
xcb-present      XCB Present - XCB Present Extension
panelw           panelw - ncurses 6.2 add-on library
xcb-randr        XCB RandR - XCB RandR Extension
libpng           libpng - Loads and saves PNG files
xcb-glx          XCB GLX - XCB GLX Extension
libssl           OpenSSL-libssl - Secure Sockets Layer and cryptography libraries
damageproto      DamageProto - Damage extension headers
readline         Readline - Gnu Readline library for command line editing
kbproto          KBProto - KB extension headers
xcb-composite    XCB Composite - XCB Composite Extension
xcb-xvmc         XCB XvMC - XCB XvMC Extension
zlib             zlib - zlib compression library
dri2proto        DRI2Proto - DRI2 extension headers
xcb-sync         XCB Sync - XCB Sync Extension
xf86dgaproto     XF86DGAProto - XF86DGA extension headers
dpmsproto        DPMSProto - DPMS extension headers
resourceproto    ResourceProto - Resource extension headers
mpfr             mpfr - C library for multiple-precision floating-point computations
freetype2        FreeType 2 - A free, high-quality, and portable font engine.
xf86vidmodeproto XF86VidModeProto - XF86VidMode extension headers
ice              ICE - X Inter Client Exchange Library
xext             Xext - Misc X Extension Library
xineramaproto    XineramaProto - Xinerama extension headers
libbsd-overlay   libbsd - Utility functions from BSD systems (overlay)
libbsd           libbsd - Utility functions from BSD systems
presentproto     PresentProto - Present extension headers
applewmproto     AppleWMProto - AppleWM extension headers
ncurses          ncursesw - ncurses 6.2 library
xcb-ge           XCB GenericEvent - XCB GenericEvent Extension
xcb-dpms         XCB DPMS - XCB DPMS Extension
xcb-shape        XCB Shape - XCB Shape Extension
expat            expat - expat XML parser
x11-xcb          X11 XCB - X Library XCB interface
xcb-xf86dri      XCB XFree86-DRI - XCB XFree86-DRI Extension
xcmiscproto      XCMiscProto - XCMisc extension headers
xcb-xinerama     XCB Xinerama - XCB Xinerama Extension
xcb-xkb          XCB XKB - XCB Keyboard Extension (EXPERIMENTAL)
libcrypto        OpenSSL-libcrypto - OpenSSL cryptography library
xrandr           Xrandr - X RandR Library
x11              X11 - X Library
xau              Xau - X authorization file management libary
xcb-screensaver  XCB Screensaver - XCB Screensaver Extension
panel            panelw - ncurses 6.2 add-on library
xcb-xevie        XCB Xevie - XCB Xevie Extension
uuid             uuid - Universally unique id library
fdisk            fdisk - fdisk library
xproto           Xproto - Xproto headers
alsa             alsa - Advanced Linux Sound Architecture (ALSA) - Library
xcb-res          XCB Res - XCB X-Resource Extension
xtst             Xtst - The Xtst Library
mount            mount - mount library
dmxproto         DMXProto - DMX extension headers
videoproto       VideoProto - Video extension headers
fontconfig       Fontconfig - Font configuration and customization library
sm               SM - X Session Management Library
bigreqsproto     BigReqsProto - BigReqs extension headers
gmpxx            GNU MP C++ - GNU Multiple Precision Arithmetic Library (C++ bindings)
ncursesw         ncursesw - ncurses 6.2 library
compositeproto   CompositeExt - Composite extension headers
xcb-xfixes       XCB XFixes - XCB XFixes Extension
scrnsaverproto   ScrnSaverProto - ScrnSaver extension headers
alsa-topology    alsa-topology - Advanced Linux Sound Architecture (ALSA) - Topology Library
xfixes           Xfixes - X Fixes  Library
xcb-xprint       XCB Xprint - XCB Xprint Extension
menuw            menuw - ncurses 6.2 add-on library
inputproto       InputProto - Input extension headers
xf86bigfontproto XF86BigFontProto - XF86BigFont extension headers
xcb-xselinux     XCB SELinux - XCB SELinux Extension
fontsproto       FontsProto - Fonts extension headers
libpng16         libpng - Loads and saves PNG files
xcb-record       XCB Record - XCB Record Extension
glproto          GLProto - GL extension headers
gmp              GNU MP - GNU Multiple Precision Arithmetic Library
randrproto       RandrProto - Randr extension headers
xf86driproto     XF86DRIProto - XF86DRI extension headers
xextproto        XExtProto - XExt extension headers
ncurses++w       ncurses++w - ncurses 6.2 add-on library
xcb-render       XCB Render - XCB Render Extension
xcb              XCB - X-protocol C Binding
fixesproto       FixesProto - X Fixes extension headers

Yes that is the reason, if you remove linuxbrew from your PATH it will work.

thank you very much! I know this is not directly related to this issue, but what would I have to do to install it regularly and not inside brew?