[R-pkg-devel] R CMD build with configure-args

Russell Almond ralmond at macosx.com
Thu Jul 30 20:53:10 CEST 2015

I've got a package that uses C code to link R to a third-party library.

I've set up my configure script to take an argument --with-netica
which passes the location of the library, header files, &c.

So I can install the package using:

   $ R CMD INSTALL RNetica

and check the packge (build the manual) using:

   $ R CMD check RNetica

My problem comes when I want to build a source tarball for
distribution.  I used to use:

   $ R CMD build RNetica

but that generates an error:

   gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -I. -I/src -fpic
-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Cases.c -o Cases.o
   In file included from Cases.c:18:0:
   ./RNetica.h:4:20: fatal error: Netica.h: No such file or directory
    #include <Netica.h>

basically, it the Includes directory is not getting set correctly.  If
I use the same syntax as the INSTALL (i.e., just configure-args and
not the install-args wrapper) I get the same error message.  R CMD
INSTALL --build creates a binary tarball and not a source.

I think used to work correctly under R 3.1.  Did I miss something in
the release notes?

I'm having this problem under Ubuntu 14.4 (I think I'm also having the
problem on Mac OS X; I'm not having the problem under Windows, but
mostly because I'm using an environmental variable instead of a
command line argument to pass the location of the 3rd party library.)

Thanks in advance for any help.

Russell Almond
Associate Professor, Measurement & Statistics
Educational Psychology and Learning Systems
1114 W. Call St.
Florida State University
Tallahassee, FL 32306
(850) 644-5203
ralmond at fsu.edu

More information about the R-package-devel mailing list