From jeroenooms at gmail.com  Wed Feb 14 13:32:32 2018
From: jeroenooms at gmail.com (Jeroen Ooms)
Date: Wed, 14 Feb 2018 13:32:32 +0100
Subject: [Rd] 
 Setting the path to Rtools for package compilation on Windows
In-Reply-To: <CA+hbrhWiHVot0NYEzx39afUdPVWZc-AswQg5wJOAcabd0tcS-A@mail.gmail.com>
References: <CA+hbrhVN1ngZiyVH2q2Z+rOMeLhGZ88eQu4c04unkVDo7zkugw@mail.gmail.com>
 <CABFfbXv17xKpr84ifZfbuga9xdQ1rPG5BVBQmjRFk3JcBifYUA@mail.gmail.com>
 <CA+hbrhWiHVot0NYEzx39afUdPVWZc-AswQg5wJOAcabd0tcS-A@mail.gmail.com>
Message-ID: <CABFfbXupKgXDRE9pqAuCWUMMA78csVc28D6S-ue=8sP-eWpowA@mail.gmail.com>

On Tue, Feb 13, 2018 at 7:58 PM, Peter Langfelder
<peter.langfelder at gmail.com> wrote:
> On Tue, Feb 13, 2018 at 2:20 AM, Jeroen Ooms <jeroenooms at gmail.com> wrote:
>
>> Thanks for your question. Your logs show that 'gcc' is not found. As
>> of R 3.3 you need to set the path to the compiler using the BINPREF
>> variable. This is because we ship two separate versions of gcc, one
>> targeting win32 and one targeting win64. I am not sure what your
>> rtools installation looks like, but could you try setting this
>> environment variable:
>>
>>   BINPREF="M:/R/Rtools-3.4/mingw_$(WIN)/bin/"
>>
>> I think this will do the job.
>
> Thanks, that indeed did the trick. May I suggest that this hint be
> also included in "REMAINING TASKS" section of the file Rtools.txt that
> is part of the Rtools distribution?  The R installation manual does
> mention BINPREF and BINPREF64 but I missed that part...

Glad it worked. Actually BINPREF64 only exists when building R itself.
For the R user there is no BINPREF64. There is only BINPREF which has
to point to a 32bit gcc when R runs in 32bit, and a 64bit compiler
when R runs in 64bit. But if you compile R packages you need both at
the same time. Hence the "$(WIN)" variable in the BINPREF above.

Yes the rtools setup is a bit convoluted, and we're currently
discussing ways to improve this. Thanks for your suggestion.



[Rd] Setting the path to Rtools for package compilation on Windows
Jeroen Ooms