krlmlr / r-appveyor

Tools for using R with AppVeyor (https://appveyor.com)
132 stars 60 forks source link

LoadLibrary failure: The specified module could not be found #171

Open sjmgarnier opened 4 years ago

sjmgarnier commented 4 years ago

This happens during the installation check for Rvision (https://ci.appveyor.com/project/sjmgarnier/rvision):

** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'Rvision' in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'C:/projects/rvision/Rvision.Rcheck/00LOCK-Rvision/00new/Rvision/libs/x64/Rvision.dll':
  LoadLibrary failure:  The specified module could not be found.

The package relies on OpenCV being compiled through ROpenCVLite (installed from CRAN) first, but I'm pretty certain that the problem is not there as this step goes smoothly and there are no compilation error during the installation of Rvision (the compilation part concludes with installing to C:/projects/rvision/Rvision.Rcheck/00LOCK-Rvision/00new/Rvision/libs/x64). Also, I don't have this issue when compiling on my Windows 10 laptop (it passes all tests), so I'm assuming the problem lies with the Windows version shipping with appveyor (Windows Server 2012 R2) and a missing dll somewhere. Is there a way to find out which dll is missing in the appveyor config? I'm not too well versed in developing for Windows, so any guidance would be very much appreciated.

Thanks for your help!

sjmgarnier commented 4 years ago

Tagging @muschellij2

gaborcsardi commented 4 years ago

Use dependency walker on your laptop to see which DLLs are needed.

muschellij2 commented 4 years ago

Check out https://stackoverflow.com/questions/13497222/the-specified-module-could-not-be-found-in-r for some help

Likely unrelated, but I saw Python failure in the check (does ROpenCVLite require Python 3.2 now?)

[00:01:35] -- Found PythonInterp: C:/Python27/python.exe (found suitable version "2.7.17", minimum required is "2.7") 
[00:01:35] -- Found PythonLibs: C:/Windows/System32/python27.dll (found suitable exact version "2.7.17") 
[00:01:35] Traceback (most recent call last):
[00:01:35]   File "<string>", line 1, in <module>
[00:01:35] ImportError: No module named numpy.distutils
[00:01:35] -- Could NOT find PythonInterp: Found unsuitable version "2.7.17", but required is at least "3.2" (found C:/Python27/python.exe)
sjmgarnier commented 4 years ago

@gaborcsardi Thanks! Not sure why but Dependency Walker just hangs and becomes not responsive when I try to open the Rvision.dll file.

sjmgarnier commented 4 years ago

@muschellij2 Yeah, I saw that. See my answer to @gaborcsardi above. Dependency Walker doesn't seem to be of much use as it just hangs and never produces any output.

Re: Python. I believe it doesn't matter in this case. OpenCV compiles just fine. I'm pretty sure it's another library that's missing.

sjmgarnier commented 4 years ago

@gaborcsardi I figured out how to get Dependency Walker after all. I'm just an idiot apparently :-) I'm closing this now because the missing dll are not related to r-appveyor I believe.

sjmgarnier commented 4 years ago

Reopening this issue. As stated before, there is an error during this stage of the R CMD check process: * checking whether package 'Rvision' can be installed ... ERROR. The error is due to apparently missing OpenCV DLLs (OpenCV being compiled through ROpenCVLite) as reported by Dependency Walker. However, the DLLs are actually present on the appveyor system at their expected location. Furthermore, when using remotes::install_github, everything goes well and the package can be compiled, installed and loaded without any issue on the appveyor system. Finally, R CMD check does not report any error on my local Windows 10 laptop.

Any idea why the installation process would fail during R CMD check on appveyor but not during remotes::install_github?

muschellij2 commented 4 years ago

Did you try to set up an appveyor build that ran the installer on that system?

On Sun, Dec 29, 2019 at 12:38 AM Simon Garnier notifications@github.com wrote:

Reopening this issue. As stated before, there is an error during this stage of the R CMD check process: * checking whether package 'Rvision' can be installed ... ERROR. The error is due to apparently missing OpenCV DLLs (OpenCV being compiled through ROpenCVLite) as reported by Dependency Walker. However, the DLLs are actually present on the appveyor system at their expected location. Furthermore, when using remotes::install_github, everything goes well and the package can be compiled, installed and loaded without any issue on the appveyor system. Finally, R CMD check does not report any error on my local Windows 10 laptop.

Any idea why the installation process would fail during R CMD check on appveyor but not during remotes::install_github?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/krlmlr/r-appveyor/issues/171?email_source=notifications&email_token=AAIGPLSONQPDANGXCNI55RDQ3AZUJA5CNFSM4J65SUKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYYNYI#issuecomment-569476833, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLUFJ2VZBVAYRRE73KLQ3AZUJANCNFSM4J65SUKA .

-- Best, John

sjmgarnier commented 4 years ago

@muschellij2 Yes, it's exactly what I did. No issue to install and load the package. The problem only appears during R CMD check on appveyor.

muschellij2 commented 4 years ago

Can you try without stages installation

The ‘StagedInstall’ logical field controls if package installation is ‘staged’, that is done to a temporary location and moved to the final location when successfully completed. This field was introduced in R 3.6.0 and it true by default: it is considered to be a temporary measure which may be withdrawn in future.

On Sun, Dec 29, 2019 at 6:36 PM Simon Garnier notifications@github.com wrote:

@muschellij2 https://github.com/muschellij2 Yes, it's exactly what I did. No issue to install and load the package. The problem only appears during R CMD check on appveyor.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/krlmlr/r-appveyor/issues/171?email_source=notifications&email_token=AAIGPLRFPO6ST5LUMBAVM4TQ3EYBHA5CNFSM4J65SUKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHZK4AQ#issuecomment-569552386, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLR6T2UUFBVRQB3VPK3Q3EYBHANCNFSM4J65SUKA .

-- Best, John

sjmgarnier commented 4 years ago

@muschellij2 No luck with a non-staged installation. It fails on appveyor with the same error. Still no problem on my local Windows 10 machine.