Skip to content

location of Rconfig.h when using architecture-dependent subdirs

4 messages · Kjell Konis, Brian Ripley

#
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>

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?

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
#
On Wed, 29 Sep 2010, Konis Kjell wrote:

            
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 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.

  
    
#
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:

            
Yes.  Not sure we will get to it for 2.12.0, but you can presumably 
edit the file yourself pro tem.