[Phylobase-devl] Rcpp and OS X compiliation
Ben Bolker
bolker at ufl.edu
Fri Jan 15 18:16:13 CET 2010
Mark Holder wrote:
> Hi folks,
> Thanks to Brian for helping me get up and running on this.
>
> Here is what I'm seeing on Mac 10.5.8 with R 2.10.1.
>
> I ran
> #############################
> $ R
> > install.packages(c("ape", "Rcpp"))
> Warning in install.packages(c("ape", "Rcpp")) :
> argument 'lib' is missing: using '/Users/mholder/Library/R/2.10/
> library'
> ....
> #############################
> despite the warning it ran (I'm not R-savvy enough to know if this
> indicates a problem).
No. It's putting the package in a default location (why it issues a
warning in this case is another conversation).
> I was able to call library(Rcpp) and library(ape) from within R with
> no errors.
>
>
> I then ran:
> ########################
> $ svn checkout svn://svn.r-forge.r-project.org/svnroot/phylobase
> ...
> $ cd phylobase
> $ R CMD INSTALL pkg
> * installing to library ‘/Users/mholder/Library/R/2.10/library’
> * installing *source* package ‘phylobase’ ...
> ...
> ########################
> There was lots of configure and make output, of course.
> Of note to me were the
>
> -L/Users/mholder/Library/R/2.10/library/Rcpp/lib/i386 -lRcpp flags in
> the linking step command.
>
>
> I did get a ld warning: duplicate dylib /usr/local/lib/libgcc_s.1.dylib
>
> but the build exited without error.
>
> When I try to import phylobase I get an error similar to the one seen
> on https://r-forge.r-project.org/R/?group_id=111&log=check_x86_64_mac&pkg=phylobase&flavor=patched
>
> Specifically I see:
>
>
[snip]
> library(phylobase)
> Loading required package: grid
> Loading required package: ape
> Loading required package: Rcpp
> Error in dyn.load(file, DLLpath = DLLpath, ...) :
> unable to load shared library '/Users/mholder/Library/R/2.10/
> library/phylobase/libs/i386/phylobase.so':
> dlopen(/Users/mholder/Library/R/2.10/library/phylobase/libs/i386/
> phylobase.so, 6): Library not loaded: /Builds/Rdev-web/QA/Simon/
> packages/tiger-universal/Rlib/2.10/Rcpp/lib/i386/libRcpp.dylib
> Referenced from: /Users/mholder/Library/R/2.10/library/phylobase/
> libs/i386/phylobase.so
> Reason: image not found
> Error: package/namespace load failed for 'phylobase'
>
> #################################################################################
>
>
> But if I alter my shell's env to contain the path to libRcpp.dylib
> then it works:
>
> #################################################################################
> $ ls /Users/mholder/Library/R/2.10/library/Rcpp/lib/i386/
> Rcpp RcppCommon.h RcppDateVector.h
> RcppDatetimeVector.h RcppFunction.h RcppMatrix.h
> RcppNumList.h RcppResultSet.h RcppStringVector.h
> RcppVector.h libRcpp.a
> Rcpp.h RcppDate.h RcppDatetime.h
> RcppFrame.h RcppList.h RcppMatrixView.h
> RcppParams.h RcppSexp.h RcppStringVectorView.h
> RcppVectorView.h libRcpp.dylib
> $ export DYLD_LIBRARY_PATH=/Users/mholder/Library/R/2.10/library/Rcpp/
> lib/i386
> $ r
>
[snip successful attempt]
>
> So it appears to be an issue of the dynamic linker not finding the
> right version of libRcpp.dylib
>
>
> I'm not sure how to fix it other than altering the user's env (which
> is obviously not ideal).
No, but it might be an interim hack: R has Sys.getenv() and
Sys.setenv() which might be usable ? (although they might have to be
called too early in the package-loading process)
> Are there other Rcpp libraries that I could
> try out to see if they have similar problems on my machine?
http://cran.r-project.org/web/packages/Rcpp/index.html says
Reverse depends: RInside, RQuantLib
so you could try those ...
cheers
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.r-forge.r-project.org/pipermail/phylobase-devl/attachments/20100115/70888559/attachment.pgp
More information about the Phylobase-devl
mailing list