Steve Lianoglou
2011-Sep-08 19:59 UTC
[Rd] As a package author, is there a way to specify that your package is architecture (x86_64) specific?
Hi, Essentially: subject line says it all. I've created a package that wraps an external c++ library (which I didn't write) that only successfully compiles on 64bit machines. I'd like to make the package broadly available, but is there a way to get it on CRAN if the 32-bit builds break by specifying its 64-bit only somehow? Luckily, I've ./configure'd my R-devel-compiled-from-source to only build x86_64 libs, so I can develop and install my package against that, but trying to `R CMD INSTALL mypackage` using the official R binaries breaks since it also tries to build a 32-bit *.so (I'm on a mac). I see hints in how to limit which architecture a package is built against in the R-ext and R-admin manuals where they seem to suggest to include a src/Makefile in order to do that ... but I'm not sure what I should put in it. Is it possible to limit the build architecture by putting something in my src/Makevars instead of trying to engineer an entire Makefile since "the normal build process" works just fine (except this whole architecture thing)? Even if it can't go on CRAN as 64-bit only, it would be great if I can put up some easy install instructions for people to d/l my source package externally and use it that way. Thanks, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
Steve Lianoglou
2011-Sep-08 20:11 UTC
[Rd] As a package author, is there a way to specify that your package is architecture (x86_64) specific?
Quick follow up before I get RTFM'd: I just found I can do: R CMD INSTALL --no-multiarch mypackage To get this to successfully work from the command line, so apologies for the second part of the question. The first Q remains, which is to either get this to happen "automagically" via Makevars, or somehow specify the package as 64bit only to see if the package can go up on CRAN until I can find time to fix the problem (if/when). Thanks, -steve On Thu, Sep 8, 2011 at 3:59 PM, Steve Lianoglou <mailinglist.honeypot at gmail.com> wrote:> Hi, > > Essentially: subject line says it all. > > I've created a package that wraps an external c++ library (which I > didn't write) that only successfully compiles on 64bit machines. > > I'd like to make the package broadly available, but is there a way to > get it on CRAN if the 32-bit builds break by specifying its 64-bit > only somehow? > > Luckily, I've ./configure'd my R-devel-compiled-from-source to only > build x86_64 libs, so I can develop and install my package against > that, but trying to `R CMD INSTALL mypackage` using the official R > binaries breaks since it also tries to build a 32-bit *.so (I'm on a > mac). > > I see hints in how to limit which architecture a package is built > against in the R-ext and R-admin manuals where they seem to suggest to > include a src/Makefile in order to do that ... but I'm not sure what I > should put in it. > > Is it possible to limit the build architecture by putting something in > my src/Makevars instead of trying to engineer an entire Makefile since > "the normal build process" works just fine (except this whole > architecture thing)? > > Even if it can't go on CRAN as 64-bit only, it would be great if I can > put up some easy install instructions for people to d/l my source > package externally and use it that way. > > Thanks, > > -steve > > -- > Steve Lianoglou > Graduate Student: Computational Systems Biology > ?| Memorial Sloan-Kettering Cancer Center > ?| Weill Medical College of Cornell University > Contact Info: http://cbio.mskcc.org/~lianos/contact >-- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
Simon Urbanek
2011-Sep-08 20:11 UTC
[Rd] As a package author, is there a way to specify that your package is architecture (x86_64) specific?
On Sep 8, 2011, at 3:59 PM, Steve Lianoglou wrote:> Hi, > > Essentially: subject line says it all. > > I've created a package that wraps an external c++ library (which I didn't write) that only successfully compiles on 64bit machines. >That doesn't sound right, it contradicts your subject line - x86_64 is just one of many 64-bit architectures ... but from what you describe it's not about an architecture at all - it's about the library .. (see below).> I'd like to make the package broadly available, but is there a way to > get it on CRAN if the 32-bit builds break by specifying its 64-bit > only somehow? > > Luckily, I've ./configure'd my R-devel-compiled-from-source to only > build x86_64 libs, so I can develop and install my package against > that, but trying to `R CMD INSTALL mypackage` using the official R > binaries breaks since it also tries to build a 32-bit *.so (I'm on a > mac). > > I see hints in how to limit which architecture a package is built > against in the R-ext and R-admin manuals where they seem to suggest to > include a src/Makefile in order to do that ... but I'm not sure what I > should put in it. >No, that's not the purpose.> Is it possible to limit the build architecture by putting something in > my src/Makevars instead of trying to engineer an entire Makefile since > "the normal build process" works just fine (except this whole > architecture thing)? > > Even if it can't go on CRAN as 64-bit only, it would be great if I can > put up some easy install instructions for people to d/l my source > package externally and use it that way. >The configure script is designed to figure out things like that, so all you need to do is to add a configure script that will check whether the package can be built for that architecture or not. In fact, it should really check whatever the C++ library does that prevents it from working elsewhere. The particularities depends on the library so you'll need to provide more info in oder to help you better ... Note that it will also ensure that the package will be built only for one architecture. Cheers, Simon