[Rd] gcc ubsan alignement test --minimal gcc version?

2015-10-14 Thread kaveh

  Dear All,

  I'm trying to implement the section of the manual pertaining to the 
gcc-ubsan test

  carried by CRAN on my local computer (ubuntu 14.04):

  http://www.stats.ox.ac.uk/pub/bdr/memtests/gcc-UBSAN/README.txt

  I was wondering whether someone could tell what the minimal version
   of the gcc tool chain needed to run the gcc-ASAN and gcc-UBSAN alignment
  tests on ones local computer is. CRAN seems to use gcc 5.2.0 to do 
these tests,
   but the current version of gcc shipped with ubuntu is 4.9.2 (to be 
updated to

   5.1.0 with the 15.10 release latter this month).

 I hope this is the correct list to post this.

  Thanks in advance,

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] gcc ubsan alignement test --minimal gcc version?

2015-10-14 Thread kaveh

Dear Prof. Ripley,

Thank you for your answer. I think I am way over my head here.

(Using Doker adds a level of complexity that I'm afraid I can't
manage for now so I am happy with building Rdevel and using it
in to run these tests).

After building Rdevel with what I think are the correct options**
 (just to avoid mistakes I have also fully removed R from my system
 just before and insured that the following packages are all updated)

apt-get install bash-completion bison debhelper default-jdk g++ gcc 
gfortran groff-base libblas-dev libbz2-dev libcairo2-dev 
libcurl4-openssl-dev libjpeg-dev liblapack-dev liblzma-dev 
libncurses5-dev libpango1.0-dev libpcre3-dev libpng-dev libreadline-dev 
libtiff5-dev libx11-dev libxt-dev mpack subversion tcl8.5-dev texinfo 
texlive-base texlive-extra-utils texlive-fonts-extra 
texlive-fonts-recommended texlive-generic-recommended texlive-latex-base 
texlive-latex-extra texlive-latex-recommended tk8.5-dev valgrind 
x11proto-core-dev xauth xdg-utils xfonts-base xvfb zlib1g-dev


cd /tmp
svn co http://svn.r-project.org/R/trunk R-devel
cd /tmp/R-devel
R_PAPERSIZE=letter R_BATCHSAVE="--no-save --no-restore" 
PAGER=/usr/bin/pager  PERL=/usr/bin/perl  R_UNZIPCMD=/usr/bin/unzip 
R_ZIPCMD=/usr/bin/zip  R_PRINTCMD=/usr/bin/lpr  LIBnn=lib 
AWK=/usr/bin/awk  CFLAGS="-pipe -std=gnu99 -Wall -pedantic -O2" 
CXXFLAGS="-pipe -Wall -pedantic -O2"  CC="gcc 
-fsanitize=address,undefined"  CXX="g++ -fsanitize=address,undefined"  
CXX1X="g++ -fsanitize=address,undefined"  FC="gfortran 
-fsanitize=address,undefined"  F77="gfortran 
-fsanitize=address,undefined" ./configure --enable-R-shlib 
--without-blas --without-lapack --with-readline 
--without-recommended-packages --program-suffix=dev --disable-openmp

make
make install
make clean

But I'm not sure how to proceed from there.
I tried the obvious thing:

Rdevel CMD build my_offending_package
Rdevel CMD check --as-cran my_offending_package

But I have not been able to replicate the bug I see on cran:

/usr/local/gcc5/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include/emmintrin.h:140:21:
 runtime error: load of misaligned address 0x6187fc84 for type 'const 
double', which requires 8 byte alignment
0x6187fc84: note: pointer points here
  00 00 80 3f 00 00 80 3f  00 00 80 3f 00 00 80 3f  00 00 80 3f 00 00 80 3f  00 
00 80 3f 00 00 80 3f


**Though the original authors bear no responsibility for these scripts,
 I have found many of these commands on this file:
https://github.com/rocker-org/r-devel-san/blob/master/Dockerfile





On 2015-10-14 10:10, Prof Brian Ripley wrote:

On 13/10/2015 14:46, kaveh wrote:

   Dear All,

   I'm trying to implement the section of the manual pertaining to the
gcc-ubsan test
   carried by CRAN on my local computer (ubuntu 14.04):

http://www.stats.ox.ac.uk/pub/bdr/memtests/gcc-UBSAN/README.txt

   I was wondering whether someone could tell what the minimal version
of the gcc tool chain needed to run the gcc-ASAN and gcc-UBSAN
alignment
   tests on ones local computer is. CRAN seems to use gcc 5.2.0 to do
these tests,
but the current version of gcc shipped with ubuntu is 4.9.2 (to be
updated to
5.1.0 with the 15.10 release latter this month).

  I hope this is the correct list to post this.


The correct thing to do is to read the manual (either the R manual or 
your gcc manual).  The R manual says


'AddressSanitizer (‘ASan’) is a tool with similar aims to the memory 
checker in valgrind. It is available with suitable builds of gcc 4.8.0 
or clang 3.1 and later on common Linux and OS X platforms.'


'‘UBSanitizer’ is a tool for C/C++ source code selected by 
-fsanitize=undefined in suitable builds of clang, and GCC as from 4.9.0.'


Note that including these capabilities and their runtimes is optional 
at least for clang (until recently Apple omitted them), so you need to 
check your own system's documentation.




__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Why is my R package still compiling with the O2 flag?

2014-09-26 Thread kaveh
When I install an R package with cpp codes such as rrcov via CRAN (under 
R 3.1.1, using no Makevars file and under Ubuntu 14.04 using GCC 4.8), 
the cpp code is compiled with the -o3 flag (in fact, looking at the 
Makeconf file this seem to again be the default since R 3.1.1) But when 
I install my own package via CRAN it is compiled with the -o2 flag.


My questions are what is causing my package's cpp code to be compiled in 
-o2 and how to fix this?


Here is the content of the src/Makeconf file of my package (it is fairly 
standard I believe for a package using RcppEigen):


PKG_CXXFLAGS =  -I../inst/include -DEIGEN_DONT_PARALLELIZE 
$(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` 
$(SHLIB_OPENMP_CXXFLAGS)

CXX_STD = CXX11

and that of rrcov (which I m using for illustration's sake):

PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Why is my R package still compiling with the O2 flag?

2014-09-26 Thread kaveh


Dear Prof Ripley,

Thanks for the pointer to CXX1XFLAGS: it helped me solve the problem.

As usual, thanks for your prompt and helpful answer,

Best regards,

On 2014-09-26 11:30, Prof Brian Ripley wrote:
You have not given us the 'at a minimum' information required by the 
posting guide, and it is -O2 etc (not O2 and not -o2).


Also, cpp is the C pre-processor: if you mean C++, say so.

The default compiler flags are set by whoever compiled R: it is 
entirely possibly they were set differently for C++98 and C++11 (which 
looks relevant).


It seems you need to read 'R Installation and Admnistration' which has 
a comprehensive description of these flags.



On 26/09/2014 10:00, kaveh wrote:

When I install an R package with cpp codes such as rrcov via CRAN (under
R 3.1.1, using no Makevars file and under Ubuntu 14.04 using GCC 4.8),
the cpp code is compiled with the -o3 flag (in fact, looking at the
Makeconf file this seem to again be the default since R 3.1.1) But when
I install my own package via CRAN it is compiled with the -o2 flag.

My questions are what is causing my package's cpp code to be compiled in
-o2 and how to fix this?

Here is the content of the src/Makeconf file of my package (it is fairly
standard I believe for a package using RcppEigen):

 PKG_CXXFLAGS =  -I../inst/include -DEIGEN_DONT_PARALLELIZE
$(SHLIB_OPENMP_CXXFLAGS)
 PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
$(SHLIB_OPENMP_CXXFLAGS)
 CXX_STD = CXX11

and that of rrcov (which I m using for illustration's sake):

 PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel





__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] DIY Rtools?

2014-10-30 Thread kaveh

Dear List,

I'm currently working on an R package that
works great when compiled with GCC 4.8 under linux
but which doesn't seem to work so well when compiled
 by the win builder (http://win-builder.r-project.org/).

After asking around a bit, the primary culprit could be
the older version of GCC used in Rtools.

Now, for academic purposes, I would like to have
 a zip version of this package (not to distribute
through CRAN mind you, but to submit alongside
 the associated paper).

My questions are as follows:

-Am I correct to think that Rtool uses GCC 4.6.3?
-If so, is there a way to build windows runable R
package using a more recent version of GCC?

Thanks in advance for sharing your views on this,

Bests regards,

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] DIY Rtools?

2014-10-30 Thread kaveh

Thank you very much for all these infos!

Best regards,


On 2014-10-30 22:54, Duncan Murdoch wrote:

On 30/10/2014, 2:45 PM, kaveh wrote:

Dear List,

I'm currently working on an R package that
works great when compiled with GCC 4.8 under linux
but which doesn't seem to work so well when compiled
   by the win builder (http://win-builder.r-project.org/).

After asking around a bit, the primary culprit could be
the older version of GCC used in Rtools.

Now, for academic purposes, I would like to have
   a zip version of this package (not to distribute
through CRAN mind you, but to submit alongside
   the associated paper).

My questions are as follows:

-Am I correct to think that Rtool uses GCC 4.6.3?

Yes.


-If so, is there a way to build windows runable R
package using a more recent version of GCC?

Yes, you need to install one (I've been told they are available from the
MinGW-64 project) on your path, then just use it.  If it needs different
options from the ones that 4.6.3 needed, it will be slightly more work:
  you'll need to edit the Makefile, or Makevars, or MkRules.* files in
src/gnuwin32 to put those options in place.

Unlike other platforms, the Windows builds have no "configuration" step,
that's all done by hand (usually by Brian Ripley, thanks!).  If you
change to a different compiler, you may need to change some of that.

Our plans are to switch to a newer compiler before the release of R
3.2.0 in the spring, but I won't promise when new Rtools will be available.

Duncan Murdoch


Thanks in advance for sharing your views on this,

Bests regards,

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Linking to the BH package introduces CRAN warnings

2014-11-04 Thread kaveh

Dear all,

I'm working on a project that links to the BH package
(http://cran.r-project.org/web/packages/BH/index.html).

My packages doesn't call entry points which might terminate R nor
write to stdout/stderr instead of to the console.

However, it seems some of the codes in the BH package
might. At any rate, when I include some boost headers such as
boost/math/distributions/ through BH, I get the following warnings
 when  submitting to the win-builder page:


  Found '_ZSt4cerr', possibly from 'std::cerr' (C++)

  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

  Found '_ZSt4cerr', possibly from 'std::cerr' (C++)

  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)


 Furthermore, these warnings disappear when remove the boost
 headers and replace the call to boost functions by constants.

Looking at the CRAN-check diagnostics of some other packages that link to
BH, I do not see similar warnings, so I suppose it is possible to fix 
this issue.

Looking at their source code, it is not clear to me how these authors have
managed to do this, but this might be because I'm not that familiar with
boost to begin with. Can someone point me to some solution to this problem?

Thanks in advance,

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Linking to the BH package introduces CRAN warnings

2014-11-04 Thread kaveh

Dear Romain,



/You’re kind of out of luck. These functions are both:
  - used by the boost headers
  - forbidden by R, well at least forbidden by CRAN
/

//

Thanks for conforming my earlier fears. Since I only use
this header and would like my package to eventually be
on CRAN, I was thinking of bypassing BH and just putting
these headers in the /inst directory and modifying them
to remove the offending calls. I was wondering what your
view on this is. Or perhaps there is a simpler alternative?

Thanks in advance,



On 2014-11-04 21:46, Romain François wrote:
>> Le 4 nov. 2014 à 15:42, Dirk Eddelbuettel  a écrit :
>>
>>
>> On 4 November 2014 at 14:37, kaveh wrote:
>> | Dear all,
>> |
>> | I'm working on a project that links to the BH package
>> | (http://cran.r-project.org/web/packages/BH/index.html).
>> |
>> | My packages doesn't call entry points which might terminate R nor
>> | write to stdout/stderr instead of to the console.
>> |
>> | However, it seems some of the codes in the BH package
>> | might. At any rate, when I include some boost headers such as
>> | boost/math/distributions/ through BH, I get the following warnings
>> |   when  submitting to the win-builder page:
>> |
>> |
>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
>> |
>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
>> |
>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
>> |
>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
> You’re kind of out of luck. These functions are both:
>   - used by the boost headers
>   - forbidden by R, well at least forbidden by CRAN
>


[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Linking to the BH package introduces CRAN warnings

2014-11-04 Thread kaveh
Dear Romain,


Thanks for all these info,


I will ponder this versus using
some of the alternatives in the R sources


Best regards,

On 2014-11-04 22:01, Romain François wrote:
>
>> Le 4 nov. 2014 à 21:52, kaveh > <mailto:vakili.kaveh.em...@gmail.com>> a écrit :
>>
>>
>> Dear Romain,
>>
>>
>>
>> /You’re kind of out of luck. These functions are both:
>>   - used by the boost headers
>>   - forbidden by R, well at least forbidden by CRAN
>> /
>>
>> //
>>
>> Thanks for conforming my earlier fears. Since I only use
>> this header and would like my package to eventually be
>> on CRAN, I was thinking of bypassing BH and just putting
>> these headers in the /inst directory and modifying them
>> to remove the offending calls. I was wondering what your
>> view on this is. Or perhaps there is a simpler alternative?
>>
>> Thanks in advance,
>
> If you go through the hoops of modifying these headers to fulfill R’s 
> requirements, I’m sure it would be of interest to others if you 
> contribute these back to BH.
>
> The danger obviously is that this gets out of sync with boost, which 
> would create work for merging your changes to new boost files from the 
> future.
>
> Some parts of boost (e.g. uBlas) have macros to control whether or not 
> std::cerr is used at all. 
> https://github.com/eddelbuettel/bh/blob/cb1427c27dc068c8328fd1d2f4b1b8a8da1957c2/inst/include/boost/numeric/ublas/exception.hpp#L215
>
> But I don’t think this is of any relevance to the files you want to use.
>
> Romain
>
>> On 2014-11-04 21:46, Romain François wrote:
>>>> Le 4 nov. 2014 à 15:42, Dirk Eddelbuettel  a écrit :
>>>>
>>>>
>>>> On 4 November 2014 at 14:37, kaveh wrote:
>>>> | Dear all,
>>>> |
>>>> | I'm working on a project that links to the BH package
>>>> | (http://cran.r-project.org/web/packages/BH/index.html).
>>>> |
>>>> | My packages doesn't call entry points which might terminate R nor
>>>> | write to stdout/stderr instead of to the console.
>>>> |
>>>> | However, it seems some of the codes in the BH package
>>>> | might. At any rate, when I include some boost headers such as
>>>> | boost/math/distributions/ through BH, I get the following warnings
>>>> |   when  submitting to the win-builder page:
>>>> |
>>>> |
>>>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
>>>> |
>>>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
>>>> |
>>>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
>>>> |
>>>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
>>> You’re kind of out of luck. These functions are both:
>>>   - used by the boost headers
>>>   - forbidden by R, well at least forbidden by CRAN
>>>
>>
>


[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Linking to the BH package introduces CRAN warnings

2014-11-04 Thread kaveh

Dear Hadley,

Thank you for this information, maybe the CRAN gods
will look favourably on this case too,


Best regards,

On 2014-11-04 23:32, Hadley Wickham wrote:

| However, it seems some of the codes in the BH package
| might. At any rate, when I include some boost headers such as
| boost/math/distributions/ through BH, I get the following warnings
|   when  submitting to the win-builder page:
|
|
|Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
|
|Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
|
|Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
|
|Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

You’re kind of out of luck. These functions are both:
  - used by the boost headers
  - forbidden by R, well at least forbidden by CRAN

Mybe - I had this note in RSQLite, and CRAN seemed ok with my explanation:

* checking compiled code ... NOTE
   File 
‘/Users/hadley/Documents/databases/RSQLite.Rcheck/RSQLite/libs/RSQLite.so’:
 Found ‘___stderrp’, possibly from ‘stderr’ (C)
   Object: ‘sqlite-all.o’

   This is in C code from the embedded SQLite database.


Hadley



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Linking to the BH package introduces CRAN warnings

2014-11-04 Thread kaveh

Sire,

The header that is included is

boost/math/distributions/

If I remove it and replace the calls
to its members by plain constants,
the warning disappear (I just tried
this again on http://win-builder.r-project.org/).

This leads me to the suspicion that
the header is causing the error message.

I will post a simpler source code,
tomorrow on this list.

Best regards,


On 2014-11-04 23:52, Dirk Eddelbuettel wrote:

Gentlemen,

On 4 November 2014 at 23:36, kaveh wrote:
| Dear Hadley,
|
| Thank you for this information, maybe the CRAN gods
| will look favourably on this case too,

You seemed to have missed a point my earlier email tried to stress: Inclusion
of BH does not lead to the warning.

All this depends on WHICH headers are included, and the OP will need to sort
this out by modifying his code.

Dirk
  
| Best regards,

|
| On 2014-11-04 23:32, Hadley Wickham wrote:
| >>> | However, it seems some of the codes in the BH package
| >>> | might. At any rate, when I include some boost headers such as
| >>> | boost/math/distributions/ through BH, I get the following warnings
| >>> |   when  submitting to the win-builder page:
| >>> |
| >>> |
| >>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
| >>> |
| >>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
| >>> |
| >>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
| >>> |
| >>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
| >> You’re kind of out of luck. These functions are both:
| >>   - used by the boost headers
| >>   - forbidden by R, well at least forbidden by CRAN
| > Mybe - I had this note in RSQLite, and CRAN seemed ok with my 
explanation:
| >
| > * checking compiled code ... NOTE
| >File 
‘/Users/hadley/Documents/databases/RSQLite.Rcheck/RSQLite/libs/RSQLite.so’:
| >  Found ‘___stderrp’, possibly from ‘stderr’ (C)
| >Object: ‘sqlite-all.o’
| >
| >This is in C code from the embedded SQLite database.
| >
| >
| > Hadley
| >
|



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Linking to the BH package introduces CRAN warnings

2014-11-04 Thread kaveh

Dear all,


the simple code in below, when send to the
win-builder returns the following (and no other)
warning:


* checking compiled code ... WARNING
File 'quicky/libs/i386/quicky.dll':
  Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
Object: 'quicky.o'
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
Object: 'quicky.o'
File 'quicky/libs/x64/quicky.dll':
  Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
Object: 'quicky.o'
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
Object: 'quicky.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.

See 'Writing portable packages' in the 'Writing R Extensions' manual.


Here is the source:

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 

#include 

using namespace std;
using namespace Eigen;
using Eigen::MatrixXd;
using Eigen::VectorXd;
using Eigen::VectorXi;
using Eigen::RowVectorXd;


using boost::math::chi_squared;
using boost::math::quantile;
using boost::math::complement;
using boost::math::normal_distribution;
using namespace boost::math::policies;

typedef policy<
  promote_double
  > my_policy_norm;
typedef policy<
  promote_double
  > my_policy_chi2;

typedef boost::math::normal_distribution my_norm;
typedef boost::math::chi_squared_distribution 
my_chi2;



VectorXd GetQs(const VectorXd& x){
const int n=x.size();
double mytol=1e-8;
double the_max=x.maxCoeff();
double the_min=x.minCoeff();
double the_rag=(the_max-the_min);
if(the_ragfor(int i=0;iy(i)=sqrt(quantile(complement(my_chi2(1.0),x(i;

return(y);
}
extern "C"{
void quicky(int* rn,double* xi,double* yi){
const int n=*rn;
VectorXd x=Map(xi,n);
    Map(yi,n)=GetQs(x);
}
}


So I guess, I should fill a bug report with the
BH maintainer?

Best regards,


On 2014-11-04 23:52, Dirk Eddelbuettel wrote:

Gentlemen,

On 4 November 2014 at 23:36, kaveh wrote:
| Dear Hadley,
|
| Thank you for this information, maybe the CRAN gods
| will look favourably on this case too,

You seemed to have missed a point my earlier email tried to stress: Inclusion
of BH does not lead to the warning.

All this depends on WHICH headers are included, and the OP will need to sort
this out by modifying his code.

Dirk
  
| Best regards,

|
| On 2014-11-04 23:32, Hadley Wickham wrote:
| >>> | However, it seems some of the codes in the BH package
| >>> | might. At any rate, when I include some boost headers such as
| >>> | boost/math/distributions/ through BH, I get the following warnings
| >>> |   when  submitting to the win-builder page:
| >>> |
| >>> |
| >>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
| >>> |
| >>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
| >>> |
| >>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
| >>> |
| >>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
| >> You’re kind of out of luck. These functions are both:
| >>   - used by the boost headers
| >>   - forbidden by R, well at least forbidden by CRAN
| > Mybe - I had this note in RSQLite, and CRAN seemed ok with my 
explanation:
| >
| > * checking compiled code ... NOTE
| >File 
‘/Users/hadley/Documents/databases/RSQLite.Rcheck/RSQLite/libs/RSQLite.so’:
| >  Found ‘___stderrp’, possibly from ‘stderr’ (C)
| >Object: ‘sqlite-all.o’
| >
| >This is in C code from the embedded SQLite database.
| >
| >
| > Hadley
| >
|



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Linking to the BH package introduces CRAN warnings

2014-11-05 Thread kaveh

Dear,

I was expecting this reaction.

Please do not get caught up in the details of the examples,
which I have tried to make as simple as possible for your
benefit.

The main point is that if you remove the lines associated
with

boost/math/distributions/


the warning disappears as well. Ergo,

boost/math/distributions/

is causing the warnings.

Best regards,


On 2014-11-05 13:43, Dirk Eddelbuettel wrote:

On 5 November 2014 at 00:55, kaveh wrote:
| Dear all,
|
|
| the simple code in below, when send to the
| win-builder returns the following (and no other)
| warning:
|
|
| * checking compiled code ... WARNING
| File 'quicky/libs/i386/quicky.dll':
|Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
|  Object: 'quicky.o'
|Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
|  Object: 'quicky.o'
| File 'quicky/libs/x64/quicky.dll':
|Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
|  Object: 'quicky.o'
|Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
|  Object: 'quicky.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.
|
| See 'Writing portable packages' in the 'Writing R Extensions' manual.
|
|
| Here is the source:
|
| #include 
| #include 
| #include 
| #include 
| #include 
| #include 
| #include 
| #include 
| #include 
| #include 
| #include 
| #include 
| #include 
|
| #include 
| #include 
|
| #include 
|
| using namespace std;
| using namespace Eigen;
| using Eigen::MatrixXd;
| using Eigen::VectorXd;
| using Eigen::VectorXi;
| using Eigen::RowVectorXd;
|
|
| using boost::math::chi_squared;
| using boost::math::quantile;
| using boost::math::complement;
| using boost::math::normal_distribution;
| using namespace boost::math::policies;
|
| typedef policy<
|promote_double
|> my_policy_norm;
| typedef policy<
|promote_double
|> my_policy_chi2;
|
| typedef boost::math::normal_distribution my_norm;
| typedef boost::math::chi_squared_distribution
| my_chi2;
|
|
| VectorXd GetQs(const VectorXd& x){
|  const int n=x.size();
|  double mytol=1e-8;
|  double the_max=x.maxCoeff();
|  double the_min=x.minCoeff();
|  double the_rag=(the_max-the_min);
|  if(the_rag(xi,n);
|  Map(yi,n)=GetQs(x);
|  }
| }
|
|
| So I guess, I should fill a bug report with the
| BH maintainer?

Err, why? BH does nothing wrong.

You are NOT forced or required to use the Boost distributions header __as R
comes with the equivalent functionality__ via the Rmath.h header file from R.
Which has functionality that Rcpp provides to you in scalar and vector form.

And there are probably several dozen examples of using the R distribution
functions from Rcpp.

So this is _precisely_ what I suggested several mails ago: do your homework,
identify which header is causing it.  And the obvious next step is then to
not use the header.

Dirk
  


| Best regards,
|
|
| On 2014-11-04 23:52, Dirk Eddelbuettel wrote:
| > Gentlemen,
| >
| > On 4 November 2014 at 23:36, kaveh wrote:
| > | Dear Hadley,
| > |
| > | Thank you for this information, maybe the CRAN gods
| > | will look favourably on this case too,
| >
| > You seemed to have missed a point my earlier email tried to stress: 
Inclusion
| > of BH does not lead to the warning.
| >
| > All this depends on WHICH headers are included, and the OP will need to sort
| > this out by modifying his code.
| >
| > Dirk
| >
| > | Best regards,
| > |
| > | On 2014-11-04 23:32, Hadley Wickham wrote:
| > | >>> | However, it seems some of the codes in the BH package
| > | >>> | might. At any rate, when I include some boost headers such as
| > | >>> | boost/math/distributions/ through BH, I get the following warnings
| > | >>> |   when  submitting to the win-builder page:
| > | >>> |
| > | >>> |
| > | >>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
| > | >>> |
| > | >>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
| > | >>> |
| > | >>> |Found '_ZSt4cerr', possibly from 'std::cerr' (C++)
| > | >>> |
| > | >>> |Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
| > | >> You’re kind of out of luck. These functions are both:
| > | >>   - used by the boost headers
| > | >>   - forbidden by R, well at least forbidden by CRAN
| > | > Mybe - I had this note in RSQLite, and CRAN seemed ok with my 
explanation:
| > | >
| > | > * checking compiled code ... NOTE
| > | >File 
‘/Users/hadley/Documents/databases/RSQLite.Rcheck/RSQLite/libs/RSQLite.so’:
| > | >  Found ‘___stderrp’, possibly from ‘stderr’ (C)
| > | >Object: ‘sqlite-all.o’
| > | >
| > | >This is in C code from the embedded SQLite database.
| > | >
| > | >
| > | > Hadley
| > | >
| > |
| >
|



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel