[Rd] package has a loading problem

Mathieu Ribatet mathieu.ribatet at epfl.ch
Thu Jul 10 10:47:58 CEST 2008


Have you create a zzz.R file in the R folder? I think your issue is 
related to this...

Example of the zzz.R file:

".First.lib" <-
function(lib, pkg)
{
  library.dynam("your_pkd_name", package = pkg, lib.loc = lib)
  return(invisible(0))
}

This is required when you have C/Fortran code. See the writing R 
extension manual.
Best,
Mathieu

Yulia Arzhaeva a écrit :
> Hello,
>
> I have difficulties in finding why I cannot load a custom R package in
> Linux (Suse 10). When I run R CMD check for a package source folder I
> get the following message:
> ".....
> Error in dyn.load(file, ...) :
>   unable to load shared library
> '/home/yarz/projects/Riman/Riman.Rcheck/Riman/libs/Rimanlib.so':
>   /home/yarz/projects/Riman/Riman.Rcheck/Riman/libs/Rimanlib.so:
> undefined symbol: immagnify
> Error in library(Riman) : .First.lib failed for 'Riman'
> Execution halted
>
> It looks like this package has a loading problem: see the messages for
> details.  "
>
> The same message I get when I call library(Riman) inside R after
> installation of the package.
> The installation via R CMD INSTALL caused no error messages. However,
> Riman.so had been built before R CMD INSTALL was called, and put into
> the source subfolder Riman/inst/libs. It was built via a usual gcc
> call and linked with all the necessary libraries (so it is weird that
> references seemed to be undefined).
>
> The strange thing is that when I borrow Riman.so built by some other
> person in my group and replace my copy with it, loading problem
> disappears!  We both use the same server with Linux Suse 10, the same
> R installation, the same version of gcc and the same Makefiles for
> building Riman.so . We went through variables I might have omitted to
> set correctly, but they seemed OK.
>
> If you could give me any hint on what might be a problem, where else
> to look, I would be very happy. Many thanks in advance.
>
> Regards,
> Yulia
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>   

-- 
Institute of Mathematics
Ecole Polytechnique Fédérale de Lausanne
STAT-IMA-FSB-EPFL, Station 8
CH-1015 Lausanne   Switzerland
http://stat.epfl.ch/
Tel: + 41 (0)21 693 7907



More information about the R-devel mailing list