From iago.mosqueira at gmail.com  Thu Apr 17 16:35:43 2008
From: iago.mosqueira at gmail.com (Iago Mosqueira)
Date: Thu, 17 Apr 2008 16:35:43 +0200
Subject: [Rd] LinkingTo for 2 packages
Message-ID: <4807603F.9030608@gmail.com>

Hello,

One of our packages contains C++ code that needs to be compiled against
2 other packages. So the LinkingTo field in DESCRIPTION looks like this

LinkingTo: FLCore,FLash

Both packages are also in the Depends field.

In R 2.6.2, first thing we noticed was that both names could not have
any space between them, althoguh the example in the html version of
"Writing R Extensions" does have one:

"A package that wishes to make use of header files in other packages
needs to declare them as a comma-separated list in the field LinkingTo
in the DESCRIPTION file. For example

     Depends: link2, link3
     LinkingTo: link2, link3"

With the space character, this is the compiler call found in 00install.out

g++ -I/usr/local/lib/R/include -I/usr/local/lib/R/include
-I/usr/local/include -I"/usr/local/lib/R/library/FLCore/include"   -fpic
 -g -O2 -c FLBRP.cpp -o FLBRP.o

while deleting it means both include folders are correctly added

g++ -I/usr/local/lib/R/include -I/usr/local/lib/R/include
-I/usr/local/include -I"/usr/local/lib/R/library/FLCore/include"
-I"/usr/local/lib/R/library/FLash/include"   -fpic  -g -O2 -c FLBRP.cpp
-o FLBRP.o

Secondly, this behaviour has been detected when running R CMD check on
Linux (R.Version below), while in windows the second include is never
generated even if the space character is deleted.

g++-sjlj   -Ic:/progra~1/r/r-2.6.2/include
-I"c:/progra~1/r/r-2.6.2/library/FLCore/include"    -O2 -Wall  -c
FLBRP.cpp -o FLBRP.o

We haven't been able to test yet on the latest R 2.7.0rc.

Thanks,


Iago


WINDOWS:
> > R.Version()
$platform
[1] "i386-pc-mingw32"

$arch
[1] "i386"

$os
[1] "mingw32"

$system
[1] "i386, mingw32"

$status
[1] ""

$major
[1] "2"

$minor
[1] "6.2"

$year
[1] "2008"

$month
[1] "02"

$day
[1] "08"

$`svn rev`
[1] "44383"

$language
[1] "R"

$version.string
[1] "R version 2.6.2 (2008-02-08)"


LINUX:
> R.Version()
$platform
[1] "i686-pc-linux-gnu"

$arch
[1] "i686"

$os
[1] "linux-gnu"

$system
[1] "i686, linux-gnu"

$status
[1] ""

$major
[1] "2"

$minor
[1] "6.2"

$year
[1] "2008"

$month
[1] "02"

$day
[1] "08"

$`svn rev`
[1] "44383"

$language
[1] "R"

$version.string
[1] "R version 2.6.2 (2008-02-08)"



[Rd] LinkingTo for 2 packages
Iago Mosqueira