You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/01/22 05:28:42 UTC

[GitHub] [incubator-mxnet] shawnbrar commented on issue #17359: Mxnet doesn't install for R if OpenCV is build on linux

shawnbrar commented on issue #17359: Mxnet doesn't install for R if OpenCV is build on linux
URL: https://github.com/apache/incubator-mxnet/issues/17359#issuecomment-577014464
 
 
   I actually found the problem. When I type in `make -f R-package/Makefile rpkg`, the following output appears : 
   `make -f R-package/Makefile rpkg`
   
   --------------------------------------------------------------------------------------------------------------------
   mkdir -p R-package/inst/libs
   cp src/io/image_recordio.h R-package/src
   if [ -d "lib" ]; then \
   	cp -rf lib/libmxnet.so R-package/inst/libs; \
   	if [ -e "lib/libtvm_runtime.so" ]; then \
   		cp -rf lib/libtvm_runtime.so R-package/inst/libs; \
   	fi; \
   else \
   	cp -rf build/libmxnet.so R-package/inst/libs; \
   	if [ -e "build/libtvm_runtime.so" ]; then \
   		cp -rf build/libtvm_runtime.so R-package/inst/libs; \
   	fi; \
   fi
   mkdir -p R-package/inst/include
   cp -rl include/* R-package/inst/include
   Rscript -e "if(!require(devtools)){install.packages('devtools', repo = 'https://cloud.r-project.org/')}"
   Loading required package: devtools
   Loading required package: usethis
   Rscript -e "if(!require(roxygen2)||packageVersion('roxygen2') < '6.1.1'){install.packages('roxygen2', repo = 'https://cloud.r-project.org/')}"
   Loading required package: roxygen2
   Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cloud.r-project.org/')); install_deps(pkg='R-package', dependencies = TRUE)"
   Loading required package: usethis
   
   cp R-package/dummy.NAMESPACE R-package/NAMESPACE  # NAMESPACE will be replaced by devtools::document later
   echo "import(Rcpp)" >> R-package/NAMESPACE
   R CMD INSTALL R-package
   * installing to library ‘/home/shawnbrar/R/x86_64-pc-linux-gnu-library/3.6’
   * installing *source* package ‘mxnet’ ...
   ** using staged installation
   ** libs
   make[1]: Entering directory '/home/shawnbrar/Documents/Libs/mxnet/R-package/src'
   g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../inst/include `pkg-config --cflags opencv` `Rscript -e 'Rcpp:::CxxFlags()'` -I"/home/shawnbrar/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c im2rec.cc -o im2rec.o
   Package opencv was not found in the pkg-config search path.
   Perhaps you should add the directory containing `opencv.pc'
   to the PKG_CONFIG_PATH environment variable
   No package 'opencv' found
   im2rec.cc:39:10: fatal error: opencv2/opencv.hpp: No such file or directory
    #include <opencv2/opencv.hpp>
             ^~~~~~~~~~~~~~~~~~~~
   compilation terminated.
   /usr/lib/R/etc/Makeconf:175: recipe for target 'im2rec.o' failed
   make[1]: *** [im2rec.o] Error 1
   make[1]: Leaving directory '/home/shawnbrar/Documents/Libs/mxnet/R-package/src'
   ERROR: compilation failed for package ‘mxnet’
   * removing ‘/home/shawnbrar/R/x86_64-pc-linux-gnu-library/3.6/mxnet’
   * restoring previous ‘/home/shawnbrar/R/x86_64-pc-linux-gnu-library/3.6/mxnet’
   R-package/Makefile:5: recipe for target 'rpkg' failed
   make: *** [rpkg] Error 1
   --------------------------------------------------------------------------------------------------------------------
   
   In this the following is important to see : 
   `g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I../inst/include 'pkg-config --cflags opencv'`
   
   It says `pkg-config --cflags opencv`
   Whereas it should be `pkg-config --cflags opencv4`.
   
   What can I do to make this change? Should I rename my _opencv4.pc_ file to _opencv.pc_?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services