[R-pkg-devel] Can't build package but can load it with devtools::load_all()

Satyaprakash Nayak sn248 at cornell.edu
Mon Aug 1 05:32:27 CEST 2016


Hi

I am trying to build a package with interfaces with C library libSBML
<http://sbml.org/Software/libSBML> (although a package libSBML exists).
When I try to build the package using "Clean and Rebuild" command in
RStudio, I am getting the following error

** R
> ** preparing package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** testing if installed package can be loaded
> Error in dyn.load(file, DLLpath = DLLpath, ...) :
>   unable to load shared object
> '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcppsbml/libs/Rcppsbml.so':
>
> dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcppsbml/libs/Rcppsbml.so,
> 6): Library not loaded: libsbml.5.dylib
>   Referenced from:
> /Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcppsbml/libs/Rcppsbml.so
>   Reason: image not found
> Error: loading failed
> Execution halted
> ERROR: loading failed
> * removing
> ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcppsbml’
> Exited with status 1.


However, if I issue the command

devtools::load_all()

after "Clean and Rebuild" command, I get the message

Loading Rcppsbml


and I can also use the functions defined in the package! However, as soon
as I restart my R session, I cannot load the library (understandable, as I
don't think the package is built correctly).

Based on the error shown, I think libsbml.5.dylib is not being loaded,
however, it is there in the /usr/local/lib folder.

The code for this package can be found at

https://github.com/sn248/Rcppsbml

Any help in resolving this error would be highly appreciated!

Thank you
Satyaprakash Nayak

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list