From richard.beare at gmail.com  Mon Mar  6 21:21:51 2017
From: richard.beare at gmail.com (Richard Beare)
Date: Tue, 7 Mar 2017 07:21:51 +1100
Subject: [Rd] Seeking advice regarding compilation of large libraries
 using RTools (Windows)
In-Reply-To: <CABFfbXs2s0TfEC1kx+VyFc3yG22Vrc2pOBgMOd36WTLcPSA6AQ@mail.gmail.com>
References: <CA+V7QS9fq5QVZkkfiiHL9XPzbk+72egXDjOVhNzgHxAJJxopaQ@mail.gmail.com>
	<CABFfbXs2s0TfEC1kx+VyFc3yG22Vrc2pOBgMOd36WTLcPSA6AQ@mail.gmail.com>
Message-ID: <CA+V7QS990wTd_odPb1+=C9ntoBQVthjX-cNpLC75UDE7rS2QXQ@mail.gmail.com>

Yep - simpleITK is available at github.com/SimpleITK/SimpleITK. There's
also github.com/SimpleITK/SimpleITKRInstaller - a devtools based installer
for mac and linux.

CMake has a range of build environments. I experimented with MSYS2 and
mingw makefiles, but had trouble with incompatibilities in the path
required by CMake and those options - from memory the sh in RTools/bin
caused problems. Although it sounds like you are saying it is necessary to
install the MSYS2 system as well.

The unix makefile option for CMake appears to work well until the linking
stage. Ninja has problems at a similar stage.

I'll steer clear of dll's, as you suggest. I'm checking those links for
compiler/links flags to see if we're missing anything

Thanks



On Mon, Mar 6, 2017 at 9:51 PM, Jeroen Ooms <jeroenooms at gmail.com> wrote:

> On Mon, Mar 6, 2017 at 6:33 AM, Richard Beare <richard.beare at gmail.com>
> wrote:
> > 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.
>
> Is it available somewhere so we can try it?
>
>
> > 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.
>
> What build environment do you use? The version of gcc with Rtools
> should be ok, but the Rtools build utilities in the "bin" folder (in
> particular 'make') are old and a frequent source of problems. However
> for building external libs you can use other tools, for example those
> from msys2. Just make sure you use gcc/g++ from Rtools.
>
>
> > 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.
>
> On Windows you can avoid the run-time dll mess by building static libs
> of external libraries. See rwinlib for examples:
> https://github.com/rwinlib
>
>
> > Any suggestions on where to turn next? Are cross compilers the next step?
>
> Try building with msys2, but make sure to use gcc/g++ from Rtools by
> setting the `CC` and `CXX` variables in the configure script. Cross
> compiling will make things even more complicated because binaries
> might not be compatible if your cross compiler has a different version
> of gcc or has been configured for another exception model (seh/drawf).
>

	[[alternative HTML version deleted]]



[Rd] Seeking advice regarding compilation of large libraries using RTools (Windows)
Richard Beare