ropensci / rsvg

SVG renderer for R based on librsvg2
Other
97 stars 1 forks source link

cannot install package #14

Open guydotan opened 4 years ago

guydotan commented 4 years ago

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 ^~~~~~~~~~~~~~~~ 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
jeroen commented 4 years ago

You need to install pkgconfig. What is your OS?

guydotan commented 4 years ago

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)

yesdavid commented 3 years ago

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

jeroen commented 3 years ago

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.

yesdavid commented 3 years ago

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.

jeroen commented 3 years ago

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
yesdavid commented 3 years ago

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.

jeroen commented 3 years ago

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
yesdavid commented 3 years ago
jeroen commented 3 years ago

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

yesdavid commented 3 years ago

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?