From gb@stat.umu.se  Wed Feb 20 10:27:46 2002
From: gb@stat.umu.se (=?iso-8859-1?Q?G=F6ran_Brostr=F6m?=)
Date: Wed, 20 Feb 2002 11:27:46 +0100 (CET)
Subject: [Rd] f2c problem
In-Reply-To: <CD0C9ECC-25E7-11D6-B62B-003065CC4CB8@mclink.it>
Message-ID: <Pine.LNX.4.44.0202201122330.30989-100000@tal.stat.umu.se>

On Wed, 20 Feb 2002, Stefano Iacus wrote:

> In building princurve package for MacOS I need to use f2c on fortran 
> files.
> 
> Here is the output of f2c for getlam.f
> 
> getlam.f:
>     getlam:
>     newlam:
>     lamix:
> Error on line 116 of getlam.f: Declaration error for v: adjustable 
> dimension on non-argument
> Error on line 116 of getlam.f: wr_ardecls:  nonconstant array size
> 
> what I found strange is that both newlam and get lam have definitions 
> like
> 
> 
>   subroutine newlam(n,p,sx,lambda,tag)
>        integer n,p,tag(n)
>        double precision sx(n,p),lambda(n),lami
> 
> 
> but for some reason f2c complains only with the last lamix subroutine
> 
>    subroutine lamix(ns,p,x,s,lambda,dismin,temps)
>        integer ns,p
>        double precision lambda,x(p),s(ns,p),dismin,temps(p)
>        double precision v(2,p),d1sqr,d2sqr,d12,dsqr, d1,w
> 
> probably because v is not passed as an argument.

Definitely because v is local; this construct is a gcc extension to the 
standard, I think. Solutions: 1) pass v as an argument and reserv space
in the calling function. 2) Instead of  p, use 1000 (or some other
large number, which p never will exceed). 3) Use gcc.

Gran
> 
> Any idea on how to manage this in f2c ?
> 
> Stefano
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-devel 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-devel-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-- 
 Gran Brostrm                      tel: +46 90 786 5223
 professor                           fax: +46 90 786 6614
 Department of Statistics            http://www.stat.umu.se/egna/gb/
 Ume University
 SE-90187 Ume, Sweden             e-mail: gb@stat.umu.se

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] f2c problem
=?iso-8859-1?Q?G=F6ran_Brostr=F6m?=