[R-pkg-devel] OpenMP variable not specified in enclosing 'parallel'
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