Hi, I am getting an error message during pre-checks when I upload a new version of my package to CRAN, and I need help. See: https://win-builder.r-project.org/incoming_pretest/DriftBurstHypothesis_0.3.0.1_20200322_134148/Debian/00install.out The package installs just fine on windows, and on my system. It seems to me that the message tells me that I have an undeclared variable in the parallel setup. So, if I add the variable to the shared variables in the setup, I get the following error message: error: ?iMaxLag? is predetermined ?shared? for ?shared? Passing the variable to the private variable in the setup doesn't work either. Am I misunderstanding the error or is something weird going on? For the interested, the source being uploaded can be found in: ftp://cran.r-project.org/incoming/archive/ under DriftBurstHypothesis_0.3.0.1.tar.gz Best, Emil
[R-pkg-devel] OpenMP variable not specified in enclosing 'parallel'
2 messages · Emil Sjørup, Ivan Krylov
On Mon, 23 Mar 2020 15:29:20 +0100
Emil Sj?rup <emilsjoerup at live.dk> wrote:
const int iMaxLag = 20;
error: ?iMaxLag? not specified in enclosing ?parallel?
error: ?iMaxLag? is predetermined ?shared? for ?shared?
This looks like a compiler bug to me. g++ seems to forget the rule that "const" variables are supposed to be shared despite the default(none) clause. In a similar situation (g++ being confused about the sharing status of a hidden temporary variable it had internally created) I had to remove default(none) and leave a comment explaining that the code would not compile otherwise.
Best regards, Ivan