Re: R-beta: R-0.61.3 and __setfpucw.

Goran Brostrom (gb@stat.umu.se)
Tue, 12 May 1998 12:34:19 +0200 (MET DST)


Date: Tue, 12 May 1998 12:34:19 +0200 (MET DST)
From: Goran Brostrom <gb@stat.umu.se>
To: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
Subject: Re: R-beta: R-0.61.3 and __setfpucw.
In-Reply-To: <x24syvyg7t.fsf@blueberry.kubism.ku.dk>

On 12 May 1998, Peter Dalgaard BSA wrote:

> Goran Brostrom <gb@stat.umu.se> writes:
> 
> > 
> > 
> > I have Linux, Redhat 4.2, on two machines, an i586 and a Sparc.
> > When I compile R-0.61.3 on them, everything is fine on i586,
> > but on the Sparc I get, in the last linking stage: 
> > 
> > ../lib/libunix.a(system.o): In function `main':
> > /usr/local/R-0.61.3/src/unix/system.c:353: undefined reference to
> > `__setfpucw'
> > ../lib/libunix.a(system.o): In function `R_CleanUp':
> > /usr/local/R-0.61.3/src/unix/system.c:430: undefined reference to
> > `__setfpucw'
> 
> Using __setfpucw is a horrible hack in the first place... 
> 
> You could try simply commenting it out. Or study <fpu_control.h> and
> guess what the mechanism is supposed to be on Sparc Linux.

I commented out two (identical) lines in src/unix/system.c:

/*	__setfpucw(_FPU_DEFAULT); */

and the compilation worked alright. The file /usr/include/fpu_control.h:

#ifndef _FPU_CONTROL_H
#define _FPU_CONTROL_H

#if defined(__i386__)
# include <i386/fpu_control.h>
#elif defined(__mc68000__)
# include <m68k/fpu_control.h>
#elif defined(__sparc__)
# include <sparc/fpu_control.h>
#else
# error architecture not supported by Linux C library
#endif 

#endif /* _FPU_CONTROL_H */

Is __sparc__ automatically defined? In sparc/fpu_control.h there
is a line

extern void __setfpucw __P ((unsigned short));

but __setfpucw doesn't seem to be defined somewhere. I don't 
understand the significance of all this, but maybe it doesn't
matter?

Goran
---------------------------------------------------------
Goran Brostrom
Department of Statistics              tel: +46 90 786-5223
Umea University                       fax: +46 90 786-6614
S-90187 Umea, Sweden               e-mail: gb@stat.umu.se
----------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._