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

unable to load certain libraries in plr Windows 10 #27

Closed
ralikwen opened this issue Sep 21, 2016 · 13 comments
Closed

unable to load certain libraries in plr Windows 10 #27

ralikwen opened this issue Sep 21, 2016 · 13 comments

Comments

@ralikwen
Copy link

I am unable to load certain libraries in plr in windows 10.
They fail with the following error message:

ERROR:  R interpreter expression evaluation error
DETAIL:  Error: package or namespace load failed for '[libname]'
CONTEXT:  In PL/R function export

Libraries so far that I found to fail are: reshape, reshape2, lattice, hexbin, testthat, Matrix
These libraries are usable from R itself.
At the same time other libraries installed the same way, and located at the same place load with no problem, eg: curl, foreach, MASS, knitr, yaml

I am running

Postgres 9.4 on Windows 10
R - 3.3.1
dir: C:\Program Files\R\R-3.3.1\library
R_HOME from Select * From plr_environ() is C:\Program Files\R\R-3.3.1

I also tried this with Postgres 9.5 and got the same error.
There is no similar problem on my production Debian machine.
I don't even know where to begin investigating.

(I have sent this same message to the mailing list as well. I am sorry for double posting but I am uncertain now what forum should I be using for issues.)

Thanks for any help.
Balázs

@davecramer
Copy link
Collaborator

So the real challenge we have with this is finding a windows 10 box to
debug on.

I suspect what is happening is a library load error within the modules that
aren't loading but have no way of verifying that.

Dave Cramer

On 21 September 2016 at 04:41, Balázs Klein notifications@github.com
wrote:

I am unable to load certain libraries in plr in windows 10.
They fail with the following error message:

ERROR: R interpreter expression evaluation error
DETAIL: Error: package or namespace load failed for '[libname]'
CONTEXT: In PL/R function export

Libraries so far that I found to fail are: reshape, reshape2, lattice,
hexbin, testthat, Matrix
These libraries are usable from R itself.
At the same time other libraries installed the same way, and located at
the same place load with no problem, eg: curl, foreach, MASS, knitr, yaml

I am running

Postgres 9.4 on Windows 10
R - 3.3.1
dir: C:\Program Files\R\R-3.3.1\library
R_HOME from Select * From plr_environ() is C:\Program Files\R\R-3.3.1

I also tried this with Postgres 9.5 and got the same error.
There is no similar problem on my production Debian machine.
I don't even know where to begin investigating.

(I have sent this same message to the mailing list as well. I am sorry for
double posting but I am uncertain now what forum should I be using for
issues.)

Thanks for any help.
Balázs


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#27, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAYz9r2ZNUq-9ENYRgEWTNemCVMAwxO-ks5qsO2ggaJpZM4KCilS
.

@ralikwen
Copy link
Author

Unfortunately I am completely unfamiliar with debugging.
Is there a log, dump or similar file that I could send or look at to untangle this?

@davecramer
Copy link
Collaborator

Unfortunately no.

Could you try creating an R program which attempts to load the same
libraries directly in R run from the command line ? Admittedly this is a
hail mary.

Dave Cramer

On 21 September 2016 at 08:58, Balázs Klein notifications@github.com
wrote:

Unfortunately I am completely unfamiliar with debugging.
Is there a log, dump or similar file that I could send or look at to
untangle this?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#27 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAYz9n9lBOuhub5RIQX7j6T9VnL-_A_pks5qsSn6gaJpZM4KCilS
.

@ralikwen
Copy link
Author

the single line library('reshape2')
executes without error in RStudio or in the R command line
but fails within a plr function

@jconway
Copy link
Owner

jconway commented Sep 21, 2016

Can you try this either with the R path "C:\R\R-3.3.1\library" (no spaces) on your Windows box, or alternatively using path "/Program Files/R/R-3.3.1/library" (with space in path) on a Debian system to see how it behaves? I can try the latter at some point but will not have time for a while...

@ralikwen
Copy link
Author

I can try the former one. Will let you know about the results.

@ralikwen
Copy link
Author

I uninstalled and reinstalled R into "C:\R\R-3.3.1" and changed the R_HOME variable. SELECT * FROM plr_environ() returns now with the new R_HOME value. Unfortunately the error remains: in a plr function library('catR') returns OK, but library('reshape2') gives the same error as before.

@jconway
Copy link
Owner

jconway commented Nov 8, 2016

All of the failing packages look like they import other packages, whereas the ones that do not fail are standalone -- is that correct? Since the imported packages are also in DLL files, please try putting the R library directory (location of all of these package DLLs) into your system PATH environment variable. If I remember correctly I have seen that needed before.

@ralikwen
Copy link
Author

ralikwen commented Nov 8, 2016

Thanks for the idea, I have now tried that, but unfortunately it did not help.

I now have the following directories in my system PATH variable:
C:\R\R-3.3.1
C:\R\R-3.3.1\bin\x64;
C:\R\R-3.3.1\library\reshape2\libs\x64;
C:\R\R-3.3.1\library\reshape2\libs;
C:\R\R-3.3.1\library\reshape2;
C:\R\R-3.3.1\library;

also tried adding:
C:\R\R-3.3.1\library\reshape2\libs\i386;

I restarted the machine.

library(catR) succeeds,
but library(reshape2) - still fails.

Please let me know if there is anything else I could try.
Thx.

@jconway
Copy link
Owner

jconway commented Nov 8, 2016

Yesterday I tried library('lattice') in a plr function on my own Win10 VM and it loaded perfectly, even though I do not have the DLL dirs in the PATH. So apparently that is not the issue.

Is there anything none standard with your install other than moving the installation directory? I assume you got the R via CRAN for example?

@ralikwen
Copy link
Author

ralikwen commented Nov 8, 2016

library('lattice') runs fine for me too
could you try library('reshape') - that fails for me
I don't think I have anything non-standard with my R installation

@jconway
Copy link
Owner

jconway commented Dec 22, 2016

sorry for the long delay, but this works fine for me also so I am still at a loss as to what the problem could be:

CREATE OR REPLACE FUNCTION public.testplr()
RETURNS text AS
$BODY$library('reshape'); return ("ok")$BODY$
LANGUAGE plr;

@ralikwen
Copy link
Author

ralikwen commented Jan 6, 2017

if that works fine on your box than it must be something with the setup of mine
sorry for the bother

@ralikwen ralikwen closed this as completed Jan 6, 2017
petere pushed a commit to petere/plr that referenced this issue Oct 26, 2018

* use appveyor to create windows dll any tag will create a new release with that tag name the dll will automatically be uploaded to the release. Currently the repo now has msvc.diff in it to allow building, this will have to be kept in sync for appveyor to build. The build environment is Visual C++ 2013
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

3 participants