Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot find -lMagick++-6.Q16 when installing R package "magick"

I am installing R package "magick" which is dependency of "ggimage" but got errors.
The code:

install.packages("magick")

The error message:

x86_64-conda_cos6-linux-gnu-c++ -std=gnu++11 -shared -L/home/pengguoyu/Software/anaconda3/envs/DNA/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/pengguoyu/Software/anaconda3/envs/DNA/lib -Wl,-rpath-link,/home/pengguoyu/Software/anaconda3/envs/DNA/lib -L/home/pengguoyu/Software/anaconda3/envs/DNA/lib -L/home/pengguoyu/Software/anaconda3/envs/DNA/lib -Wl,-rpath-link,/home/pengguoyu/Software/anaconda3/envs/DNA/lib -o magick.so RcppExports.o animation.o attributes.o base.o color.o composite.o config.o convolve.o device.o edges.o edit.o fonts.o options.o properties.o resize.o segment.o transformations.o -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16 -L/home/pengguoyu/Software/anaconda3/envs/DNA/lib/R/lib -lR
/home/pengguoyu/Software/anaconda3/envs/DNA/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lMagick++-6.Q16
/home/pengguoyu/Software/anaconda3/envs/DNA/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lMagickWand-6.Q16
/home/pengguoyu/Software/anaconda3/envs/DNA/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lMagickCore-6.Q16
collect2: error: ld returned 1 exit status
make: *** [/home/pengguoyu/Software/anaconda3/envs/DNA/lib/R/share/make/shlib.mk:6: magick.so] Error 1
ERROR: compilation failed for package ‘magick’

imagemagick-6.q16 is installed.

$ apt-cache policy imagemagick-6.q16
imagemagick-6.q16:
  Installed: 8:6.9.10.23+dfsg-2.1ubuntu11.1
  Candidate: 8:6.9.10.23+dfsg-2.1ubuntu11.1

My R version:

> R.version
               _                           
platform       x86_64-conda_cos6-linux-gnu 
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          6.1                         
year           2019                        
month          07                          
day            05                          
svn rev        76782                       
language       R                           
version.string R version 3.6.1 (2019-07-05)
nickname       Action of the Toes

My linux version:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal

Any help is appreciated, thanks!

like image 712
MatthewP Avatar asked Oct 14 '25 05:10

MatthewP


1 Answers

I solved this problem by install imagemagick to my conda environment, my R is also installed in this environment.

conda install -c conda-forge imagemagick

Before I tried install libmagick++-dev to linux, but this didn't solve the problem.

$ apt-cache policy libmagick++-dev
libmagick++-dev:
  Installed: 8:6.9.10.23+dfsg-2.1ubuntu11.1
  Candidate: 8:6.9.10.23+dfsg-2.1ubuntu11.1
  Version table:
 *** 8:6.9.10.23+dfsg-2.1ubuntu11.1 500
like image 92
MatthewP Avatar answered Oct 16 '25 19:10

MatthewP