From ripley at stats.ox.ac.uk  Fri Jun 13 18:05:54 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 13 Jun 2008 17:05:54 +0100 (BST)
Subject: [Rd] how to install header files in package
In-Reply-To: <362D5567-0041-4FD3-8422-E2DC5A4FD470@epfl.ch>
References: <C71798B1-3A0E-4EA3-A079-51C5DF34C6BE@epfl.ch>
	<18514.30939.151586.554494@ron.nulle.part>
	<Pine.GSO.4.56.0806130747080.12010@devsun3201.insightful.com>
	<362D5567-0041-4FD3-8422-E2DC5A4FD470@epfl.ch>
Message-ID: <alpine.LFD.1.10.0806131703200.12707@gannet.stats.ox.ac.uk>

On Fri, 13 Jun 2008, Kjell Konis wrote:

> Here's what I'm doing: I define some C functions in pkgA and register them 
> with R_RegisterCCallable and I want to use them in pkgB. When building pkgB, 
> R CMD INSTALL expects to find the header files for the registered C functions 
> in pkgA*/include (where the * denotes the installed version of pkgA). AFAICT 
> there is no mechanism to put the header files from pkgA into pkgA*/include.
>
> Putting the header files in pkgA/inst/include solves the problem but it seems 
> like there should be a better way to do this.

That is the intended way.  The headers you want to install may not be the 
same as those you use to build the package.  See e.g. Matrix for an 
example.

>
> Kjell
>
>
>
> On 13 juin 08, at 16:54, Bill Dunlap wrote:
>
>> On Fri, 13 Jun 2008, Dirk Eddelbuettel wrote:
>> 
>>> 
>>> On 13 June 2008 at 14:28, Kjell Konis wrote:
>>> | Is there a way to get R CMD INSTALL (and friends) to copy the header
>>> | files from a source package's src directory to the include directory?
>>> 
>>> Only if you (ab-)use the 'make all' target in src/Makefile to copy them, 
>>> as a
>>> recent thread on r-devel showed.  Some of us suggested that a 'make 
>>> install'
>>> target would be a nice thing to have.
>> 
>> Which 'include' directory do you mean?  $RHOME/include or
>> <pkg>/include?
>> 
>> You could put a copy of the *.h files into inst/include
>> to get them into <pkg>/include.
>> 
>> Putting them into $RHOME/include isn't always desirable
>> or possible (permission problems).  If you install
>> *.h files then you are probably also distributing
>> *.so, *.dll, and *.lib (on Windows) files and they
>> should go into a parallel directory.  Where should
>> they go?
>> 
>> ----------------------------------------------------------------------------
>> Bill Dunlap
>> Insightful Corporation
>> bill at insightful dot com
>> 
>> "All statements in this message represent the opinions of the author and do
>> not necessarily reflect Insightful Corporation policy or position."
>
> ______________________________________________
> 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] how to install header files in package
Prof Brian Ripley