From tangoh at gmail.com  Tue Mar 10 19:26:17 2015
From: tangoh at gmail.com (Hsiu-Khuern Tang)
Date: Tue, 10 Mar 2015 11:26:17 -0700
Subject: [Rd] Notes on building a gcc toolchain for Rtools (but not
	multilib)
In-Reply-To: <54FED07F.7060308@gmail.com>
References: <CAPuMoLZAWUvcQ-ubBwuqzLONom3ZLGJzzUPbmzm2E_2HzCHWYg@mail.gmail.com>
	<54FD7B0E.8040500@gmail.com>
	<CAPuMoLba=3k_tX3Vg8hn8=30LzhTRTpVexkk0WZTn7vCOCp6Mw@mail.gmail.com>
	<54FDDAF2.9040005@gmail.com>
	<CAPuMoLY7oBsRbk_L82u4QEHxL+KRY07yNMotdVesF8+KQ9TdnA@mail.gmail.com>
	<54FED07F.7060308@gmail.com>
Message-ID: <CAPuMoLaBOohEWR5pn9cU8dB=mrvHsmEPx5pz0Sr0CJgJhbM5wQ@mail.gmail.com>

On Tue, Mar 10, 2015 at 4:07 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 09/03/2015 11:02 PM, Hsiu-Khuern Tang wrote:
>> Hi Duncan,
>>
>> On Mon, Mar 9, 2015 at 10:40 AM, Duncan Murdoch
>> <murdoch.duncan at gmail.com> wrote:
>>> On 09/03/2015 11:07 AM, Hsiu-Khuern Tang wrote:
>>>>
>>>> On Mon, Mar 9, 2015 at 3:50 AM, Duncan Murdoch <murdoch.duncan at gmail.com>
>>>> wrote:
>>>>> On 08/03/2015 10:02 PM, Hsiu-Khuern Tang wrote:
>>>>>> Hi,
>>>>>>
>>>>>> [This is a follow-up to the "New version of Rtools for Windows" thread
>>>>>> in January, but I just subscribed and don't know how to reply to an
>>>>>> old thread -- my apologies.]
>>>>>
>>>>> I am planning to put a new Rtools online today that uses a different
>>>>> build of gcc 4.9.2.  I will be concentrating on getting it to work with
>>>>> all the external libraries before the 3.2.0 release next month.  I'm not
>>>>> planning to try to get it to work with R-patched, and I expect it won't:
>>>>>  I needed to make a number of patches to R-devel for compatibility.
>>>>
>>>> I also worked off R-devel (I said wrongly that it was R-patched in my
>>>> original post) and benefited from your compatibility changes.
>>>>
>>>> I look forward to the new Rtools and will test it by compiling some
>>>> packages.
>>>
>>>
>>> It's now on the main site at CRAN, and should propagate to the mirrors
>>> reasonably quickly.  I'm hoping that tomorrow's R-devel build will use it,
>>> but there may be some last minute problems.
>>
>> Is the new Rtools at
>> http://cran.r-project.org/bin/windows/Rtools/Rtools33.exe?  I'm still
>> getting "Error 404 object not found".
>
> There were some permission problems on the file for a while yesterday;
> perhaps the index page got propagated but the actual file didn't.
>
> Duncan Murdoch
>

Got it now, thanks!  Are you planning to publish the build scripts for
the new Rtools as well?

I did the following limited test on the new Rtools:

R CMD INSTALL --no-multiarch Rcpp_0.11.5.tar.gz

I did this under various settings:

- the default settings
- with -std=c++11 added to CXXFLAGS in my .R\Makevars file.

This was done under the newly released R-3.1.3, using the 64-bit R binary.

Here are my findings:

- With the default settings, the command succeeded

- With -std=c++11, there were two problems:
  + api.cpp failed to compile because it could not find execinfo.h
    * I worked around this by using CXXFLAGS=-DWIN32 -std=c++11
    * CXXFLAGS=-std=gnu++11 also works around this
    * Maybe Rcpp needs to guard against this?
  + the package could not be loaded because some of the object files
contain symbols named .refptr.* and .weak.*, which should be excluded
from the exports list
    * To work around this, put this line in .R\Makevars: NM_FILTER = |
sed -e '/\.refptr\./d; /\.weak\./d'


- Hsiu-Khuern



[Rd] Notes on building a gcc toolchain for Rtools (but not multilib)
Hsiu-Khuern Tang