ropensci / magick

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

attributes.cpp:8:27: error: ‘CommandOptionToMnemonic’ is not a member of ‘MagickCore’ #360

Closed bmlett closed 2 years ago

bmlett commented 2 years ago

Hi I've been trying to install magick on a linux based server. I've updated my Renviorn to point to the location of the location within the server that contains the ImageMagick builds and fixed a previous g++ issue. Now when it goes to compile I get the below error. It is my understanding that this is an attribute error with in the magick but I could be wrong. Any advice would be appreciated on how to resolve this and be able to install magick. Thanks.

trying URL 'https://mirror.las.iastate.edu/CRAN/src/contrib/magick_2.7.3.tar.gz'
Content type 'application/x-gzip' length 4813163 bytes (4.6 MB)
==================================================
downloaded 4.6 MB

* 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 -I/s/pkg/linux64/ImageMagick/6.6.6/include/ImageMagick
Using PKG_LIBS=-L/s/pkg/linux64/ImageMagick/6.6.6/lib -lMagick++ -lMagickCore
** libs
g++ -std=gnu++11 -I"/s/pkg/linux64/R/4.1.0/lib64/R/include" -DNDEBUG -fopenmp -I/s/pkg/linux64/ImageMagick/6.6.6/include/ImageMagick   -I'/ua/blett/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include' -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/s/pkg/linux64/R/4.1.0/lib64/R/include" -DNDEBUG -fopenmp -I/s/pkg/linux64/ImageMagick/6.6.6/include/ImageMagick   -I'/ua/blett/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include' -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c animation.cpp -o animation.o
g++ -std=gnu++11 -I"/s/pkg/linux64/R/4.1.0/lib64/R/include" -DNDEBUG -fopenmp -I/s/pkg/linux64/ImageMagick/6.6.6/include/ImageMagick   -I'/ua/blett/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include' -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c attributes.cpp -o attributes.o
attributes.cpp: In function ‘Rcpp::DataFrame magick_image_info(XPtrImage)’:
attributes.cpp:8:27: error: ‘CommandOptionToMnemonic’ is not a member of ‘MagickCore’
 #define Option(type, val) MagickCore::CommandOptionToMnemonic(type, val);
                           ^
attributes.cpp:188:21: note: in expansion of macro ‘Option’
     colorspace[i] = Option(MagickCore::MagickColorspaceOptions, frame.colorSpace());
                     ^
make: *** [attributes.o] Error 1
ERROR: compilation failed for package ‘magick’
* removing ‘/ua/blett/R/x86_64-pc-linux-gnu-library/4.1/magick’

The downloaded source packages are in
        ‘/tmp/RtmpXRUDCf/downloaded_packages’
Warning message:
In install.packages("magick") :
  installation of package ‘magick’ had non-zero exit status
jeroen commented 2 years ago

What Linux distro and version of imagemagick is this?

bmlett commented 2 years ago

Linux distro information:

nebula-9 ~ $ cat /etc/*release
NAME="Scientific Linux"
VERSION="7.9 (Nitrogen)"
ID="scientific"
ID_LIKE="rhel centos fedora"
VERSION_ID="7.9"
PRETTY_NAME="Scientific Linux 7.9 (Nitrogen)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:scientificlinux:scientificlinux:7.9:GA"
HOME_URL="http://www.scientificlinux.org//"
BUG_REPORT_URL="mailto:scientific-linux-devel@listserv.fnal.gov"

REDHAT_BUGZILLA_PRODUCT="Scientific Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.9
REDHAT_SUPPORT_PRODUCT="Scientific Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.9"
Scientific Linux release 7.9 (Nitrogen)
Scientific Linux release 7.9 (Nitrogen)
Scientific Linux release 7.9 (Nitrogen)

imagemagick version: file listed as 6.6.6

nebula-9 /s/pkg $ convert -version
Version: ImageMagick 6.9.10-68 Q16 x86_64 2021-10-12 https://imagemagick.org
jeroen commented 2 years ago

I just tried this with the docker image from scientificlinux 7.9 using ImageMagick-c++-devel and it works fine.

The problem is you have two conflicting imagemagick installations on your machine. The /s/pkg/linux64/ImageMagick one seems very outdated. I'm not sure how it got there, but it is better to remove that one and install the one from the OS:

yum install ImageMagick-c++-devel