From kjell.konis at epfl.ch  Wed Sep 29 16:53:44 2010
From: kjell.konis at epfl.ch (Konis Kjell)
Date: Wed, 29 Sep 2010 14:53:44 +0000
Subject: [Rd] location of Rconfig.h when using architecture-dependent
 subdirs
In-Reply-To: <alpine.LFD.2.00.1009291454390.25013@toucan.stats.ox.ac.uk>
Message-ID: <C8C91CF0.59B%kjell.konis@epfl.ch>

My problem arose while trying to build Graphviz with a swig binding for R.
The wrapper includes R_ext/RS.h which contains #include <Rconfig.h>, then
uses the pkg-config provided search path taken from libR.pc. Currently
this is

Cflags: -I${rincludedir}

Could this be changed to match R_XTRA_CPPFLAGS?

Kjell



On 29.09.10 16:22, "Prof Brian Ripley" <ripley at stats.ox.ac.uk> wrote:

>On Wed, 29 Sep 2010, Konis Kjell wrote:
>
>> Hello,
>>
>> I just tried configuring R to use architecture-dependent subdirs
>>
>>  $ r_arch=x86_64 ./configure --prefix=/u/smat/konis/testdir
>>
>>
>> on a Debain Squeeze box
>>
>>  $ uname -a
>>  Linux smapc007 2.6.32-5-686 #1 SMP Sat Sep 18 02:14:45 UTC 2010 i686
>> GNU/Linux
>>
>>
>> After building and installing, the Rconfig.h ended up in
>> .../lib/R/include/x86_64 but R.h still includes it as
>>
>>  #include <Rconfig.h>
>
>That should be OK, though.  etc/Makeconf will include
>
>R_XTRA_CPPFLAGS =  -I$(R_INCLUDE_DIR) -I$(R_INCLUDE_DIR)/x86_64
>
>so Rconfig.h will be found when packages are installed.
>
>> I noticed that the CRAN binary for Mac OS X has the following
>> .../lib/R/include/Rconfig.h. What step am I missing that causes this
>>file
>> to be generated?
>
>I suspect it is a back-compatibility fix for packages with Makefiles
>that don't use R_XTRA_CPPFLAGS.
>
>I don't have that file on my Mac build (nor my R 2.12.0 Windows
>builds, both of which use subarchitectures) and I've never seen an
>issue.
>
>>
>> Thanks,
>> Kjell
>>
>>
>> /* This is an automatically generated universal stub for
>> architecture-dependent headers. */
>> #ifdef __i386__
>> #include "i386/Rconfig.h"
>> #elif defined __ppc__
>> #include "ppc/Rconfig.h"
>> #elif defined __ppc64__
>> #include "ppc64/Rconfig.h"
>> #elif defined __x86_64__
>> #include "x86_64/Rconfig.h"
>> #elif defined __arm__
>> #include "arm/Rconfig.h"
>> #else
>> #error "Unsupported architecture."
>> #endif
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>-- 
>Brian D. Ripley,                  ripley at stats.ox.ac.uk
>Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
>University of Oxford,             Tel:  +44 1865 272861 (self)
>1 South Parks Road,                     +44 1865 272866 (PA)
>Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] location of Rconfig.h when using architecture-dependent subdirs
Konis Kjell