[R-pkg-devel] flang doesn't support derived types

Othman El Hammouchi othm@n@e|@h@mmouch| @end|ng |rom protonm@||@com
Thu May 9 17:31:25 CEST 2024


Dear Ivan,

Thank you so much for taking the time. I'd already figured out my misunderstanding on polymorphism in the mean time. The flang limitations are quite unfortunate, especially since there's no way to know this in development. The CI pipeline provided by the RStudio folks uses gfortran, and as far as I know it's the standard compiler in most distributions. Do I understand it correctly that there is no way to specify a Fortran standard in the SystemRequirements? I had resubmitted my package in the mean time with a configure script that aborts the install if the compiler does not support polymorphism, but I understand that this is a fruitless avenue for CRAN?

On the practical side, I did experiment with what you suggested. However, I'm now getting other errors about initialisation of allocatable arrays and the use of intrinsics like isnan, which would be impossible to take out. I should point out my local flang install is version 16, but I cannot install 18 on my system since it's in unstable (this again underscores the problem of developing under these constraints).

What would you advise? And don't you think these Fortran constraints should be better documenten.

Thanks for bearing with me,

Othman El Hammouchi

Sent from Proton Mail mobile

-------- Original Message --------
On 9 May 2024, 16:41, Ivan Krylov wrote:

> Dear Othman El Hammouchi, Welcome to R-package-devel! В Wed, 08 May 2024 16:52:51 +0000 Othman El Hammouchi  пишет: > However, upon submission I received an automatic reply shortly > afterwards saying the build had failed on CRAN's servers for Debian. > The log gives the following error: > > flang/lib/Lower/CallInterface.cpp:949: not yet implemented: support > for polymorphic types Your use of contained procedures in class(t_mack_triangle) and class(t_cl_res) signifies the derived types as being extensible and thus potentially polymorphic. You'll have to replace class(...) with type(...) and move the contained procedures out of the type definitions (and maybe additionally make the types 'sequence' or 'bind(C)' to signify them being non-extensible) to make the code work with flang-18. I'm afraid this will also prevent you from defining destructors for these types. flang-new can be a very disappointing compiler at times [*], but it's what people do use in the real world, especially for 64-bit ARM processors, so in order to keep our packages portable, we have to cater to its whims. -- Best regards, Ivan [*] https://stat.ethz.ch/pipermail/r-package-devel/2023q4/009987.html
	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list