Frank E Harrell Jr
2004-Jun-01 03:34 UTC
[Rd] Problem with .First.lib while running R CMD check
I am having difficulty running R CMD check using the 30May04 version of
R-devel and a new version of the Hmisc package:
* checking S3 generic/method consistency ... WARNING
Error in .tryQuietly({ : Error in library(package, lib.loc = lib.loc,
character.only = TRUE, verbose = FALSE) :
.First.lib failed
Execution halted
See section 'Generic functions and methods' of the 'Writing R
Extensions'
manual.
* checking for replacement functions with final arg not named 'value'
... WARNING
Error in .tryQuietly({ : Error in library(package, lib.loc = lib.loc,
character.only = TRUE, verbose = FALSE) :
.First.lib failed
Execution halted
* checking foreign function calls ... WARNING
Error in .tryQuietly({ : Error in library(package, lib.loc = lib.loc,
character.only = TRUE, verbose = FALSE) :
.First.lib failed
Execution halted
Here is the .First.lib in question:
.First.lib <- function(lib, pkg, verbose=TRUE, ...) {
if(verbose)
cat("Hmisc library by Frank E Harrell Jr\n\n",
"Type library(help='Hmisc'), ?Overview, or
?Hmisc.Overview')\n",
"to see overall documentation.\n\n",
"Hmisc redefines [.factor to drop unused levels of factor
variables\n",
"when subscripting. To prevent this behaviour, issue the
command\n",
"options(drop.unused.levels=F).\n\n",
sep='')
library.dynam("Hmisc", pkg, lib)
invisible()
}
Per an earlier suggestion from Kurt Hornik I tried ./configure
--enable-shared when building R-devel (I'm running on Debian linux
unstable/testing (Knoppix 3.4)) but this did not fix the problem. The
Hmisc.so file looks like:
~/R/Hmisc.Rcheck/Hmisc/libs harrelfe:ls -la
-rwxr-xr-x 1 harrelfe harrelfe 37524 2004-05-31 18:31 Hmisc.so
Under R-devel I can source('~/R/Hmisc.Rcheck/Hmisc/R/Hmisc') with no
errors.
I would appreciate any help.
Thanks,
Frank
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
Martin Maechler
2004-Jun-01 08:32 UTC
[Rd] Problem with .First.lib while running R CMD check
>>>>> "Frank" == Frank E Harrell <f.harrell@vanderbilt.edu> >>>>> on Mon, 31 May 2004 18:44:55 +0200 writes:Frank> I am having difficulty running R CMD check using the Frank> 30May04 version of R-devel and a new version of the Frank> Hmisc package: Frank> * checking S3 generic/method consistency ... WARNING Frank> Error in .tryQuietly({ : Error in library(package, lib.loc = lib.loc, Frank> character.only = TRUE, verbose = FALSE) : Frank> .First.lib failed Frank> Execution halted Frank> See section 'Generic functions and methods' of the Frank> 'Writing R Extensions' manual. I'm not sure, but I'd guess it's simply the last line of your .First.lib. that fails, i.e., library.dynam("Hmisc", pkg, lib) which fails loading the C/Fortran code. I've had similar experiences. The 'R CMD check' error message is definitely ``sub optimal''. Simply try (in R-devel) library(Hmisc, lib.loc="~/R/Hmisc.Rcheck") This should give a much better error message. Let us know if this helped. Regards, Martin