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

CMake problem while installing ROpenCVLite #42

Open
jubelik opened this issue Jan 8, 2024 · 13 comments
Open

CMake problem while installing ROpenCVLite #42

jubelik opened this issue Jan 8, 2024 · 13 comments

Comments

@jubelik
Copy link

jubelik commented Jan 8, 2024

Describe the bug
When I run ROpenCVLite::installOpenCV(), I have error about the path of CMake.
(following issues 36 on TrackR)

To Reproduce
Here is the code I'm using

if (!require("installr"))
install.packages("installr")
installr::install.Rtools()
installr::install.CMake()
remotes::install_github("swarm-lab/ROpenCVLite@85a94ef")
ROpenCVLite::installOpenCV()

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
OpenCV will be installed in C:\Users\jbelik\AppData\Local\R\win-library\4.3\ROpenCV
Clearing install path.
trying URL 'https://github.com/opencv/opencv/archive/4.8.0.tar.gz'
downloaded 87.7 MB

trying URL 'https://github.com/opencv/opencv_contrib/archive/4.8.0.tar.gz'
downloaded 56.5 MB

CMake Warning:
Ignoring extra path from command line:

"C:/Program Files/Files/rtools43/x86_64-w64-mingw32.static.posix/bin/gcc.exe"

CMake Warning:
Ignoring extra path from command line:

"Files/rtools43/usr/bin/make.exe"

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

C:/Program

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:113 (enable_language):
The CMAKE_C_COMPILER:

C:/Program

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/jbelik/AppData/Local/Temp/Rtmp8kV4Ls/opencv-4.8.0/build64/CMakeFiles/CMakeOutput.log".
See also "C:/Users/jbelik/AppData/Local/Temp/Rtmp8kV4Ls/opencv-4.8.0/build64/CMakeFiles/CMakeError.log".
[1] FALSE

Expected behavior

Computer (please complete the following information):

  • Operating system: Windows
  • Version 11

R (please complete the following information):

  • R version: 4.3.2
  • ROpenCVLite version: 4.80.1
  • Cmake version: 3.28.1
  • Rtools version (Windows only): 4.3

Additional context
I kown the error message is pretty self explanotory, but I can't figure out how to solve the issue. I've never code on Windows so it is kinda new.
Thanks a lot

@sjmgarnier
Copy link
Member

@jubelik Can you try with the latest version that I pushed on the main branch last week? This is the version that should fix definitely the issue we were discussing on the trackR repo. You can install it with:

remotes::install_github("swarm-lab/ROpenCVLite")

Note that with this new version, the installation of Cmake is not required anymore for R >= 4.2 since it is included in Rtools now.

@jubelik
Copy link
Author

jubelik commented Jan 8, 2024

I have the same error.

remotes::install_github("swarm-lab/ROpenCVLite")
Downloading GitHub repo swarm-lab/ROpenCVLite@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: cli (3.6.1 -> 3.6.2) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1
cli (3.6.1 -> 3.6.2) [CRAN]
Installing 1 packages: cli
Installing package into ‘C:/Users/jbelik/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/cli_3.6.2.zip'
Content type 'application/zip' length 1340852 bytes (1.3 MB)
downloaded 1.3 MB

package ‘cli’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘cli’
Warning: restored ‘cli’

The downloaded binary packages are in
C:\Users\jbelik\AppData\Local\Temp\Rtmp8kV4Ls\downloaded_packages
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file 'C:\Users\jbelik\AppData\Local\Temp\Rtmp8kV4Ls\remotes5af466ef7316\swarm-lab-ROpenCVLite-c83b8ef/DESCRIPTION' ...
─ preparing 'ROpenCVLite': (573ms)
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
Removed empty directory 'ROpenCVLite/man/figures'
Omitted 'LazyData' from DESCRIPTION
─ building 'ROpenCVLite_4.90.0.tar.gz'
Warning: file 'ROpenCVLite/configure' did not have execute permissions: corrected

Warning: package ‘ROpenCVLite’ is in use and will not be installed
Warning message:
In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying C:\Users\jbelik\AppData\Local\R\win-library\4.3\00LOCK\cli\libs\x64\cli.dll to C:\Users\jbelik\AppData\Local\R\win-library\4.3\cli\libs\x64\cli.dll: Permission denied

