Skip to content

package Geneland / Rgui under windows

6 messages · Gilles GUILLOT, Sean Davis, Hin-Tak Leung +1 more

#
Hi,
I experienced a problem with the package Geneland under R 2.6.0
with  windows XP professional.

The commands below should simulate a dataset,
then make an MCMC simulation stored in tempdir().

It works with R 2.5.1 (both GUI and command line)
It works with the command line of R 2.6.0
but not with the R GUI of 2.6.0: no output file is created in tempdir()
and R remains frozen.
I reported it as a bug
(PR#9964)  but did not get any feed back.

Thanks in advance for any help.

Gilles

set.seed(1)
data <- simdata(nindiv=200,
                coord.lim=c(0,1,0,1) ,
                number.nuclei=5 ,
                allele.numbers=rep(10,20),
                IBD=FALSE,
                npop=2,
                give.tess.grid=FALSE)


path.mcmc <- paste(tempdir(),"/",sep="")

mcmcFmodel(coordinates= t(data$coord.indiv),
           genotypes=data$genotypes,
           path.mcmc=path.mcmc,
           rate.max=10,
           delta.coord=0,
           npopmin=1,
           npopinit=5,
           npopmax=5,
           nb.nuclei.max=50,
           nit=500,
           thinning=1,
           freq.model="Dirichlet",
           varnpop=FALSE,
           spatial=TRUE)
#
Gilles GUILLOT wrote:
I think the general rule-of-thumb is to contact the package author for
problems with individual packages.  Many package authors read this list,
but there are probably some that do not.  Sometimes problems with
individual packages are actually bugs in R, but I would say that this is
not usually the case.  However, the package author is probably the best
person to make this judgment.

Sean
#
I forgot to say that I was the package author.
I suspected a bug of R as Geneland worked fine for two
years and the problem popped up
with the release of R 2.6.0
And I can't see any explanation.
So, any clue would help.

gilles
_________________________________________________________________
Gilles GUILLOT
INRA MIA Paris - FRANCE

Now working from Matematisk Statistik
Chalmers University of Technology,
S-412 96 G?teborg, SWEDEN
Rum: 3079
tel: +46 31 772 5338,
Email: guillot at math.chalmers.se
http://www.inapg.inra.fr/ens_rech/mathinfo/personnel/guillot/welcome.html
#
I don't have 'genuine' windows, but I have been running win32 R
under wine from time to time for a couple of years (among other
reasons, for testing cross-compilation of our R package - snpMatrix in 
http://www-gene.cimr.cam.ac.uk/clayton/software/), and your package
(fields_3.5.zip  Geneland_2.0.8.zip  RandomFields_1.3.30.zip)
works fine with win32 R 2.6.0 Rgui under wine.

However, I notice an anomaly - You are using printf() instead of 
Rprintf() - and these messages:

            *****************************
            ***    MCMC inference     ***
            *****************************
   0.200 %
...
  99.800 %
100.000 %
            ************************************
            ***    End of MCMC inference     ***
            ************************************

get sent to the parent terminal controlling wine, rather than going
into Rgui's console. (we made a similiar mistake in an early version of 
snpMatrix).

Consider replacing printf() with Rprintf() . This is an FAQ in the 
R-windows FAQ web page. That might be why Rgui hangs in XP but Rterm works.
Gilles GUILLOT wrote:
#
On Mon, 15 Oct 2007, Sean Davis wrote:

            
Overwhelmingly so: I don't believe we know of any in the transition to 
2.6.0 that were not bugs in the packages concerned.
In this case 'Gilles GUILLOT' completely failed to say that he is the 
maintainer, including in his bug report (and he is using a different email 
address from the one in the package: I only know this is the same person 
from a private reply).

I think he needs to run R under a debugger and find out what 'freezes' 
means.  If as I suspect this is in the compiled code of the package, it 
is not a bug in R.

Windows binaries for R 2.6.0 are built with a different compiler than 
3.4.5, and this has triggered a few package problems (note, not problems 
in R but in the packages concerned):

- a couple of packages infinite loop because the calculations are done in 
extended precision registers and so do not terminate, something we have 
had to work around for LAPACK, for example.

- I think three packages infinite-loop because they write outside array 
bounds.  In one case it always did, but used to get away with it.

None of these explain a Rgui/Rterm difference, if that is what is meant 
here (R has a 'command line' in both, and Rterm is a 'console application' 
in Windows-speak).  The main possible difference relates to I/O, and I see 
that Geneland uses Fortran I/O.  Fortran I/O to '*' (or units 5/6) is 
incompatible with a GUI application, and in gcc 4.2.1 Fortran I/O is 
pretty much incompatible with C I/O (initializing has been known to break 
C I/O).  So I suggest that Fortran I/O is removed and replaced by calls to 
realpr etc.

Filing a bug report on issues in your own package is not at all good form: 
R-bugs is not for 'feed back', but there *was* a comment filed on PR#9964.
#
I can confirm that if the Geneland is built under gcc 3.4.5 it works in R 
2.6.0 in Rgui (modulo the output which is sent nowhere).  So the issue is 
the Fortran code of the package, and very likely its use of Fortran I/O.

Since this confirms there is not a bug in R 2.6.0, I am filing this on 
R-bugs and closing the bug report.  There is a bug in the package, but 
that is not a subject for R-bugs.

I've put my build up on the CRANextras repository: Uwe might like to 
remove his so that users get that one until such a time as the I/O issues 
are resolved.
On Tue, 16 Oct 2007, Prof Brian Ripley wrote: