[ADMB Users] new version of R2admb on R-forge
Motoki Wu
tokestermw at gmail.com
Thu Aug 19 16:02:08 PDT 2010
Hi Ben,
I got a different error this time (posted below), assuming this is the code you're referring to: https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/R/admb-funs.R?revision=25&root=r2admb
But I think it's just a simple typo. In your new do_admb(), the arguments in the following line of code needs to be flipped:
sapply(warning,admb_warnings)
After fixing this, it worked!
- Motoki
##### ------- old version
> do_admb("simple2", data = list(nobs = length(x), Y = y, x = x), params = list(a = 2, b = 1), verbose = T, checkparam = "ignore", checkdata = "ignore", objfunname = "f", clean = T, safe = F)
compiling with args: ' ' ...
compile output:
*** tpl2cpp simple2 *** adcomp simple2 g++ -c -O3 -Wno-deprecated -D__GNUDOS__ -Dlinux -DOPT_LIB -DUSE_LAPLACE -fpermissive -I. -I/opt/local/admb/include simple2.cpp *** adlink simple2 g++ -s -L/opt/local/admb/lib simple2.o -ldf1b2o -ladmod -ladt -lado -ldf1b2o -ladmod -ladt -lado -o simple2
compile log:
ld: warning: option -s is obsolete and being ignored
Error in do_admb("simple2", data = list(nobs = length(x), Y = y, x = x), :
errors detected in compilation: run with verbose=TRUE to view
> traceback()
2: stop("errors detected in compilation: run with verbose=TRUE to view")
1: do_admb("simple2", data = list(nobs = length(x), Y = y, x = x),
params = list(a = 2, b = 1), verbose = T, checkparam = "ignore",
checkdata = "ignore", objfunname = "f", clean = F)
###### ------- new version
> do_admb("simple2", data = list(nobs = length(x), Y = y, x = x), params = list(a = 2, b = 1), verbose = T, checkparam = "ignore", checkdata = "ignore", objfunname = "f", clean = T, safe = F)
compiling with args: ' ' ...
compile output:
*** tpl2cpp simple2 *** adcomp simple2 g++ -c -O3 -Wno-deprecated -D__GNUDOS__ -Dlinux -DOPT_LIB -DUSE_LAPLACE -fpermissive -I. -I/opt/local/admb/include simple2.cpp *** adlink simple2 g++ -s -L/opt/local/admb/lib simple2.o -ldf1b2o -ladmod -ladt -lado -ldf1b2o -ladmod -ladt -lado -o simple2
compile log:
ld: warning: option -s is obsolete and being ignored
Error in get(as.character(FUN), mode = "function", envir = envir) :
object 'from ADMB: ld: warning: option -s is obsolete and being ignored' of mode 'function' was not found
> traceback()
4: get(as.character(FUN), mode = "function", envir = envir)
3: match.fun(FUN)
2: sapply(warning, admb_warnings)
1: do_admb("simple2", data = list(nobs = length(x), Y = y, x = x),
params = list(a = 2, b = 1), verbose = T, checkparam = "ignore",
checkdata = "ignore", objfunname = "f", clean = T, safe = T)
####### ------ fixed new version
> do_admb("simple2", data = list(nobs = length(x), Y = y, x = x), params = list(a = 2, b = 1), verbose = T, checkparam = "ignore", checkdata = "ignore", objfunname = "f", clean = T, safe = F)
compiling with args: ' ' ...
compile output:
*** tpl2cpp simple2 *** adcomp simple2 g++ -c -O3 -Wno-deprecated -D__GNUDOS__ -Dlinux -DOPT_LIB -DUSE_LAPLACE -fpermissive -I. -I/opt/local/admb/include simple2.cpp *** adlink simple2 g++ -s -L/opt/local/admb/lib simple2.o -ldf1b2o -ladmod -ladt -lado -ldf1b2o -ladmod -ladt -lado -o simple2
compile log:
ld: warning: option -s is obsolete and being ignored
writing data and parameter files ...
running compiled executable with args: ' '...
Run output:
Initial statistics: 2 variables; iteration 0; function evaluation 0
Function value 8.0025892e+01; maximum gradient component mag 6.8268e+00
Var Value Gradient |Var Value Gradient |Var Value Gradient
1 2.00000 6.82682e+00 | 2 1.00000 1.12079e+00 |
- final statistics:
2 variables; iteration 7; function evaluation 12
Function value 6.9985e+01; maximum gradient component mag 2.0435e-06
Exit code = 1; converg criter 1.0000e-04
Var Value Gradient |Var Value Gradient |Var Value Gradient
1 -1.15391 2.04351e-06 | 2 8.90396 7.37683e-08 |
Estimating row 1 out of 2 for hessian
Estimating row 2 out of 2 for hessian
reading output ...
Warning message:
In lapply(X, FUN, ...) :
from ADMB: ld: warning: option -s is obsolete and being ignored
On Aug 19, 2010, at 10:41 AM, Ben Bolker wrote:
> dave fournier wrote:
>> You are getting the message
>>
>> cred <- coutfile[!substr(coutfile, 1, 85) %in% c("cat:
>> xxalloc4.tmp: No such file or directory",
>> "cat: xxalloc5.tmp: No such file or directory", "Error
>> executing command cat xxglobal.tmp xxhtop.tmp header.tmp
>> xxalloc1.tmp x")]
>>
>> because the indicated file is only created when using a particular
>> option in the tpl file. It is not really an error because everything is
>> working fine.
>
> It's a bit confusing, but the R error actually occurred (I think) due
> to the warning about safe mode ("-s") being obsolete/redundant. I've
> added an (UNTESTED) bit of code on SVN that's supposed to pass warnings
> from ADMB through to R's warning() system rather than considering them
> errors and stopping. The complicated bit that Motoki quoted is used to
> avoid an error when those (non-error) error messages pop up, by
> explicitly ignoring them.
>
> Motoki, could you test the latest version with safe=TRUE and
> safe=FALSE and see if it works properly (i.e. warning when safe=TRUE,
> running cleanly when safe=FALSE) ... ? (If I knew how to easily provoke
> a non-fatal warning from ADMB, I would test it myself ...)
>
> It would be really nice (wish list) if things that are not really
> errors would not produce error messages ... that would help those of us
> who are relatively new to ADMB and hence relatively clueless focus on
> the things that are really wrong with our models ...
>
> cheers
> Ben Bolker
>
More information about the Users
mailing list