[Phylobase-devl] Rcpp and OS X compiliation

Mark Holder mtholder at ku.edu
Sun Jan 17 03:57:42 CET 2010


Hi again,

On Jan 15, 2010, at 11:16 AM, Ben Bolker wrote:

> Mark Holder wrote:
>>
>> 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)

I am not having any success getting the library to load by modifying  
DYLD_LIBRARY_PATH from within R.

I can augment the list of paths successfully (with  
Sys.setenv(DYLD_LIBRARY_PATH="/Us..."),
but that doesn't seem to help the loader.  I suspect that you are  
correct that using setenv is simply too late.

According to "Writing R extensions
${R_HOME}/etc/${R_ARCH}/ldpaths is sourced before the R process is  
launched.

On my machine this is:
	/Library/Frameworks/R.framework/Resources/etc/i386/ldpaths

This file adds ${R_HOME}/lib/${R_ARCH} to the dynamic load library  
path list (one an intel-mac this is /Library/Frameworks/R.framework/ 
Resources/lib/i386). This directory contains libR.dylib,  
libRblas.dylib, and  libRlapack.dylib on my machine.

I can get phylobase to run if I do any one of the  following four  
things:
	1. Add ~/Library/R/2.10/library/Rcpp/lib/i386 to the user's env  
before calling R
	2. Add ~/Library/R/2.10/library/Rcpp/lib/i386 to DYLD_LIBRARY_PATH in  
the /Library/Frameworks/R.framework/Resources/etc/i386/ldpaths file
	3. Copy ~/Library/R/2.10/library/Rcpp/lib/i386/libRcpp.dylib to  / 
Library/Frameworks/R.framework/Resources/lib/i386
	4. Copy ~/Library/R/2.10/library/Rcpp/lib/i386/libRcpp.dylib to /usr/ 
local/lib




On Jan 15, 2010, at 11:56 AM, Dirk Eddelbuettel wrote:
>  [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).
>
> The idea (originally suggested by Simon Urbanek who also supplied  
> quite some
> help in getting the dylib business right) was that from an R prompt  
> (or shell
> prompt via Rscript / littler) you could call Rcpp itself by using the
> functions
>
> 	  Rcpp:::CxxFlags()
> 	  Rcpp:::LdFlags()

Sorry for the confusion -- I meant to say the "loader not finding"  
rather than "linker not finding".  It links, but the loading fails. So  
I think that your Rcpp:::LdFlags() is working.



[snip]
>
> ( Building RQuantLib munges a lot CPU because QuantLib so huge.  And  
> you'd
> need Quantlib (Debian/ Ubuntu do. So this may be easier to look at  
> than to
> try to run at your end. )

You were not kidding -- I've never seen a library as big as QuantLib!   
I did get it installed.

I see the same errors with running RQuantLib from an unaltered env  
that I do for phylobase:

###################################
$ R CMD check  pkg
* checking for working pdflatex ... OK
* using log directory '/Users/mholder/builds/rin/rquantlib/pkg.Rcheck'
[snip]
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... ERROR

Loading required package: Rcpp
Error in dyn.load(file, DLLpath = DLLpath, ...) :
   unable to load shared library '/Users/mholder/builds/rin/rquantlib/ 
pkg.Rcheck/RQuantLib/libs/i386/RQuantLib.so':
   dlopen(/Users/mholder/builds/rin/rquantlib/pkg.Rcheck/RQuantLib/ 
libs/i386/RQuantLib.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/builds/rin/rquantlib/pkg.Rcheck/ 
RQuantLib/libs/i386/RQuantLib.so
   Reason: image not found
Error in library(RQuantLib) : .First.lib failed for 'RQuantLib'
Execution halted

###################################

If I can install and then I add the parent of libRcpp.dylib to my  
DYLD_LIBRARY_PATH, then library(RQuantLib) succeeds.


I looked at https://r-forge.r-project.org/R/?group_id=111&log=check_x86_64_mac&pkg=RQuantLib&flavor=patched
which indicates no problems.

Could it be that it is the
"Additional arguments to R CMD check: --install=fake"
line that explains why this build-bot is succeeding while phylobase's  
is failing?

I tried adding that --install-args="--install=fake" but that never  
seemed to result in a "Additional arguments to R CMD check: ..."  
statement in the output.


all the best,
Mark






Mark Holder

mtholder at ku.edu
http://www.people.ku.edu/~mtholder/

==============================================
Department of Ecology and Evolutionary Biology
University of Kansas
6031 Haworth Hall
1200 Sunnyside Avenue
Lawrence, Kansas 66045

lab phone:  785.864.5789

fax (shared): 785.864.5860
==============================================









More information about the Phylobase-devl mailing list