ropensci / opencv

R bindings for OpenCV
https://docs.ropensci.org/opencv
Other
137 stars 27 forks source link

Compilation fails during installation (Ubuntu 17.04) #4

Closed emiltb closed 5 years ago

emiltb commented 6 years ago

After installing libopencv-dev I tried installing the package on Ubuntu. Unfortunately it fails during compilation:

> devtools::install_github("ropenscilabs/opencv")
Downloading GitHub repo ropenscilabs/opencv@master
from URL https://api.github.com/repos/ropenscilabs/opencv/zipball/master
Installing opencv
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
  CMD INSTALL  \
  '/tmp/RtmpJcVkMu/devtools34ec1a59c076/ropenscilabs-opencv-2caa207'  \
  --library='/home/emiltb/R/x86_64-pc-linux-gnu-library/3.4' --install-tests 

* installing *source* package ‘opencv’ ...
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/opencv
Using PKG_LIBS=-lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn -lopencv_dpm -lopencv_fuzzy -lopencv_hdf -lopencv_line_descriptor -lopencv_optflow -lopencv_plot -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_rgbd -lopencv_viz -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core
** libs
rm -f opencv.so RcppExports.o base.o effects.o face.o hog.o points.o util.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/opencv -I"/home/emiltb/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-Oe9izK/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/usr/include/opencv -I"/home/emiltb/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-Oe9izK/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c base.cpp -o base.o
base.cpp: In function ‘XPtrMat cvmat_resize(XPtrMat, int, int)’:
base.cpp:94:60: error: ‘INTER_LINEAR_EXACT’ was not declared in this scope
   cv::resize(input, output, cv::Size(width, height), 0, 0, INTER_LINEAR_EXACT);
                                                            ^~~~~~~~~~~~~~~~~~
base.cpp:94:60: note: suggested alternative: ‘CV_INTER_LINEAR’
   cv::resize(input, output, cv::Size(width, height), 0, 0, INTER_LINEAR_EXACT);
                                                            ^~~~~~~~~~~~~~~~~~
                                                            CV_INTER_LINEAR
/usr/lib/R/etc/Makeconf:168: recipe for target 'base.o' failed
make: *** [base.o] Error 1
ERROR: compilation failed for package ‘opencv’
* removing ‘/home/emiltb/R/x86_64-pc-linux-gnu-library/3.4/opencv’
Installation failed: Command failed (1)

Here is the output of sessionInfo() if that is any help for debugging.

> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 17.10 (Artful Aardvark)

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] 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] httr_1.3.1      compiler_3.4.4  R6_2.2.2        tools_3.4.4    
 [5] withr_2.1.2     curl_3.2        memoise_1.1.0   git2r_0.21.0   
 [9] digest_0.6.15   devtools_1.13.5
artemklevtsov commented 6 years ago

Possible duplicate #2.

kk-1 commented 6 years ago

openSUSE Tumbleweed 64 bit gcc/g++ ver 8 R 3.5.1 Installed without problem but:

For library(opencv) The error Message:

Error: package or namespace load failed for ‘opencv’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/kemal/R/x86_64-suse-linux-gnu-library/3.5/opencv/libs/opencv.so': /usr/lib64/libQt5Test.so.5: symbol qt_version_tag version Qt_5.11 not defined in file libQt5Core.so.5 with link time reference

any idea: