swarm-lab / ROpenCVLite

Utility package to install OpenCV in R
https://swarm-lab.github.io/ROpenCVLite/
GNU General Public License v3.0
53 stars 17 forks source link

ROpenCVlite installation problem #15

Closed JBlefebvre closed 5 years ago

JBlefebvre commented 5 years ago

Hi,

I am working on Windows 10, RStudio 1.1.463, R3.5.3.

I am trying to install ROpenCVlite using this tutorial: https://swarm-lab.github.io/ROpenCVLite/articles/install.html

I have installed Cmake (3.14.1) and Rtools (3.5) . Normally, Paths have been registered in system variable "PATH", as you can see: Path screenshot

I have installed Devtools too on Rstudio, without any problem

When I want to install ROpenCVlite, I have an error message and I don't know why. Here it is:


...

-- Configuring incomplete, errors occurred! See also "C:/TEMP/Rtmp6jLyuJ/R.INSTALL25dc75f43d6c/ROpenCVLite/src/opencv-4.0.1/build64/CMakeFiles/CMakeOutput.log". See also "C:/TEMP/Rtmp6jLyuJ/R.INSTALL25dc75f43d6c/ROpenCVLite/src/opencv-4.0.1/build64/CMakeFiles/CMakeError.log". ERROR: configuration failed for package 'ROpenCVLite'

What should I do?

I haven't seen this kind of problem in the other posts.

Thank you very much and have a good day!

JB

sjmgarnier commented 5 years ago

@JBlefebvre At the moment, it is recommended to use the latest "frozen" version of RTools to install ROpenCVLite, which is currently v3.4 (see https://swarm-lab.github.io/ROpenCVLite/articles/install.html#windows). Last week, I reported the problem with Cmake and v3.5 to the RTools developers here: https://github.com/rwinlib/rtools35/issues/11. I suggest you add a comment there to make them aware that the issue is not isolated. Thanks.

JBlefebvre commented 5 years ago

Okay I installed Rtools3.4. Indeed, it functions correctly now. ROpenCVlite could be downloaded! I will make a comment on the link you sent me. Thank you very much!

sjmgarnier commented 5 years ago

@JBlefebvre 👍

muschellij2 commented 5 years ago

Can you try to look at https://ci.appveyor.com/project/muschellij2/ropencvlite/build/job/791u6bmstvec9akf for any Warnings (maybe clean these up after running make install) and https://ci.appveyor.com/project/muschellij2/ropencvlite/build/job/cinkaohsvpr3jcun for Rtools 3.5 and especially the artifacts, which has the build zipped up: https://ci.appveyor.com/project/muschellij2/ropencvlite/build/job/cinkaohsvpr3jcun/artifacts

sjmgarnier commented 5 years ago

@muschellij2 I know about the warnings with Rtools 3.4. Since I'm not planning on submitting to CRAN now, I've ignored them so far.

The error with Rtools 3.5 is the same as the one reported by @JBlefebvre. Did I miss something?

muschellij2 commented 5 years ago

No you didn't - I guess I was just saying you could use 3.5 on Appveyor as a test bed, but I don't know why the error occurred. Likely Rtools 3.5, but it could be how some variable gets set in 3.5 that coordinates with opencv make steps.

On Mon, Apr 8, 2019 at 2:02 PM Simon Garnier notifications@github.com wrote:

@muschellij2 https://github.com/muschellij2 I know about the warnings with Rtools 3.4. Since I'm not planning on submitting to CRAN now, I've ignored them so far.

The error with Rtools 3.5 is the same as the one reported by @JBlefebvre https://github.com/JBlefebvre. Did I miss something?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/swarm-lab/ROpenCVLite/issues/15#issuecomment-480940151, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBnrjWM2lkaMScxM0idCVZnvscX60C3ks5ve4QsgaJpZM4cXZV4 .

sjmgarnier commented 5 years ago

@muschellij2 Oh ok. I have set up a virtual Windows 10 machine at work to do my testing. It's faster than waiting for appveyor's results.

sjmgarnier commented 5 years ago

This is fixed in the latest release (87aea72). Closing this now.

max-poltora commented 4 years ago

Hi, I am trying to install the ROpenCVLite on R in Windows 10 using the instructions: https://swarm-lab.github.io/ROpenCVLite/articles/install.html#installing-ropencvlite. I succeeded to install latest version of Rtools (4.0) and done devtools::install_github("swarm-lab/ROpenCVLite", force=TRUE). However, when I execute library(ROpenCVLite) I get the following error message:

library(ROpenCVLite)

OpenCV is not installed on this system. Would you like to install it now? This will take several minutes.

1: yes 2: no

Selection: yes cmake version 3.18.0-rc1

CMake suite maintained and supported by Kitware (kitware.com/cmake). OpenCV will be installed in C:/Users/user/Documents/R/win-library/3.5/opencv Removing old OpenCV installation. trying URL 'https://github.com/opencv/opencv/archive/4.3.0.tar.gz' Error: package or namespace load failed for ‘ROpenCVLite’: .onAttach failed in attachNamespace() for 'ROpenCVLite', details: call: utils::download.file("https://github.com/opencv/opencv/archive/4.3.0.tar.gz", error: cannot open URL 'https://github.com/opencv/opencv/archive/4.3.0.tar.gz' In addition: Warning message: In utils::download.file("https://github.com/opencv/opencv/archive/4.3.0.tar.gz", : InternetOpenUrl failed: ''

Paths have been registered in the system:

C:\Rtools\usr\bin C:\Rtools\CMake\bin

Can you please help me with this issue?

sjmgarnier commented 4 years ago

@max-poltora It looks like you had a temporary internet issue. R was not able to reach the website that distributes the sources of OpenCV. I just tested it and it seems to be working now.

max-poltora commented 4 years ago

@sjmgarnier, I tried it again, but the result is the same... However, my internet might be slow: 35 Mbps for download. May it be the reason?

sjmgarnier commented 4 years ago

@max-poltora No, it's probably not the reason. Can you run the following command in R and let me know what error message you get?

utils::download.file("https://github.com/opencv/opencv/archive/4.3.0.tar.gz", "~/Desktop/4.3.0.tar.gz")
max-poltora commented 4 years ago

@sjmgarnier, I get the following error message:

Error in utils::download.file("https://github.com/opencv/opencv/archive/4.3.0.tar.gz", : cannot open destfile '~/Desktop/4.3.0.tar.gz', reason 'No such file or directory'

max-poltora commented 4 years ago

@sjmgarnier, the issue of this step seems to be solved. I run the command options(download.file.method = "libcurl") and then library(ROpenCVLite). However, now I receive another error message:

WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 3.5.3 was found. (Only the following incompatible version(s) of Rtools were found:4.0)

Please download and install Rtools custom from https://cran.r-project.org/bin/windows/Rtools/. Error: package or namespace load failed for ‘ROpenCVLite’: .onAttach failed in attachNamespace() for 'ROpenCVLite', details: call: NULL error: Rtools is not installed.

muschellij2 commented 4 years ago

I think RStudio recommends using:curl::curl_download(url, destfile) for downloads.

The new error now tells you what you need to do:

Please download and install Rtools custom from https://cran.r-project.org/bin/windows/Rtools/.

sjmgarnier commented 4 years ago

@sjmgarnier Yes, Rtools 4.0 is only compatible with R 4.0. You can either upgrade to R 4.0, or remove Rtools 4.0 and replace it with Rtools 3.5.

max-poltora commented 4 years ago

@sjmgarnier @muschellij2, now I reinstalled the Rtools 3.5, but I have another error:

cmake version 3.18.0-rc1

CMake suite maintained and supported by Kitware (kitware.com/cmake). OpenCV will be installed in C:/Users/user/Documents/R/win-library/3.5/opencv Removing old OpenCV installation. trying URL 'https://github.com/opencv/opencv/archive/4.3.0.tar.gz' Content length 120 bytes downloaded 83.9 MB

-- The CXX compiler identification is unknown -- The C compiler identification is unknown CMake Error at CMakeLists.txt:106 (enable_language): The CMAKE_CXX_COMPILER:

/mingw_64/bin/g++.exe

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:106 (enable_language): The CMAKE_C_COMPILER:

/mingw_64/bin/gcc.exe

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred! See also "C:/Users/user/AppData/Local/Temp/RtmpOURGZt/opencv-4.3.0/build64/CMakeFiles/CMakeOutput.log". See also "C:/Users/user/AppData/Local/Temp/RtmpOURGZt/opencv-4.3.0/build64/CMakeFiles/CMakeError.log". -- The CXX compiler identification is unknown -- The C compiler identification is unknown CMake Error at CMakeLists.txt:106 (enable_language): The CMAKE_CXX_COMPILER:

/mingw_32/bin/g++.exe

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:106 (enable_language): The CMAKE_C_COMPILER:

/mingw_32/bin/gcc.exe

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred! See also "C:/Users/user/AppData/Local/Temp/RtmpOURGZt/opencv-4.3.0/build32/CMakeFiles/CMakeOutput.log". See also "C:/Users/user/AppData/Local/Temp/RtmpOURGZt/opencv-4.3.0/build32/CMakeFiles/CMakeError.log". [1] FALSE

How can I set the path to the compiler? I added another line to PATH C:\Rtools\mingw_64\bin, but error is still there...

sjmgarnier commented 4 years ago

@max-poltora I can't reproduce this error with R 3.5.3. So, in order:

  1. Are all your packages up to date, in particular devtools and pkgbuild?
  2. Where exactly is Rtools installed on your computer? Is it really in C:\Rtools (please check using Windows file explorer)? If not, is there any space in the path to that location?
  3. What is the full content of your path?

Thanks.

max-poltora commented 4 years ago

@sjmgarnier, @muschellij2, I have solved the issue. In my case, as far as I understood, the problem was that earlier installed version of Rtools (4.0) has written its path to system variables. I removed it and reinstalled the latest frozen Rtools version 3.5 (I also checked all the checkboxes and allow installator to automatically create a PATH).

Thank you so much for your time and hints.