[R-pkg-devel] OpenMP variable not specified in enclosing 'parallel'

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Mon Mar 23 18:34:03 CET 2020


On Mon, 23 Mar 2020 15:29:20 +0100
Emil Sjørup <emilsjoerup using 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



More information about the R-package-devel mailing list