Building R package: “Found 'rand', possibly from 'rand' (C)” NOTE when checking package

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Building R package: “Found 'rand', possibly from 'rand' (C)” NOTE when checking package

January Weiner-3
I am building a package that makes a simple visualization. A part of
the code is in C++, and utilizes the functions srand() and rand() for
purposes not related to statistics (introducing random noise in the
visualization). The package compiles without problems on my
workstation(s), but when I submitted it to the winbuilder service, I
got the following weird message:

* checking compiled code ... NOTE
File 'tagcloud/libs/i386/tagcloud.dll':
  Found 'rand', possibly from 'rand' (C)
    Object: 'overlap.o'
  Found 'srand', possibly from 'srand' (C)
    Object: 'overlap.o'
File 'tagcloud/libs/x64/tagcloud.dll':
  Found 'rand', possibly from 'rand' (C)
    Object: 'overlap.o'
  Found 'srand', possibly from 'srand' (C)
    Object: 'overlap.o'

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor the C RNG.

To the best of my knowledge, I don't see where in the code I "call
entry points which might terminate R" or "write to stdout/stderr", but
then, if I remove the calls to rand/srand, this message disappears.

You can review the package here:
http://win-builder.r-project.org/toy6frr57aCU/

Kind regards,

January

--
-------- January Weiner --------------------------------------

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building R package: “Found 'rand', possibly from 'rand' (C)” NOTE when checking package

Berend Hasselman

On 02-11-2014, at 12:20, January Weiner <[hidden email]> wrote:

> I am building a package that makes a simple visualization. A part of
> the code is in C++, and utilizes the functions srand() and rand() for
> purposes not related to statistics (introducing random noise in the
> visualization). The package compiles without problems on my
> workstation(s), but when I submitted it to the winbuilder service, I
> got the following weird message:
>
> * checking compiled code ... NOTE
> File 'tagcloud/libs/i386/tagcloud.dll':
>  Found 'rand', possibly from 'rand' (C)
>    Object: 'overlap.o'
>  Found 'srand', possibly from 'srand' (C)
>    Object: 'overlap.o'
> File 'tagcloud/libs/x64/tagcloud.dll':
>  Found 'rand', possibly from 'rand' (C)
>    Object: 'overlap.o'
>  Found 'srand', possibly from 'srand' (C)
>    Object: 'overlap.o'
>
> Compiled code should not call entry points which might terminate R nor
> write to stdout/stderr instead of to the console, nor the C RNG.
>
> To the best of my knowledge, I don't see where in the code I "call
> entry points which might terminate R" or "write to stdout/stderr", but
> then, if I remove the calls to rand/srand, this message disappears.
>

Which version of R on your workstation?
Your code should also not call the C RNG (rand and srand) as the message clearly states.

Berend

> You can review the package her:e
> http://win-builder.r-project.org/toy6frr57aCU/
>
> Kind regards,
>
> January
>
> --
> -------- January Weiner --------------------------------------
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building R package: “Found 'rand', possibly from 'rand' (C)” NOTE when checking package

Uwe Ligges-3


On 02.11.2014 12:40, Berend Hasselman wrote:

>
> On 02-11-2014, at 12:20, January Weiner <[hidden email]> wrote:
>
>> I am building a package that makes a simple visualization. A part of
>> the code is in C++, and utilizes the functions srand() and rand() for
>> purposes not related to statistics (introducing random noise in the
>> visualization). The package compiles without problems on my
>> workstation(s), but when I submitted it to the winbuilder service, I
>> got the following weird message:
>>
>> * checking compiled code ... NOTE
>> File 'tagcloud/libs/i386/tagcloud.dll':
>>   Found 'rand', possibly from 'rand' (C)
>>     Object: 'overlap.o'
>>   Found 'srand', possibly from 'srand' (C)
>>     Object: 'overlap.o'
>> File 'tagcloud/libs/x64/tagcloud.dll':
>>   Found 'rand', possibly from 'rand' (C)
>>     Object: 'overlap.o'
>>   Found 'srand', possibly from 'srand' (C)
>>     Object: 'overlap.o'
>>
>> Compiled code should not call entry points which might terminate R nor
>> write to stdout/stderr instead of to the console, nor the C RNG.
>>
>> To the best of my knowledge, I don't see where in the code I "call
>> entry points which might terminate R" or "write to stdout/stderr", but
>> then, if I remove the calls to rand/srand, this message disappears.
>>
>
> Which version of R on your workstation?
> Your code should also not call the C RNG (rand and srand) as the message clearly states.


Right: set.seed() only controls R'd RNG, hence use that one so that your
users can conveniently reproduce their visualizations with your package.

Best,
Uwe Ligges


> Berend
>
>> You can review the package her:e
>> http://win-builder.r-project.org/toy6frr57aCU/
>>
>> Kind regards,
>>
>> January
>>
>> --
>> -------- January Weiner --------------------------------------
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building R package: “Found 'rand', possibly from 'rand' (C)” NOTE when checking package

January Weiner-3
In reply to this post by Berend Hasselman
Dear Berend,

thank you for your kind response. You are right, and I am blind. I
will use the R RNG instead.

Kind regards,

j.


On 2 November 2014 12:40, Berend Hasselman <[hidden email]> wrote:

>
> On 02-11-2014, at 12:20, January Weiner <[hidden email]> wrote:
>
>> I am building a package that makes a simple visualization. A part of
>> the code is in C++, and utilizes the functions srand() and rand() for
>> purposes not related to statistics (introducing random noise in the
>> visualization). The package compiles without problems on my
>> workstation(s), but when I submitted it to the winbuilder service, I
>> got the following weird message:
>>
>> * checking compiled code ... NOTE
>> File 'tagcloud/libs/i386/tagcloud.dll':
>>  Found 'rand', possibly from 'rand' (C)
>>    Object: 'overlap.o'
>>  Found 'srand', possibly from 'srand' (C)
>>    Object: 'overlap.o'
>> File 'tagcloud/libs/x64/tagcloud.dll':
>>  Found 'rand', possibly from 'rand' (C)
>>    Object: 'overlap.o'
>>  Found 'srand', possibly from 'srand' (C)
>>    Object: 'overlap.o'
>>
>> Compiled code should not call entry points which might terminate R nor
>> write to stdout/stderr instead of to the console, nor the C RNG.
>>
>> To the best of my knowledge, I don't see where in the code I "call
>> entry points which might terminate R" or "write to stdout/stderr", but
>> then, if I remove the calls to rand/srand, this message disappears.
>>
>
> Which version of R on your workstation?
> Your code should also not call the C RNG (rand and srand) as the message clearly states.
>
> Berend
>
>> You can review the package her:e
>> http://win-builder.r-project.org/toy6frr57aCU/
>>
>> Kind regards,
>>
>> January
>>
>> --
>> -------- January Weiner --------------------------------------
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>



--
-------- January Weiner --------------------------------------

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel