Hi, I need to link mypackage to 2 other packages so I can call some C functions defined in these 2 packages from mine. I've tried Depends: packageA, packageB LinkingTo: packageA, packageB as suggested by the "5.4 Registering native routines" section of the "Writing R Extensions" manual but then only packageA is seen at compilation time (gcc is called with -I"/some/path/to/packageA/include" only). I've also tried Depends: packageA, packageB LinkingTo: packageA LInkingTo: packageB but this time only packageB is seen at compilation time. How can I link mypackage to both packageA and packageB? Thanks! H.
What platform? We've seen a similar report that said the problem was on Windows only. Like this one, it had nothing to reproduce. On Wed, 6 Aug 2008, hpages at fhcrc.org wrote:> Hi, > > I need to link mypackage to 2 other packages so I can call > some C functions defined in these 2 packages from mine. > > I've tried > Depends: packageA, packageB > LinkingTo: packageA, packageB > as suggested by the "5.4 Registering native routines" section > of the "Writing R Extensions" manual but then only packageA is > seen at compilation time (gcc is called with > -I"/some/path/to/packageA/include" only). > > I've also tried > Depends: packageA, packageB > LinkingTo: packageA > LInkingTo: packageB > but this time only packageB is seen at compilation time. > > How can I link mypackage to both packageA and packageB? > > Thanks! > > H. > > ______________________________________________ > 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
Prof Brian Ripley wrote:> Thanks for the examples. The specific problems was a typo, but there was > another on Windows (missing quotes). > > This should work in R-patched and R-devel on Linux and Windows now.Yes this works now. Thanks! H.> > On Thu, 7 Aug 2008, Herve Pages wrote: > >> Prof Brian Ripley wrote: >> [...] >>> >>> Somewhere on your website would be best. >> >> Here they are (stub versions): >> >> http://bioconductor.org/packages/misc/ >> >> mypackage tries to link to packageA and packageB but this is what I get: >> >> hpages at lamb1:~> R-2.8 CMD INSTALL mypackage_0.0.0.tar.gz >> * Installing to library '/home/hpages/R-2.8/library' >> * Installing *source* package 'mypackage' ... >> ** libs >> gcc -std=gnu99 -I/home/hpages/R-2.8/include -I/usr/local/include >> -I"/home/hpages/R-2.8/library/packageA/include" -fpic -g -O2 -Wall >> -c R_init_mypackage.c -o R_init_mypackage.o >> In file included from R_init_mypackage.c:1: >> mypackage.h:2:30: error: packageB_defines.h: No such file or directory >> make: *** [R_init_mypackage.o] Error 1 >> ERROR: compilation failed for package 'mypackage' >> ** Removing '/home/hpages/R-2.8/library/mypackage' >> >> hpages at lamb1:~> gcc --version >> gcc (GCC) 4.1.0 (SUSE Linux) >> Copyright (C) 2006 Free Software Foundation, Inc. >> This is free software; see the source for copying conditions. There >> is NO >> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR >> PURPOSE. >> >> hpages at lamb1:~> cat /etc/SuSE-release >> SUSE LINUX 10.1 (X86-64) >> VERSION = 10.1 >> >> I get the same on 64-bit openSUSE 10.3 >> >> Thanks! >> >> H. >> >