ropensci / magick

Magic, madness, heaven, sin
https://docs.ropensci.org/magick
Other
461 stars 66 forks source link

HELP: Problem installing magick in R (R cannot find installed Magick++) #198

Closed Nerdobyte closed 5 years ago

Nerdobyte commented 5 years ago

So I am trying to install magic on a computer where I do not have root privileges. As such I tend to install most programs in my local folder and add their location to my PATH. I have been trying to install the "magick" package on R, and I keep getting the following error:

** installing source* package ‘magick’ ... package ‘magick’ successfully unpacked and MD5 sums checked ** using staged installation Found pkg-config cflags and libs! Using PKG_CFLAGS=-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6
Using PKG_LIBS=-lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16
------------------------- ANTICONF ERROR --------------------------- Configuration failed because Magick++ was not found. Try installing:

  • deb: 'libmagick++-dev' (Debian, Ubuntu)
  • rpm: 'ImageMagick-c++-devel' (Fedora, CentOS, RHEL)
  • csw: 'imagemagick_dev' (Solaris) On MacOS it is recommended to use install ImageMagick-6 from homebrew with extra support for fontconfig and rsvg rendering: brew reinstall imagemagick@6 --with-fontconfig --with-librsvg For older Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA: sudo add-apt-repository -y ppa:opencpu/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: configuration failed for package ‘magick’

  • removing ‘server/homes/Nerdobyte/R/x86_64-pc-linux-gnu-library/3.6/magick’

The downloaded source packages are in ‘/local/scratch/Rtmp687fCj/downloaded_packages’ Warning message: In install.packages("magick") : installation of package ‘magick’ had non-zero exit status****

I have already installed ImageMagick-c++-devel (I am using CentOS) and added it to my PATH variable. I have also included 'pkg-config' in the PATH and my PKG_CONFIG_PATH contains a Magick++.pc file. The two variables now look like this:

$PATH = /server/homes/Nerdobyte/test/usr/lib64/pkgconfig:/server/homes/Nerdobyte/test/usr/include/ImageMagick-6:/server/homes/Nerdobyte/test/usr/lib64:/server/homes/Nerdobyte/test/usr/bin:/local/gensoft2/exe/R/3.6.0/scripts:/local/gensoft2/exe/R/3.6.0/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin

$PKG_CONFIG_PATH = /server/homes/Nerdobyte/test/usr/lib64/pkgconfig:/server/homes/Nerdobyte/test/usr/include/ImageMagick-6:/server/homes/Nerdobyte/test/usr/lib64:/server/homes/Nerdobyte/test/usr/bin:/server/homes/Nerdobyte/test/usr/lib64/pkgconfig/Magick++.pc:/server/homes/Nerdobyte/test/usr/lib64/pkgconfig:/local/gensoft2/exe/R/3.6.0/lib64/pkgconfig

I am not sure what I am doing wrong or if I have missed something very obvious. Any help would be greatly appreciated!!

jeroen commented 5 years ago

Can you show the full install log? Are you using the official R-devel from EPEL?

Nerdobyte commented 5 years ago

Can you show the full install log? Are you using the official R-devel from EPEL?

@jeroen : No I am not using R-devel. The following is the install log along with R version details:

R version 3.6.0 (2019-04-26) -- "Planting of a Tree" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (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("magick") Installing package into ‘/server/homes/Nerdobyte/R/x86_64-pc-linux-gnu-library/3.6’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- trying URL 'https://ftp.gwdg.de/pub/misc/cran/src/contrib/magick_2.0.tar.gz' Content type 'application/octet-stream' length 4998781 bytes (4.8 MB)

downloaded 4.8 MB

The downloaded source packages are in ‘/local/scratch/Rtmp2eYp2M/downloaded_packages’ Warning message: In install.packages("magick") : installation of package ‘magick’ had non-zero exit status

Nerdobyte commented 5 years ago

Completed installation on my local computer (Ubuntu 18.04) where I have root access. Addressed Magick++ installation problem using:

sudo apt-get install libmagick++-dev

Worked like a charm! =)

JonasFreireAlcantara commented 3 years ago

Completed installation on my local computer (Ubuntu 18.04) where I have root access. Addressed Magick++ installation problem using:

sudo apt-get install libmagick++-dev

Worked like a charm! =)

Guys, you are awesome, thanks!

jschap1 commented 3 years ago

This helped me, too! Grateful for this forum :)

xihajun commented 3 years ago

May I ask if there is any solution for centos?

I tried to install ImageMagick-c++-devel, but it doesn't seem to fix

jolienvanhooff commented 2 years ago

Completed installation on my local computer (Ubuntu 18.04) where I have root access. Addressed Magick++ installation problem using: sudo apt-get install libmagick++-dev Worked like a charm! =)

Guys, you are awesome, thanks!

Worked for me as well, thanks a lot!

danlavieri commented 1 year ago

Worked for me, but I had to run sudo apt-get update --fix-missing and udo apt-get upgrade first.

karlosgomes commented 3 months ago

Also worked for me. Guys: you are the greatest