[Phylobase-devl] New phylobase build approach using static libncl (Was: Rcpp and OS X compiliation)

Peter Cowan pdc at berkeley.edu
Mon Mar 1 07:19:36 CET 2010


On Feb 28, 2010, at 7:24 PM, Dirk Eddelbuettel wrote:

> 
> On 28 February 2010 at 16:27, Peter Cowan wrote:
> | On Feb 27, 2010, at 11:55 AM, François Michonneau wrote:
> | 
> | > If I remember correctly, none of the nexus files that are included in
> | > the package work (pkg/inst/nexusfiles). The only file that I can get
> | > to work is the example file that's on the NCL website
> | > (http://hydrodictyon.eeb.uconn.edu/ncl/#readerdata).
> | 
> | There is definitely some weirdness going on.  I tried to debug this a
> | little bit, but the fix and rebuild the whole package cycle to test is
> | pretty tedious.  Are there suggestions for how to shorten it up?  Using R
> | CMD SHLIB on a single file and trying to load that (unsurprisingly) doesn't
> | work. 
> 
> It can as in 
> 
>   R CMD SHLIB foo.c   # create foo.so
> 
> and in R
> 
>   dyn.load("foo.so")
> 
> but you are much better off using the inline package along with Rcpp.

I'll take a look at the inline package, thanks.

> | I attempted briefly to build a standalone NCL program to check the output,
> | but my C++ isn't good enough to make this practical.  Is there such a
> | program out there, with available source for us to study from? 
> 
> I would need context-specific help as well. I can help with R / C++ side...
> 
> | The inst/nexusfiles folder contains: co1.nex, MultiLineTrees.nex, treepluscharV01.nex
> | 
> | The first two didn't work, but the last one partially works.  I get a tree that looks like expected, but there is something clearly off with the data portion.
> | 
> | 1. readNexus(file, type=all) returns a phylo4 instead of a phylo4d
> | 2. readNexus(file, type=data) returns the following dataframe regardless of what file it's called on (I tried to do a search on the whole package for "Girth" but didn't find anything).   Even a non-nexus file produces this output.
> 
> It is the standard 'trees' dataset. See help(trees) in R.
> 
> It may be a bug here in readNexus:
> 
>    if (type == "tree" || length(tipdata) == 0 ) {
>        output <- trees
>    }
> 
> that 'trees' is returned from the global environment rather than the local
> tree structure that may have gotten filled.

Thanks for pointing this out, I hadn't known about the trees dataset.  I'll make sure to fix this and remember to avoid using that variable name.

> 
> | Lastly, is there a way to control the output though Rcpp or otherwise, a
> | fair bit of what appears to be stderr gets printed in the R console, it'd
> | be nice to control this.
> 
> Sure. From C++ I use things like this 
> 
> // simple logging help
> inline void logTxtFunction(const char* file, const int line, const char* expression); 
> 
> #ifndef logTxt
> //#define logTxt(x) logTxtFunction(__FILE__, __LINE__, x);
> #define logTxt(x) 
> #endif
> 
> If you undef the first form of logTxt(x) then the logging macros gets activated.

Thanks for the pointer.  And, thanks for your patient help w/ our C++ issues.

Peter


