Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install fails from "undefined symbol" #300

Closed
tedmoorman opened this issue Feb 12, 2021 · 6 comments
Closed

install fails from "undefined symbol" #300

tedmoorman opened this issue Feb 12, 2021 · 6 comments

Comments

@tedmoorman
Copy link

I get pretty far into the install and then receive the following error:

Error: package or namespace load failed for ‘magick’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/R/x86_64-pc-linux-gnu-library/3.5/magick/libs/magick.so':
  /home/R/x86_64-pc-linux-gnu-library/3.5/magick/libs/magick.so: undefined symbol: _ZN6Magick5Image5writeEPNS_4BlobERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm

Here is the entire installation:

Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
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  
** libs
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c animation.cpp -o animation.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c attributes.cpp -o attributes.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c base.cpp -o base.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c color.cpp -o color.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c composite.cpp -o composite.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c config.cc -o config.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c convolve.cpp -o convolve.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c device.cpp -o device.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c edges.cpp -o edges.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c edit.cpp -o edit.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c fonts.cpp -o fonts.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c options.cpp -o options.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c properties.cpp -o properties.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c resize.cpp -o resize.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c segment.cpp -o segment.o
g++ -std=gnu++11 -I"/opt/R/R-3.5.3/lib64/R/include" -DNDEBUG -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   -I"/home/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2 -c transformations.cpp -o transformations.o
g++ -std=gnu++11 -shared -L/opt/R/R-3.5.3/lib64/R/lib -L/usr/local/lib64 -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/opt/R/R-3.5.3/lib64/R/lib -lR
installing to /home/R/x86_64-pc-linux-gnu-library/3.5/magick/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘magick’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/R/x86_64-pc-linux-gnu-library/3.5/magick/libs/magick.so':
  /home/R/x86_64-pc-linux-gnu-library/3.5/magick/libs/magick.so: undefined symbol: _ZN6Magick5Image5writeEPNS_4BlobERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/R/x86_64-pc-linux-gnu-library/3.5/magick’
Warning in install.packages :
  installation of package ‘/home/package_files/magick_2.2.tar.gz’ had non-zero exit status

Here is the session info:

R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.9 (Maipo)

Matrix products: default
BLAS: /opt/R/R-3.5.3/lib64/R/lib/libRblas.so
LAPACK: /opt/R/R-3.5.3/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6        packrat_0.4.9-1   digest_0.6.25     later_1.1.0.1     mime_0.9         
 [6] R6_2.5.0          lifecycle_0.2.0   xtable_1.8-4      magrittr_2.0.1    rlang_0.4.10     
[11] promises_1.1.1    leaflet_2.0.4.1   ellipsis_0.3.0    tools_3.5.3       htmlwidgets_1.5.3
[16] crosstalk_1.1.1   shiny_1.6.0       httpuv_1.5.4      fastmap_1.0.1     compiler_3.5.3   
[21] htmltools_0.5.1 
@jeroen
Copy link
Member

jeroen commented Feb 12, 2021

You have an ABI mismatch between your compiler and ImageMagick. I'm guessing you're not using the stock g++ from RHEL, or from Red Hat Developer Toolset? Try compiling with /usr/bin/g++.

@tedmoorman
Copy link
Author

I'm definitely not of the server/admin side of things. Could you please let me know how to specific that path with {r} configure.args = in the {r} install.packages() function? Right now, I just I'm just using {r} install.packages("~/package_files/magick_2.6.0.tar.gz", repos=NULL, type="source", dependencies = TRUE) . Thanks for taking a look at this!

@jeroen
Copy link
Member

jeroen commented Feb 12, 2021

We can't fix your global R settings from the package. Maybe you try running this in your shell:

echo "CXX11=/usr/bin/g++" > ~/.R/Makevars

And after that try again installing magick.

@tedmoorman
Copy link
Author

Thank you so much @jeroen! I ended up changing that environmental variable in my .Rprofile. The install had no issues. Cheers.

@lidongyu16
Copy link

Thank you so much @jeroen! I ended up changing that environmental variable in my .Rprofile. The install had no issues. Cheers.

I meet the exactly the same problems , I want to know how to change "that environmental variable" in my .Rprofile. Thank you very much.

@tedmoorman
Copy link
Author

Thank you so much @jeroen! I ended up changing that environmental variable in my .Rprofile. The install had no issues. Cheers.

I meet the exactly the same problems , I want to know how to change "that environmental variable" in my .Rprofile. Thank you very much.

I'm thinking this was a change to the "Makevars" file located in ~/.R/Makevars. Try adding the following line: CXX11=/usr/bin/g++ and hopefully that will solve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants