From Thomas.Petzoldt at TU-Dresden.de  Wed Feb 11 07:50:35 2009
From: Thomas.Petzoldt at TU-Dresden.de (Thomas Petzoldt)
Date: Wed, 11 Feb 2009 07:50:35 +0100
Subject: [Rd] New package test results available
In-Reply-To: <498DC53B.9050909@TU-Dresden.de>
References: <alpine.LFD.2.00.0902070651160.18308@gannet.stats.ox.ac.uk>
	<498DC53B.9050909@TU-Dresden.de>
Message-ID: <4992753B.10304@TU-Dresden.de>

Thomas Petzoldt wrote:
> Prof Brian Ripley schrieb:
>> We've added a column at
>>
>> http://cran.r-project.org/web/checks/check_summary.html
>>
>> of test results using the Sun Studio compiler: it is intended that 
>> these will be updated weekly.
>>
>> The Sun Studio compiler is that used on Solaris: these runs were on 
>> the Linux version.  All the other platforms are using gcc 4, so this 
>> provides an opportunity for checking for use of gcc-specific features 
>> and also standards conformance (the Sun compilers have a long-time 
>> reputation for close conformance to the language standards).
>>
>> There are known problems where packages use C++ or JNI interfaces 
>> (e.g. rgdal and EBImage) as the libraries and JVM were compiled under 
>> gcc's conventions (even though a Sun JVMi is used).  About half the 
>> packages using rJava segfault, which seems to a JNI issue.
>>
>> Some packages use gcc-specific compiler flags:
>>
>>   LogConcDEAD Matching amap geometry memisc taskPR
>>
>> but the vast majority of the errors reported are C++ errors.  One 
>> class that may not be immediately obvious is the use of C headers in 
>> C++: you are supposed to write e.g.
>>
>> #includd <cmath>
>>
>> NOT
>>
>> #include <math.h>
>>
>> Symptoms of this can be seen for packages
>>
>>   BayesTree EMCC MCMCfglmm MarkedPointProcess Matching Matrix
>>   RQuantlib RandomFields Rcpp SoPhy compHclust dpmix igraph minet
>>   mixer modeest monomvm multic pcaPP rgenoud robfilter segclust
>>   simecol subselect
>>
>>
> 
> The reason can also be including <R.h> (as done in simecol) that 
> includes <math.h>
> 
> Do I understand it correctly that this means that including <R.h> is 
> wrong in C++?
> I read "Writing R extensions" several times, but was not aware that this 
> was a mistake. If I replace <R.h> by <cmath> then it works on my 
> systems, but I want to be certain that there are no other side effects.
> 
> Thanks in advance for clarification!
> 
> Thomas Petzoldt
> 
> 

I changed it as requested, and include

#include <cmath>
#include <Rinternals.h>

... but still get the same error:

"simecol.cpp", line 224: Error: Overloading ambiguity between 
"floor(double)" and "std::floor(float)".
1 Error(s) detected.

http://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-sun/simecol-00install.html

What's wrong here? My code is very short and extremely simple, without 
any new objects (yet), but fact only "plain C with some C++" extension.

What I'm making wrong? Would it be necessary that we all have a Linux 
installation with Sun Studio at hand?

Thanks a lot

Thomas P.

-- 
Thomas Petzoldt
Technische Universitaet Dresden
Institut fuer Hydrobiologie        thomas.petzoldt at tu-dresden.de
01062 Dresden                      http://tu-dresden.de/hydrobiologie/
GERMANY



[Rd] New package test results available
Thomas Petzoldt