-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
package dependency problem with mlr and mbo using devtools: load-_all() #1379
Comments
I can not reproduce the problem. If the problem is already solved you can close this issue |
This example obviously can't work. I assume you use (the function mentioned here)[http://stackoverflow.com/questions/7505547/detach-all-packages-while-working-in-r] for |
what xudong reported is a valid problem. but thats a "bug" in lhs, you should report it there. here is the solution for exactly the same problem, read it and know about it |
For those in the future having similar problems: This seems to be a problem that occurs when R unloads shared libraries ("DLLs"). R has a lookup table of DLLs ( I suspect either smilesun's call of Note that, even though the lhs people are in a good position to implement a workaround (the PACKAGE argument mentioned above), this is actually a bug in R (or in devtools, depending on your view). In fact, giving the PACKAGE argument to the A minimal example I constructed: (Start R with the > devtools::load_all("ParamHelpers")
Loading ParamHelpers
> lhs::maximinLHS(n=2, k=2) # implicitly loads lhs dll
[,1] [,2]
[1,] 0.6008410 0.9491948
[2,] 0.4723376 0.3303989
> devtools::load_all("ParamHelpers")
Loading ParamHelpers
> lhs::maximinLHS(n=2, k=2)
Error in .C("maximinLHS_C", as.integer(n), as.integer(k), as.integer(dup), :
"maximinLHS_C" not resolved from current namespace (lhs) Sometimes DLLs get loaded at surprising points, and then a simple (Example includes shell code) (Also note that for this I have "ParamHelpers" installed as regular package, additionally to the "ParamHelpers" git clone) $ mkdir newdir && cd newdir
$ R
> references.lhs.namespace = lhs::maximinLHS # options(error=dump.frames) might do this
> references.ph.namespace = ParamHelpers::makeParamSet
> q("yes") # end this R session
$ R # start R again
> # R loads both namespaces and corresponding libraries
> .dynLibs() # get an (imperfect) view on the lookup table
Filename Dynamic.Lookup
1 /usr/lib64/R/library/methods/libs/methods.so FALSE
2 /usr/lib64/R/library/utils/libs/utils.so FALSE
3 /home/user/library/checkmate/libs/checkmate.so TRUE
4 /usr/lib64/R/library/grDevices/libs/grDevices.so FALSE
5 /usr/lib64/R/library/graphics/libs/graphics.so FALSE
6 /usr/lib64/R/library/stats/libs/stats.so FALSE
7 /home/user/library/BBmisc/libs/BBmisc.so TRUE
8 /home/user/library/ParamHelpers/libs/ParamHelpers.so TRUE
9 /home/user/library/lhs/libs/lhs.so TRUE
> lhs::maximinLHS(n=2, k=2) # works
[,1] [,2]
[1,] 0.6008410 0.9491948
[2,] 0.4723376 0.3303989
> devtools::load_all("../ParamHelpers")
Loading ParamHelpers
> .dynLibs() # note the lhs.so entry has shifted by one
Filename Dynamic.Lookup
1 /usr/lib64/R/library/methods/libs/methods.so FALSE
2 /usr/lib64/R/library/utils/libs/utils.so FALSE
3 /home/user/library/checkmate/libs/checkmate.so TRUE
4 /usr/lib64/R/library/grDevices/libs/grDevices.so FALSE
5 / usr/lib64/R/library/graphics/libs/graphics.so FALSE
6 /usr/lib64/R/library/stats/libs/stats.so FALSE
7 /home/user/library/BBmisc/libs/BBmisc.so TRUE
8 /home/user/library/lhs/libs/lhs.so TRUE
9 /home/user/library/digest/libs/digest.so TRUE
10 /home/user/library/devtools/libs/devtools.so TRUE
11 /usr/lib64/R/library/tools/libs/tools.so FALSE
12 /home/user/library/stringi/libs/stringi.so TRUE
13 /home/user/library/Rcpp/libs/Rcpp.so TRUE
14 /home/user/library/roxygen2/libs/roxygen2.so TRUE
15 /home/user/ParamHelpers/src/ParamHelpers.so TRUE
16 /home/user/library/testthat/libs/testthat.so TRUE
> lhs::maximinLHS(n=2, k=2)
Error in .C("maximinLHS_C", as.integer(n), as.integer(k), as.integer(dup), :
"maximinLHS_C" not resolved from current namespace (lhs) (This was run on a x86_64 linux system) |
my code is
But if I run this twice,
The text was updated successfully, but these errors were encountered: