Skip to content
Prev 30474 / 63421 Next

Dynamic linking to binary code from other packages??

Dear, R-devel,

Thanks very much for the response!

Here is what I am trying to do (also listed below in the previous messages):
"I am writing a package that needs some C++ functions from an external
SDK (Affymetrix fusion).  The same functions are already compiled into
another package (affxparser)."

I've looked through the "Writing R Extensions" manual, and can't find
this documented very clearly.  A previous question to the list gave me
the very kind response pasted below.  I've looked at the suggested
examples (lme4 using C functions from Matrix).

For lme4 to include Matrix C functions, I find it does this:
-- lme4 uses the line "LinkingTo" in the description file.
-- "Matrix.h" is an include in the C files.

Is this all that I need to do to my package?

But, of course, the header files still have to be included in the
Matrix install to make this work.  In the case of Matrix, it looks
like the header file is located at:
/usr/local/lib/R/site-library/Matrix/include/Matrix.h (under Ubuntu
8.10)

How does Matrix knows to export the Matrix.h header file here? What
else is the Matrix package doing to allow other packages to share its
C functions?

I apologize in advance if this is something obvious that I am missing!

Thanks, and warmest regards,

Charles
On Sat, Oct 25, 2008 at 3:15 PM, Dirk Eddelbuettel <edd at debian.org> wrote: