mlampros / OpenImageR

Image processing Toolkit in R
https://mlampros.github.io/OpenImageR/
57 stars 10 forks source link

Install OpenImageR failed on ubuntu server 16.04 LTS #8

Closed wumingpu closed 6 years ago

wumingpu commented 6 years ago

I install R 3.3.3 on Ubuntu server 16.04 LTS OS, when I install OpenImageR package, I meet below error message, can you help me to reslove this issue? thank you.

* installing *source* package ‘OpenImageR’ ...
** package ‘OpenImageR’ successfully unpacked and MD5 sums checked
** libs
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/Rcpp/include" -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/RcppArmadillo/include"  -fopenmp    -c RcppExports.cpp -o RcppExports.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:141: recipe for target 'RcppExports.o' failed
make: [RcppExports.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/Rcpp/include" -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/RcppArmadillo/include"  -fopenmp    -c dilation_erosion_rgb2gray.cpp -o dilation_erosion_rgb2gray.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:141: recipe for target 'dilation_erosion_rgb2gray.o' failed
make: [dilation_erosion_rgb2gray.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/Rcpp/include" -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/RcppArmadillo/include"  -fopenmp    -c hog_features.cpp -o hog_features.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:141: recipe for target 'hog_features.o' failed
make: [hog_features.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/Rcpp/include" -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/RcppArmadillo/include"  -fopenmp    -c image_hashing.cpp -o image_hashing.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:141: recipe for target 'image_hashing.o' failed
make: [image_hashing.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/Rcpp/include" -I"/usr/lib64/microsoft-r/3.3/lib64/R/library/RcppArmadillo/include"  -fopenmp    -c utils.cpp -o utils.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:141: recipe for target 'utils.o' failed
make: [utils.o] Error 127 (ignored)
-shared -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -o OpenImageR.so RcppExports.o dilation_erosion_rgb2gray.o hog_features.o image_hashing.o utils.o -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -lRlapack -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -lRblas -lgfortran -lm -fopenmp -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -lR
sh: line 2: -shared: command not found
/usr/lib64/microsoft-r/3.3/lib64/R/share/make/shlib.mk:6: recipe for target 'OpenImageR.so' failed
make: *** [OpenImageR.so] Error 127
ERROR: compilation failed for package ‘OpenImageR’
* removing ‘/usr/lib64/microsoft-r/3.3/lib64/R/library/OpenImageR’
mlampros commented 6 years ago

The OpenImageR package requires a C++11 compiler. This is the output that is printed in my R-session when I install OpenImageR on my Debian OS:


* installing *source* package ‘OpenImageR’ ...
** package ‘OpenImageR’ successfully unpacked and MD5 sums checked
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/home/lampros/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include"   -fopenmp -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/home/lampros/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include"   -fopenmp -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c dilation_erosion_rgb2gray.cpp -o dilation_erosion_rgb2gray.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/home/lampros/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include"   -fopenmp -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c hog_features.cpp -o hog_features.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/home/lampros/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include"   -fopenmp -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c image_hashing.cpp -o image_hashing.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/home/lampros/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include"    -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/home/lampros/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include"   -fopenmp -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c utils.cpp -o utils.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o OpenImageR.so RcppExports.o dilation_erosion_rgb2gray.o hog_features.o image_hashing.o init.o utils.o -llapack -lblas -lgfortran -lm -lquadmath -fopenmp -L/usr/lib/R/lib -lR

......

You also received an Error 127. I searched on web and found that this issue appears if you miss the requirements for compiling C/C++ based applications. You probably need to run,


sudo apt-get install build-essential
wumingpu commented 6 years ago

Thanks for your reply. I have already install the build-essential and g++ before install package OpenImageR. Maybe this caused by I used the Microsoft R Open (MRAN) not the CRAN.

Here is my sulotion:

  1. install CRAN on anthor Ubuntu server 16.04.
  2. install OpenImageR package on this new server.
  3. install successfully, copy the OpenImageR folder under library folder to the Microsoft R Open library folder.
  4. in R session, execute command "library(OpenImageR)" successfully.