[Phylobase-devl] Rcpp and OS X compiliation

Mark Holder mtholder at gmail.com
Tue Jan 12 23:08:15 CET 2010


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).


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:


#################################################################################
R version 2.10.1 (2009-12-14)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

   Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

 > 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

R version 2.10.1 (2009-12-14)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

   Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

 > library(phylobase)
Loading required package: grid
Loading required package: ape
Loading required package: Rcpp
 >
#################################################################################

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).  Are there other Rcpp libraries that I could  
try out to see if they have similar problems on my machine?




cheers,
Mark








More information about the Phylobase-devl mailing list