From simon.urbanek at r-project.org  Tue Apr 23 17:21:17 2013
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Tue, 23 Apr 2013 11:21:17 -0400
Subject: [Rd] Verbose output from R CMD check
In-Reply-To: <51769FFE.2020604@antilles.inra.fr>
References: <51769FFE.2020604@antilles.inra.fr>
Message-ID: <22AF9B56-93D2-44C3-9879-136AFC61C5A7@r-project.org>


On Apr 23, 2013, at 10:51 AM, dpleydell wrote:

> I've been developing a package called foobar for a couple of years now. It has evolved through various versions, but has always contained compiled C code. Recently, R CMD check has started generating the following message
> 
> [START QUOTE]
> 
> R CMD check foobar_1.7.5.tar.gz
> * using log directory ?/home/david/foobar/package/foobar.Rcheck?
> * using R version 2.15.2 (2012-10-26)
> * using platform: x86_64-unknown-linux-gnu (64-bit)
> * using session charset: UTF-8
> * checking for file ?foobar/DESCRIPTION? ... OK
> [LOTS OF '...OK' CHECK REPORTS REMOVED FOR BREVITY]
> * checking compiled code ... NOTE
> File ?/home/david/foobar/package/foobar.Rcheck/foobar/libs/foobar.so?:
>  Found ?putchar?, possibly from ?putchar? (C)
>    Object: ?foobar.o?
>  Found ?puts?, possibly from ?printf? (C), ?puts? (C)
>    Object: ?foobar.o?
> 
> Compiled code should not call functions which might terminate R nor write to stdout/stderr instead of to the console.
> 
> See ?Writing portable packages? in the ?Writing R Extensions? manual.
> * checking examples ... OK
> * checking PDF version of manual ... OK
> 
> NOTE: There was 1 note.
> See ?/home/david/foobar/package/foobar.Rcheck/00check.log? for details.
> 
> [END QUOTE]
> 
> This message is recent, but appears even when I re-compile and check old versions of the package which previously passed the check without any such warning messages.
> 
> My understanding is that since R 2.15.0 R CMD check has undergone numerous modifications, and as a result it is now identifying a "problem" that wasn't being identified previously. I'm currently running R 2.15.2.
> 
> Identifying the source of the message is a non-trivial problem because there are a large number of calls to printf and fprintf etc in several thousands of lines of code spread over many different *.c files.
> 

There should be none, so apparently you have broken the rules quite a lot ;). This is not a new rule, R just got better at identifying the transgressions. Number of lines in your code is quite irrelevant - that's why there is grep and the search function in editors.


> So my question... is there a way to obtain a more verbose output that could point me to the lines of code that generate the message? Without this information debugging is rendered unnecessarily hard, time consuming and frustrating.
> 

It's not "unnecessarily hard" - it fact it's much easier to find this out from the sources than the compiled code which is how R has to identify it which makes it impossible to track the source (because it could have been from a static library, for example).

Cheers,
Simon


> many thanks
> David
> 
> 
> -- 
> David Pleydell,
> INRA,
> UMR-1351 CMAEE,
> Domaine Duclos,
> Prise D'eau,
> 97122 Petit Bourg,
> Guadeloupe
> dpleydell at antilles.inra.fr
> pleydell at cirad.fr
> Tel +33 5 90 25 54 42
> Fax +33 5 90 94 03 96
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 



[Rd] Verbose output from R CMD check
Simon Urbanek