[R-pkg-devel] Compiling 32-bit on Windows using 64-bit gcc and -m32

biii m@iii@g oii de@@ey@ws biii m@iii@g oii de@@ey@ws
Mon Sep 7 19:07:59 CEST 2020


Hello,

 

My question is:

Can I use the 64-bit gcc to build a 32-bit package with the -m32 command
line option with Rtools?  And, can that work for CRAN?  Or more generally,
is there a work-around for needing lots of RAM during compilation with the
32-bit compiler?

 

The background is:

I'm trying to compile a the development version of RxODE
(https://github.com/nlmixrdevelopment/RxODE/issues/278), but I'm hitting
32-bit memory limits (using >3GB and possibly >4GB RAM during compilation)
using the 32-bit version of gcc.  Specifically, 

 

"C:/rtools40/mingw32/bin/"gcc [etc., see the link above for the full command
line]

 

yields the error

 

cc1.exe: out of memory allocating 65536 bytes

 

There is no problem building with mingw64, and I played around to confirm
that by using:

 

Sys.setenv(BINPREF="c:/rtools40/mingw64/bin/")

 

And compilation completed successfully (though installation failed as
expected because the compiled .dll couldn't load on 32-bit R).

 

Thanks,

 

Bill


	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list