Skip to content

External header files not found

3 messages · cstrato, Kasper Daniel Hansen

#
Dear All,

Currently I am testing whether my package xps can be compiled on the Mac 
with clang, and indeed everything is fine.

However, when I create ~/.R/Makevars to set CC and CXX as described in:
http://cran.r-project.org/doc/manuals/r-patched/R-admin.html#OS-X-packages
then the header files of the external framework that I use are no longer 
found.

Since my package depends on the external C++ framework, I had to create 
my own 'configure.in' and 'Makefile' which checks e.g. for the presence 
of the variable ROOTSYS containing the path to the framework.

Trying to follow the example:
http://cran.r-project.org/doc/manuals/r-patched/R-exts.html#Configure-example
I added following lines to my configure.in file:

: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
    echo "could not determine R_HOME"
    exit 1
fi
CC=`"${R_HOME}/bin/R" CMD config CC`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
AC_LANG(C++)
AC_PROG_CPP
AC_PROG_CC

ROOT_CPPFLAGS="-I. -I${ROOTSYS}/include"
CPPFLAGS="${CPPFLAGS} ${ROOT_CPPFLAGS}"

However, this did not help, the header files are still not found.

Can someone tell me what I need to do so that the external header files 
are found, or does ~/.R/Makevars overwrite everything?

Best regards,
Christian
_._._._._._._._._._._._._._._._._._
C.h.r.i.s.t.i.a.n   S.t.r.a.t.o.w.a
V.i.e.n.n.a           A.u.s.t.r.i.a
e.m.a.i.l:        cstrato at aon.at
_._._._._._._._._._._._._._._._._._
1 day later
#
Dear Kasper,

Thank you for this suggestion, although I must admit that I do not quite 
understand how to use PKG_CPPFLAGS (eve after looking at 'Writing R 
Extensions').
Nevertheless, I found an earlier reply from you at:
https://stat.ethz.ch/pipermail/r-devel/2007-March/045016.html
which did help me. I needed to modify my Makefile and not my config 
file. Now everything works.

Best regards,
Christian
On 4/21/13 3:54 AM, Kasper Daniel Hansen wrote: