Most people who want to interface to an external library embed the source code of the library in their R package. I see that ginac is a C++ library which creates additional problems. Only a few R packages interface to an external C++ library (e.g. the interfaces to SYMPHONY, gdal, QuantLib, and JAGS).
Windows is a problem because the toolchain used by R uses static linking to the C++ runtime. This has two side effects: 1) Both the R package and the external DLL must be built with the same toolchain. So you can't just ask CRAN to install the Windows binary from the ginac web site. 2) You can't throw an exception across DLL boundaries. As Dirk says, this is hard. Martyn ________________________________________ From: R-package-devel <r-package-devel-boun...@r-project.org> on behalf of Dirk Eddelbuettel <e...@debian.org> Sent: 14 September 2016 22:02 To: Dorel, Mathurin Cc: r-package-devel@r-project.org Subject: Re: [R-pkg-devel] Validate CRAN package using a linked library On 14 September 2016 at 12:52, Dorel, Mathurin wrote: | I developed a package using the symbolic calculus C library ginac (http://www.ginac.de/<https://email.charite.de/owa/redir.aspx?REF=fSvQ3yE_XkDlPenE4F0MzYwBnO23griAuHvI5OZfSugms-XfndzTCAFodHRwOi8vd3d3LmdpbmFjLmRlLw..>). | I want to submit my package to CRAN, but the library is not installed on CRAN computers | so the C/C++ code does not compile on CRAN winbuilder (http://win-builder.r-project.org/upload.aspx<https://email.charite.de/owa/redir.aspx?REF=KMGXFEO-FDxPH92uJokI4LhZLoWd8IY1gdu9k7Wswrcms-XfndzTCAFodHRwOi8vd2luLWJ1aWxkZXIuci1wcm9qZWN0Lm9yZy91cGxvYWQuYXNweA..>). | | What would be an appropriate solution? Should I ask the CRAN administrators to install ginac on | their test machines, or should I submit a source package in the style of BH which would provided | a compiled version of the ginac library that I could link to? Note that BH is _headers-only_ and hence works by LinkingTo: (which despite its name is NOT used for linking) which covers "most" of the Boost functionality (but eg not Boost graph used in RBGL on BioC). In general the problem you describe is "hard". See Writing R Extensions, and use of SystemRequirements, plus possibly use of configure to detect library presence at the compile-time of you package. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel ----------------------------------------------------------------------- This message and its attachments are strictly confidenti...{{dropped:8}} ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel