[R-pkg-devel] Package submission issue - OMP reduction (flang-new)

Tomas Kalibera tom@@@k@||ber@ @end|ng |rom gm@||@com
Tue Nov 14 15:38:22 CET 2023


On 11/13/23 19:18, Ivan Krylov wrote:
> On Mon, 13 Nov 2023 16:39:45 +0100 (CET)
> Romain Pierlot <romain.pierlot using u-bordeaux.fr> wrote:
>
>> Here is the error message, and the adequate code part is joint in the
>> mail :
>>
>> error:
>> loc("/data/gannet/ripley/R/packages/incoming/frailtypack.Rcheck/00_pkg_src/frailtypack/src/Integrale_mult_scl.f90":1811:17):
>> 'omp.reduction' op must be used within an operation supporting
>> reduction clause interface error: verification of lowering to FIR
>> failed
> Have you tried explaining this in the package submission comment? What
> was the response? Does the reviewer need more evidence? Linking to the
> LLVM issue on GitHub and/or the previous R-package-devel thread may
> help.
>
> (LLVM giveth and LLVM taketh away. While I'm sure that their
> diagnostics helped improve many packages, I have encountered a few
> places in the R code where clang suggested to replace boolean
> expressions && and || with bitwise operations & and |. The code still
> works, but now relies on boolean constants having certain exact bits
> set. Replace a 1 with a 2 and things will break.)
>
> It might be the case that CRAN cannot afford to make an exception for
> this compiler bug. I can imagine a number of workarounds:
>
> 1. In your ./configure script, check for the Fortran compiler being
> flang-new version 17. If the check succeeds, disable OpenMP altogether.
>
> 2. Rewrite your Fortran code so that a variable is never touched before
> it is used in an OpenMP reduction. You may have to declare a new
> variable for every OpenMP reduction loop inside a function.
>
> If you don't succeed in convincing CRAN regarding the compiler bug,
> which one of the two workarounds would you prefer?

I would definitely look for a work-around. In the end we want to give 
users software that works, rather than something that doesn't, but 
telling them, possibly with good evidence, than it is not our fault.

Tomas



More information about the R-package-devel mailing list