Thanks again for your help.

>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.

We indicated the possible bug in the comment section, with a link on the GitHub 
issue. 
They didn't consider this, and just refused the package, sending us the .log 
file explaining the issue on .omp reduction.

>1. In your ./configure script, check for the Fortran compiler being
>flang-new version 17. If the check succeeds, disable OpenMP altogether.

How can I do that ? I can create a .configure file on the root folder, but how 
do I check the compiler version ? As in .R file, with FC = ... ? And what about 
OpenMP deactivation ? 

>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.

I'll try this, thanks. I'm still unable to install flang-new on my device, as 
it is too voluminate and my computer systematically crash. So i'll do the 
changes and send it on CRAN, hopefully it'll be ok. 


Many thanks for all your help ! 

Best regards, 

Romain Pierlot


----- Mail original -----
De: "Ivan Krylov" <krylov.r...@gmail.com>
À: "Romain Pierlot" <romain.pier...@u-bordeaux.fr>
Cc: "r-package-devel" <r-package-devel@r-project.org>
Envoyé: Lundi 13 Novembre 2023 19:18:32
Objet: Re: [R-pkg-devel] Package submission issue - OMP reduction (flang-new)

On Mon, 13 Nov 2023 16:39:45 +0100 (CET)
Romain Pierlot <romain.pier...@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?

-- 
Best regards,
Ivan
-- 
[ https://www.u-bordeaux.fr/ ] [ 
http://www.aquitaine-poitou-charentes.inserm.fr/ ] 

[ mailto: | Romain Pierlot ] 
Ingénieur de recherches Bio-Informatique 
Équipe BIOSTAT 


[ https://www.u-bordeaux.fr/ | https://www.u-bordeaux.fr ]

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to