From rhurlin at gwdg.de  Tue Jun  7 18:36:21 2005
From: rhurlin at gwdg.de (Rainer Hurling)
Date: Tue Jun  7 18:36:55 2005
Subject: [Rd] alloca() on FreeBSD (PR#7890)
In-Reply-To: <20050606112426.3827BA3C4@slim.kubism.ku.dk>
References: <20050606112426.3827BA3C4@slim.kubism.ku.dk>
Message-ID: <42A5CD05.3080507@gwdg.de>

One first reaction to your suggestions.

ripley@stats.ox.ac.uk wrote:
> On Mon, 23 May 2005 vangyzen@stat.duke.edu wrote:
>>R-2.1.0 fails to compile on the newest release of FreeBSD, complaining about
>>undefined references to __builtin_alloca.  On FreeBSD, alloca() is declared in
>>stdlib.h, not alloca.h as the R sources expect.  Therefore, HAVE_DECL_ALLOCA
>>does not get set, so the R sources declare alloca() after it has already been
>>#defined by stdlib.h.
>>
>>A possible fix is to modify the configure script to look for the declaration of
>>alloca() in stdlib.h (perhaps after it fails to find it in alloca.h).
> 
> 
> It is already supposed to, so it is not finding the declaration there 
> either. If you look up the definition of
> 
> AC_CHECK_DECLS([alloca], , , [#include <alloca.h>])
> 
> it searches in stdlib.h.  Can you please send us the appropriate part of 
> config.log?  It may be that this is failing because alloca.h is not found
> (but AC_FUNC_ALLOCA is making the same assumptions).
> 
> Perhaps the easiest way out is to override the setting on FreeBSD: can 
> you please confirm that manually changing
> 
> #define HAVE_DECL_ALLOCA 1
> 
> in config.h works?

Changing "#define HAVE_DECL_ALLOCA" to 1
in line 81 of R-2.1.0/src/include/config.h
gives me the following stopping:


mkdir ../../../../library/grDevices/libs
building package 'graphics'
mkdir ../../../library/graphics
mkdir ../../../library/graphics/R
mkdir ../../../library/graphics/demo
mkdir ../../../library/graphics/po
mkdir ../../../library/graphics/man
Error in dyn.load(x, as.logical(local), as.logical(now)) :
         unable to load shared library 
'/usr/local/R-2.1.0/library/grDevices/libs/grDevices.so':
   /usr/local/R-2.1.0/library/grDevices/libs/grDevices.so: Undefined 
symbol "__builtin_alloca"
Execution halted
*** Error code 1
Stop in /usr/local/R-2.1.0/src/library/graphics.
*** Error code 1
Stop in /usr/local/R-2.1.0/src/library.
*** Error code 1
Stop in /usr/local/R-2.1.0/src.
*** Error code 1
Stop in /usr/local/R-2.1.0.


Because I have almost no skills in C, automake and autoconf I have no 
idea on how to go on, sorry.

Hopefully Eric makes considerable progress ...


-- 
Dr. Rainer Hurling                           Phone: (049) 551 69401-145
Abteilung Waldschutz, Sachgebiet Insekten    Fax:   (049) 551 69401-160
Nieders?chsische Forstliche Versuchsanstalt  Mobil: (049) 160 5835-143
Gr?tzelstra?e 2, D-37079 G?ttingen, GERMANY  Rainer.Hurling@nfv.gwdg.de


[Rd] alloca() on FreeBSD (PR#7890)
Rainer Hurling