ROpenCVLite::installOpenCV()
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
OpenCV will be installed in C:\Users\jbelik\AppData\Local\R\win-library\4.3\ROpenCV
Clearing install path.
trying URL 'https://github.com/opencv/opencv/archive/4.8.0.tar.gz'
Content type 'application/x-gzip' length 91992565 bytes (87.7 MB)
downloaded 87.7 MB

trying URL 'https://github.com/opencv/opencv_contrib/archive/4.8.0.tar.gz'
downloaded 56.5 MB

CMake Warning:
Ignoring extra path from command line:

"C:/Program Files/Files/rtools43/x86_64-w64-mingw32.static.posix/bin/gcc.exe"

CMake Warning:
Ignoring extra path from command line:

"Files/rtools43/usr/bin/make.exe"

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

C:/Program

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:113 (enable_language):
The CMAKE_C_COMPILER:

C:/Program

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/jbelik/AppData/Local/Temp/Rtmp8kV4Ls/opencv-4.8.0/build64/CMakeFiles/CMakeOutput.log".
See also "C:/Users/jbelik/AppData/Local/Temp/Rtmp8kV4Ls/opencv-4.8.0/build64/CMakeFiles/CMakeError.log".
[1] FALSE

@sjmgarnier
Copy link
Member

sjmgarnier commented Jan 8, 2024

@jubelik Actually, I see what the problem is now. You have installed Rtools in C:/Program Files/Files/rtools43/ instead of the recommended location C:/Rtools43/ as per CRAN's recommendation: https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html.

I can see if I can find a workaround for non-standard installation of Rtools but that may take me a few days before I get there.

@jubelik
Copy link
Author

jubelik commented Jan 8, 2024

Even if I install RTools in C:, the installation still doesn't work.

remotes::install_github("swarm-lab/ROpenCVLite@85a94ef", force = TRUE)
Downloading GitHub repo 85a94ef
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: cli (3.6.1 -> 3.6.2) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 3
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file 'C:\Users\jbelik\AppData\Local\Temp\RtmpkTXKzf\remotes1e441662737f\swarm-lab-ROpenCVLite-85a94ef/DESCRIPTION' ...
─ preparing 'ROpenCVLite': (464ms)
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
Removed empty directory 'ROpenCVLite/man/figures'
Omitted 'LazyData' from DESCRIPTION
─ building 'ROpenCVLite_4.80.1.tar.gz'
Warning: file 'ROpenCVLite/configure' did not have execute permissions: corrected

Installing package into ‘C:/Users/jbelik/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)

  • installing source package 'ROpenCVLite' ...
    ** using staged installation
    ** 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 from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
  • DONE (ROpenCVLite)

ROpenCVLite::installOpenCV()
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
OpenCV will be installed in C:\Users\jbelik\AppData\Local\R\win-library\4.3\ROpenCV
Clearing install path.
trying URL 'https://github.com/opencv/opencv/archive/4.8.0.tar.gz'
downloaded 87.7 MB

trying URL 'https://github.com/opencv/opencv_contrib/archive/4.8.0.tar.gz'
downloaded 56.5 MB

-- The CXX compiler identification is GNU 12.3.0
-- The C compiler identification is GNU 12.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/rtools43/x86_64-w64-mingw32.static.posix/bin/g++.exe
-- Check for working CXX compiler: C:/rtools43/x86_64-w64-mingw32.static.posix/bin/g++.exe - works
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/rtools43/x86_64-w64-mingw32.static.posix/bin/gcc.exe
-- Check for working C compiler: C:/rtools43/x86_64-w64-mingw32.static.posix/bin/gcc.exe - works
-- Detecting C compile features
-- Detecting C compile features - done
-- ocv_init_download: OpenCV source tree is not fetched as git repository. 3rdparty resources will be downloaded from github.com by default.
CMake Error at CMakeLists.txt:160 (message):
CMake fails to determine the bitness of the target platform.

Please check your CMake and compiler installation. If you are cross-compiling then ensure that your CMake toolchain file correctly sets the compiler details.

-- Configuring incomplete, errors occurred!
See also "C:/Users/jbelik/AppData/Local/Temp/RtmpkTXKzf/opencv-4.8.0/build64/CMakeFiles/CMakeOutput.log".
See also "C:/Users/jbelik/AppData/Local/Temp/RtmpkTXKzf/opencv-4.8.0/build64/CMakeFiles/CMakeError.log".
make: Entering directory '/c/Users/jbelik/AppData/Local/Temp/RtmpkTXKzf/opencv-4.8.0/build64'
make: *** No targets specified and no makefile found. Stop.
make: Leaving directory '/c/Users/jbelik/AppData/Local/Temp/RtmpkTXKzf/opencv-4.8.0/build64'
make: Entering directory '/c/Users/jbelik/AppData/Local/Temp/RtmpkTXKzf/opencv-4.8.0/build64'
make: *** No rule to make target 'install'. Stop.
make: Leaving directory '/c/Users/jbelik/AppData/Local/Temp/RtmpkTXKzf/opencv-4.8.0/build64'
[1] FALSE

@sjmgarnier
Copy link
Member

@jubelik What's the output of version in the R console?

@jubelik
Copy link
Author

jubelik commented Jan 8, 2024

platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 3.2
year 2023
month 10
day 31
svn rev 85441
language R
version.string R version 4.3.2 (2023-10-31 ucrt)
nickname Eye Holes

@sjmgarnier
Copy link
Member

@jubelik By any chance, is your antivirus (Windows Defender or other) throwing a fit just before this happens?

@sjmgarnier
Copy link
Member

BTW, I also pushed a quick and dirty fix for the non-standard installation path of Rtools. You should be able to test it with:

remotes::install_github("swarm-lab/ROpenCVLite@develop")

@jubelik
Copy link
Author

jubelik commented Jan 8, 2024

No it is not, sorry.
Thanks, I'll try.

@jubelik
Copy link
Author

jubelik commented Jan 8, 2024

remove.packages("ROpenCVLite")
Removing package from ‘C:/Users/jbelik/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)

remotes::install_github("swarm-lab/ROpenCVLite@develop")
Downloading GitHub repo swarm-lab/ROpenCVLite@develop
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: cli (3.6.1 -> 3.6.2) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1
cli (3.6.1 -> 3.6.2) [CRAN]
Installing 1 packages: cli
Installing package into ‘C:/Users/jbelik/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/cli_3.6.2.zip'
Content type 'application/zip' length 1340852 bytes (1.3 MB)
downloaded 1.3 MB

package ‘cli’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘cli’
Warning: restored ‘cli’

The downloaded binary packages are in
C:\Users\jbelik\AppData\Local\Temp\RtmpkTXKzf\downloaded_packages
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file 'C:\Users\jbelik\AppData\Local\Temp\RtmpkTXKzf\remotes1e4438815069\swarm-lab-ROpenCVLite-5d00a06/DESCRIPTION' ...
─ preparing 'ROpenCVLite': (451ms)
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
Removed empty directory 'ROpenCVLite/man/figures'
Omitted 'LazyData' from DESCRIPTION
─ building 'ROpenCVLite_4.90.0.tar.gz'
Warning: file 'ROpenCVLite/configure' did not have execute permissions: corrected

Warning: package ‘ROpenCVLite’ is in use and will not be installed
Warning message:
In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying C:\Users\jbelik\AppData\Local\R\win-library\4.3\00LOCK\cli\libs\x64\cli.dll to C:\Users\jbelik\AppData\Local\R\win-library\4.3\cli\libs\x64\cli.dll: Permission denied

@sjmgarnier
Copy link
Member

@jubelik This looks like an issue with your running R session. Something is held up somewhere. You need to restart R.

@sjmgarnier
Copy link
Member

@jubelik If that still doesn't work, you can contact me at garnier@njit.edu and I can jump on a quick call in the next 30 minutes or so. Might be easier to figure out the issue.

@jubelik
Copy link
Author

jubelik commented Jan 8, 2024

I have to go to another meeting, but if it is still not working in the next few days I'll contact you.
Thanks a lot!!

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

2 participants