> Hth,  Dirk
> 
> | Peter
> | 
> |    Girth Height Volume
> | 1    8.3     70   10.3
> | 2    8.6     65   10.3
> | 3    8.8     63   10.2
> | 4   10.5     72   16.4
> | 5   10.7     81   18.8
> | 6   10.8     83   19.7
> | 7   11.0     66   15.6
> | 8   11.0     75   18.2
> | 9   11.1     80   22.6
> | 10  11.2     75   19.9
> | 11  11.3     79   24.2
> | 12  11.4     76   21.0
> | 13  11.4     76   21.4
> | 14  11.7     69   21.3
> | 15  12.0     75   19.1
> | 16  12.9     74   22.2
> | 17  12.9     85   33.8
> | 18  13.3     86   27.4
> | 19  13.7     71   25.7
> | 20  13.8     64   24.9
> | 21  14.0     78   34.5
> | 22  14.2     80   31.7
> | 23  14.5     74   36.3
> | 24  16.0     72   38.3
> | 25  16.3     77   42.6
> | 26  17.3     81   55.4
> | 27  17.5     82   55.7
> | 28  17.9     80   58.3
> | 29  18.0     80   51.5
> | 30  18.0     80   51.0
> | 31  20.6     87   77.0
> | 
> | 
> | >  -- François
> | > 
> | > 
> | > On Sat, Feb 27, 2010 at 14:51, Peter Cowan <pdc at berkeley.edu> wrote:
> | >> 
> | >> On Feb 27, 2010, at 11:39 AM, François Michonneau wrote:
> | >> 
> | >>> It would be really good if we could fix the bugs I reported before
> | >>> releasing this updated version to CRAN (in particular bug #812).
> | >>> Indeed, we can't import most nexus trees in phylobase. It looks that
> | >>> the NCL interface needs to be updated but I don't know C++ and it's
> | >>> hard for me to investigate the problem. I'm willing to help though and
> | >>> write the RUnit tests associated with readNexus once the problem is
> | >>> fixed.
> | >> 
> | >> Agreed, we should fix this.  I can take a look at it, but I'm not a C++ expert either, do you have an example file that doesn't work for us to test with?
> | >> 
> | >> Unit tests would be great, and I was just writing an email suggesting that, when I got this.
> | >> 
> | >> I'm willing to set aside some time to do the release once we are satisfied things are working properly.  It'd be nice to do this soonish, because it does make the package much more usable.
> | >> 
> | >> Peter
> | >> 
> | >> 
> | >> 
> | >>>  Cheers,
> | >>>  -- François
> | >>> 
> | >>> 
> | >>> On Sat, Feb 27, 2010 at 14:29, Dirk Eddelbuettel <edd at debian.org> wrote:
> | >>>> 
> | >>>> On 27 February 2010 at 14:08, Ben Bolker wrote:
> | >>>> |   fine with me, phylobase passes R CMD check on my system without it.
> | >>>> | We can always restore it from SVN if it breaks something, right?
> | >>>> 
> | >>>> Correct. Plus there is a full copy in SVN at the top-level.
> | >>>> 
> | >>>> So removed as rev741.  Do you think you want to wrap this up as 0.5.1 or
> | >>>> 0.5.5 or ... for CRAN?
> | >>>> 
> | >>>> Dirk
> | >>>> 
> | >>>> 
> | >>>> | Dirk Eddelbuettel wrote:
> | >>>> | > Hi phylobase'ers,
> | >>>> | >
> | >>>> | > On 8 February 2010 at 17:54, Dirk Eddelbuettel wrote:
> | >>>> | > | On 8 February 2010 at 15:40, Peter Cowan wrote:
> | >>>> | > | | It appears to be building fine with Mac OS X (i386 & x86_64).  I agreed the
> | >>>> | > | | commingled approach is the way to go.  I think this will suit the needs of
> | >>>> | > | | our users best.  In fact, I tried it months ago but didn't have success, so I
> | >>>> | > | | thank you for your efforts!
> | >>>> | > |
> | >>>> | > | Cool! I didn't know that, so thanks for the thumbs up!
> | >>>> | > |
> | >>>> | > | | From my understanding, we don't need all of the source files for our NCL commands.
> | >>>> | > |
> | >>>> | > | Correct!  But I wanted to be careful here. But in fact I think now that move
> | >>>> | > | the old
> | >>>> | > |
> | >>>> | > |   src/ncl/
> | >>>> | > |
> | >>>> | > | into
> | >>>> | > |
> | >>>> | > |         src/ncl.original/
> | >>>> | > |
> | >>>> | > | and moved the files we need out of it, we can in fact clean up via, say,
> | >>>> | > |
> | >>>> | > |         $ svn rm pkg/src/ncl.original
> | >>>> | > |         $ svn ci pkg -m'remove unused parts of ncl library'
> | >>>> | > |
> | >>>> | > | but I think I should leave that to one of the actual phylobase maintainers.
> | >>>> | >
> | >>>> | > I think we can do
> | >>>> | >
> | >>>> | >           $ svn rm pkg/src/ncl.original
> | >>>> | >
> | >>>> | > to clean up a little more.  Comments, anyone?
> | >>>> | >
> | >>>> | > Dirk
> | >>>> | >
> | >>>> | > | | Down the road, we might be able to clean things up a little.  For example
> | >>>> | > | | the nxsdistancedatum.cpp file is empty
> | >>>> | > |
> | >>>> | > | Hadn't noticed.
> | >>>> | > |
> | >>>> | > | | and nxsemptyblock.cpp appears not to be used either.
> | >>>> | > |
> | >>>> | > | That one actually blocks building which is why I #ifdef'ed it out.
> | >>>> | > |
> | >>>> | > | Oh, the sweet sound of progress :)
> | >>>> | > |
> | >>>> | > | Dirk
> | >>>> | > |
> | >>>> | > | --
> | >>>> | > |   Registration is open for the 2nd International conference R / Finance 2010
> | >>>> | > |   See http://www.RinFinance.com for details, and see you in Chicago in April!
> | >>>> | >
> | >>>> |
> | >>>> |
> | >>>> | --
> | >>>> | Ben Bolker
> | >>>> | Associate professor, Biology Dep't, Univ. of Florida
> | >>>> | bolker at ufl.edu / people.biology.ufl.edu/bolker
> | >>>> | GPG key: people.biology.ufl.edu/bolker/benbolker-publickey.asc
> | >>>> |
> | >>>> |
> | >>>> | [GNUPG:] ERRSIG 7395291A3C337A73 17 2 01 1267297727 9
> | >>>> | [GNUPG:] NO_PUBKEY 7395291A3C337A73
> | >>>> 
> | >>>> --
> | >>>>  Registration is open for the 2nd International conference R / Finance 2010
> | >>>>  See http://www.RinFinance.com for details, and see you in Chicago in April!
> | >>>> _______________________________________________
> | >>>> Phylobase-devl mailing list
> | >>>> Phylobase-devl at lists.r-forge.r-project.org
> | >>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/phylobase-devl
> | >>>> 
> | >>> _______________________________________________
> | >>> Phylobase-devl mailing list
> | >>> Phylobase-devl at lists.r-forge.r-project.org
> | >>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/phylobase-devl
> | >> 
> | >> 
> | 
> 
> -- 
>  Registration is open for the 2nd International conference R / Finance 2010
>  See http://www.RinFinance.com for details, and see you in Chicago in April!



More information about the Phylobase-devl mailing list