[Rd] Seeking advice regarding compilation of large libraries using RTools (Windows)
richard.beare at gmail.com
Mon Mar 6 06:33:15 CET 2017
I am working on the SimpleITK package for R. This is an enormous package
that is largely automatically generated via a set of swig/json/lua magic,
and is working well under linux and osx. However we're having a lot of
trouble with the Windows side. In fact, we are struggling to get the base
libraries to build using the RTools 3.4 toolchain, even before the worrying
about the R-specific parts.
I'm hoping someone has observed and solved this problem.
The current issue is very long time (possibly infinite) linking of dlls, or
test executables. I've tried using a FAT32 file system for the build, as
suggested by some old bug reports, but still have the issue.
The build system is CMake-based, and we have the same issues with either
unix makefiles or ninja. The current build host is windows 2012 server, but
we've had the same problems on windows 7 and 10.
We're using the -Wa -mbig-obj flags.
One of the problem commands looks like this:
cd D:/B/SimpleITK-build/Code/Explicit/src && C:/Rtools/mingw_64/bin/g++.exe
-Wno-long-long -Wno-unused-local-typedefs -Wno-strict-overflow -Wextra
-Wformat=2 -Wno-format-nonliteral -Wunused -Wpointer-arith -Winvalid-pch
-Wcast-align -Wdisabled-optimization -Woverloaded-virtual -Wshadow
-Wwrite-strings -Wstrict-null-sentinel -Wno-invalid-offsetof -Wa,-mbig-obj
-Wa,-mbig-obj -mthreads -mthreads -O3 -DNDEBUG -mthreads -mthreads
-shared -o ../../../bin/libSimpleITKExplicit-1.0.dll
As a guide, the final shared library is 259M on linux. The windows build
doesn't appear to be memory limited - the ld process is using about 1.5G
and consuming 1 core, but doesn't complete given an entire day.
Any suggestions on where to turn next? Are cross compilers the next step?
[[alternative HTML version deleted]]
More information about the R-devel