From @ndeol@ev@in @ending from gm@il@com  Fri Jul 13 15:08:51 2018
From: @ndeol@ev@in @ending from gm@il@com (=?UTF-8?Q?And=C3=A9ol_Evain?=)
Date: Fri, 13 Jul 2018 14:08:51 +0100
Subject: [Rd] 
 R API for C/C++ initialisation issue appears with update to R.3.5
In-Reply-To: <alpine.OSX.2.21.1807121746080.632@lukes-macbook-air.local>
References: <CAGOu7fVQXLnbsCJ9GLkTghkWtLxhXY7MAD0ha+RDV+XrEHAq9g@mail.gmail.com>
 <alpine.OSX.2.21.1807121746080.632@lukes-macbook-air.local>
Message-ID: <CAGOu7fWJ0cbL8VQsDeytVgGnhgPp5P2RFG0t2NhOF_rHkdh6Tw@mail.gmail.com>

Thanks you very much !

I cleaned up all the Qt dependencies to simplify reproducibility, but when
I moved the call to Rf_endEmbedded to the destructor of class RManager
instead of right after the callbacks settings, the issue disappeared.
It still seems a bit weird that this placement of Rf_endEmbedded was ok for
R.3.4, but not for R.3.5. Maybe there used to be some bug that allowed it
to work while it shouldn't.

And?ol

2018-07-12 23:50 GMT+01:00 <luke-tierney at uiowa.edu>:

> You might have more luck getting help with a completely self-contained
> example (no QT in particular) and a complete description of how you
> built and ran your example.
>
> That said, the placement of the call to Rf_endEmbedded looks a little
> odd.
>
> Best,
>
> luke
>
> On Thu, 12 Jul 2018, And?ol Evain wrote:
>
> Hello everyone,
>>
>> I have a C++ program that calls R using R_tryEval, very similarly to what
>> package RInside does.
>> It used to work with R.3.4.3 and R.3.4.4. However, since I updated it to
>> R.3.5.1, R sends an error message: "*Error in < My command > : the base
>> graphics system is not registered*"  for any command related to the
>> graphics package.
>>
>> I made a ticket on stackoverflow about it: https://stackoverflow.com/
>> questions/51242993/difference-between-r-3-4-4-and-r-3-5-1-in-r-api-for-c
>>
>> But nobody could explain why so far. And after reducing my code further, I
>> am now enclined to think this is actually a bug.
>>
>> The code provided in stackOverflow is already reduced, but not minimal
>> yet.
>> Since then, I reduced it further to really ensure that it was not an
>> interference from anything around it. So I removed the GUI and the
>> callbacks.
>> Here is a really minimal example attached.
>>
>> In its current form, the program just sends the command :   par("mar") to
>> R, and then the command  dev.off()   .
>> With R.3.4.4, this program print as output what is expected. No error
>> occured during evaluation of the command :
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *No error occured during eval of "par(\"mar\")"EXAMPLE #1 Output: EXAMPLE
>> #1 Output: Result is:  "5.1"Result is:  "5.1"Result is:  "5.1"Result is:
>> "5.1"No error occured during eval of "dev.off()"Result is:  "1"*
>>
>> But the exact same program with R.3.5.1 gives:
>>
>>
>>
>>
>>
>> *An error occured during eval of "par(\"mar\")"No error occured during
>> eval
>> of "dev.off()"Result is:  "1"*
>>
>> The error that occured is not displayed here, since I removed the
>> callbacks
>> to fetch it, but it was:
>> *Error in par("mar") : the base graphics system is not registered*
>>
>>
>> I compiled Microsoft Visual C++ Compiler 15.0 (amd64), and uses 64bits
>> version of R. But previously I also observed the same behovior with
>> 32bits.
>> I also tried re-installing R from scratch, without effect.
>>
>> I am using Windows 10, 64bits
>> Registry variables PATH and R_HOME are correctly set and points to the
>> appropriate version of R, installed in the default directory.
>>
>> I'd be glad to hear any ideas about potential fixes or workaround.
>>
>> Cheers,
>>
>> And?ol Evain
>>
>>
> --
> Luke Tierney
> Ralph E. Wareham Professor of Mathematical Sciences
> University of Iowa                  Phone:             319-335-3386
> Department of Statistics and        Fax:               319-335-3017
>    Actuarial Science
> 241 Schaeffer Hall                  email:   luke-tierney at uiowa.edu
> Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu

	[[alternative HTML version deleted]]



[Rd] R API for C/C++ initialisation issue appears with update to R.3.5
=?UTF-8?Q?And=C3=A9ol_Evain?=