[R-pkg-devel] [Learning] the secret of Win[dows C-backed packages]

Hadley Wickham h.wickham at gmail.com
Mon Aug 15 15:13:25 CEST 2016


One other option is to include the src for libmagic inside your
package, and use that as a fallback if it's not installed on the
system. That gives linux users what they want (linking to the system
package), and windows users what they want (it just works). It only
works for simple libraries, but it looks like libmagic might qualify.

I could have sworn I did that in a package, but I can't remember which one :(

Hadley

On Sat, Aug 13, 2016 at 11:34 AM, Bob Rudis <bob at rud.is> wrote:
> Hey folks,
>
> I usually stare in awe at the C-backed packages that rely on eternal
> libraries which are super-easy to get working on macOS & *nix _but_ that
> also work perfectly on Windows. I fire up Windows (*maybe*) once a month to
> test some of my packages but I'm curious as to what I need to do to setup a
> more extended toolchain to create libraries such as are found in
> https://github.com/rwinlib.
>
> Jeroen (I think others, too) seem to effortlessly package those up and I
> fully grok his "anticonf" setup and the 32-bit & 64-bit Windows library
> setup. I just can't seem to actually do the building.
>
> Why I'm asking what I'm asking (below) is that I'm working on something for
> the $DAYJOB now - https://github.com/hrbrmstr/wand - that requires libmagic
> and I kinda, unfortunately, actually need it to also work on Windows (it
> usually doesn't matter, but this time some folks who use Windows systems at
> work need to use this forthcoming package).
>
> Rather than b[eu]g Jeroen or others for library building/packaging, I'd be
> very, keenly interested in learning what else besides Rtools I need to
> install to be able to make similar binary bundles to include during
> installation (and to have my compiled pkgs work on Windows).
>
> My disdain for Windows and my frustration with the super-limited toolchain
> components installed with Rtools is probably contributing to my inability
> to solve this on my own (no bash.exe...rly?). I used to use cygwin back in
> the day but there are so many cautions in the main R docs abt compatible
> versions that I'd rather not spend hours or days figuring out something
> that others already have.
>
> One example here is that I actually managed to get one of the libmagic
> support packages (the regex library) built and installed on Windows (in the
> toolchain /usr/local) but can't get libmagic's `configure` script to
> find/use it.
>
> I'm more than willing to write up any copious pointers folks provide into a
> detailed, attributed blog post or R Journal article since this is seriously
> the only bit holding me back from working on and releasing a ton of other
> compilation-required packages to CRAN. I also know I'm not the only one who
> gets stalled when trying to get similar things (especially those with full
> Boost dependencies) to work on Windows.
>
> thx,
>
> -Bob
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



-- 
http://hadley.nz



More information about the R-package-devel mailing list