3

I am trying to use install splashr, but running into some dependencies issues and nothing seems to work. I know it is more related to misconfiguration in OS than to issues in the package itself, but maybe you guys could give some guidance. Basically when attempting to install splashr I get the following log:

> install.packages("splashr")
Installing package into ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘magick’

trying URL 'https://cloud.r-project.org/src/contrib/magick_2.5.0.tar.gz'
Content type 'application/x-gzip' length 4824979 bytes (4.6 MB)
==================================================
downloaded 4.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/splashr_0.6.0.tar.gz'
Content type 'application/x-gzip' length 1099679 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
 - deb: libmagick++-dev (Debian, Ubuntu)
 - rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
 - csw: imagemagick_dev (Solaris)
 - brew imagemagick@6 (MacOS)
For Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA:
   sudo add-apt-repository -y ppa:cran/imagemagick
   sudo apt-get update
   sudo apt-get install -y libmagick++-dev
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.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] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/magick’
Warning in install.packages :
  installation of package ‘magick’ had non-zero exit status
ERROR: dependency ‘magick’ is not available for package ‘splashr’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/splashr’
Warning in install.packages :
  installation of package ‘splashr’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp8hJktb/downloaded_packages’

It complains about Magick++ not being found and leads to another fail install of the package magick it depends on. The output is similar:

> install.packages("magick")
Installing package into ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/magick_2.5.0.tar.gz'
Content type 'application/x-gzip' length 4824979 bytes (4.6 MB)
==================================================
downloaded 4.6 MB

* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
 - deb: libmagick++-dev (Debian, Ubuntu)
 - rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
 - csw: imagemagick_dev (Solaris)
 - brew imagemagick@6 (MacOS)
For Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA:
   sudo add-apt-repository -y ppa:cran/imagemagick
   sudo apt-get update
   sudo apt-get install -y libmagick++-dev
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.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] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/magick’
Warning in install.packages :
  installation of package ‘magick’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp8hJktb/downloaded_packages’

So I go into the terminal to install the missing packages libmagick++-dev, but it doesn't go far either because it keeps asking for dependencies of dependencies:

The following packages have unmet dependencies: libmagick++-dev : Depends: libmagick++-6.q16-dev but it is not going to be installed

And the tree of dependencies goes on:

libmagick++-dev 
    libmagick++-6.q16-dev 
        libmagickcore-6.q16-dev 
            libmagickwand-6.q16-dev 
                librsvg2-dev 
                    libcairo2-dev 
                        libfontconfig1-dev 
                            libfontconfig1 

I am not able to install any of them because of the error: "...but it is not going to be installed"

I already tryed to uninstall/install imagemagick several times to no avail.

These are some of info about env variables.

$PATH:
/home/guilherme/.local/share/umake/bin:/home/guilherme/bin:/home/guilherme/.local/share/umake/bin:/home/guilherme/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/guilherme/.config/composer/vendor/bin:bin/msys-ssh-1000-18:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/guilherme/.fzf/bin:/home/guilherme/.config/composer/vendor/bin

$PKG_CONFIG_PATH: (empty)

lsb_release -a: 
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic

I am completely lost. Can anyone help me with this?

Edit: As per N0rbert suggestion, this is the output of apt-cache policy libmagick++-6.q16-dev:

libmagick++-6.q16-dev:
  Installed: (none)
  Candidate: 8:6.9.7.4+dfsg-16ubuntu6.8
  Version table:
     8:6.9.7.4+dfsg-16ubuntu6.8 500
        500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     8:6.9.7.4+dfsg-16ubuntu6 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
2
  • Please add the output of apt-cache policy libmagick++-6.q16-dev to the question.
    – N0rbert
    Oct 28, 2020 at 16:47
  • Please show full list of your repositories by providing output of grep ^deb -r /etc/apt/ --include=*.list. If it is long, then use pastebin.com to share it.
    – N0rbert
    Oct 28, 2020 at 19:06

3 Answers 3

0

The needed file Magick++.pc file is contained in libmagick++-6.q16-dev which is available from bionic-updates and/or bionic-security pockets. So you have to check your repositories first by running Software & Updates (software-properties-gtk) or by editing /etc/apt/sources.list manually.

Then the following commands on fresh fully updated 18.04 LTS system will lead to successful compilation:

sudo apt-get install r-base-dev libcurl4-openssl-dev libxml2-dev libssl-dev libmagick++-6.q16-dev

and finally in R session:

install.packages("splashr")

should end successfully.

1
  • Ok. I added deb http://security.ubuntu.com/ubuntu bionic-security main to the end of /etc/apt/sources.list which, as stated, is the source for the package. After that, I updated sources list. Sadly the said dependency hell issue still remains.
    – Guilherme
    Oct 28, 2020 at 17:18
0

I figured it out with the help of a maintainer of the magick repo in this issue. Bottom line, the main issue was in libfontconfig1 which I had version 2.3 but the requested version was 2:

$ sudo apt install libfontconfig1-dev 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libfontconfig1-dev : Depends: libfontconfig1 (= 2.12.6-0ubuntu2) but 2.12.6-0ubuntu2.3 is to be installed
E: Unable to correct problems, you have held broken packages.

I simply forced version 2 to be installed, as suggested by Jeroen:

sudo apt-get install libfontconfig1=2.12.6-0ubuntu2

After that, every dependency from the bottom was installed without problems.

0

I was able to install the magick package on Ubuntu using the following commands in terminal:

sudo add-apt-repository -y ppa:cran/imagemagick
sudo apt-get update
sudo apt-get install -y libmagick++-dev

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.