[R-pkg-devel] Fortran compilation issues (errors/warnings) on Fedora clang/llvm

Koen Hufkens koen@hu|ken@ @end|ng |rom gm@||@com
Tue Dec 12 14:06:46 CET 2023


Dear Ivan,

Thanks for these pointers!
I think with your script, reading through the docs and some other packages
structures I sort of made sense of things (the dynamic configure options
are new to me).
I hope this will now resolve the system specific dependencies.

Appreciate the help!
Cheers,
K

On Mon, 11 Dec 2023 at 12:58, Ivan Krylov <krylov.r00t using gmail.com> wrote:

> В Mon, 11 Dec 2023 10:02:14 +0000
> Koen Hufkens <koen.hufkens using gmail.com> пишет:
>
> > error:
> >
> loc("/data/gannet/ripley/R/packages/incoming/rsofun.Rcheck/00_pkg_src/rsofun/src/interface_biosphere_biomee.mod.f90":105:62):
> >
> /data/gannet/ripley/Sources2/LLVM/17.0/llvm-project-17.0.3.src/flang/lib/Lower/ConvertType.cpp:392:
> > not yet implemented: derived type components with non default lower
> > bounds
>
> Experience shows that reporting bugs in flang-new may get them
> acknowledged but not fixed [1]. Have you tried detecting the flang-new
> compiler from the ./configure script and only adding the workaround
> flag if the compiler matches? Something like the following:
>
> #!/bin/sh
> # taken from Writing R Extensions, 1.2. Configure and cleanup
> : ${R_HOME=`R RHOME`}
> if test -z "${R_HOME}"; then
>   echo "could not determine R_HOME"
>   exit 1
> fi
> # determine the Fortran 9x compiler
> FC="`"${R_HOME}/bin/R" CMD config FC`"
> # Use --version output to determine the compiler
> # A different compiler will either accept --version and print something
> # else or fail due to "unknown argument". In both cases the branch will
> # not be taken
> if "$FC" --version 2>/dev/null | grep -q 'flang-new version 17'; then
>  echo "PKG_FCFLAGS = `"${R_HOME}/bin/R" CMD config FCFLAGS`" \
>   " -fc-prototypes-external" >>src/Makevars
> fi
>
> You will still get an "unsupported flag" warning on machines with
> flang-new, but at least it won't warn with standards-compliant
> compilers or crash with flang-new. Unfortunately, I don't know whether
> this is acceptable for CRAN, sorry.
>
> Good luck!
>
> --
> Best regards,
> Ivan
>
> [1] https://stat.ethz.ch/pipermail/r-package-devel/2023q4/009987.html
>


-- 
Koen Hufkens, Ph.D.

Senior Scientist
Geocomputation and Earth Observation
Institute of Geography
University of Bern

founder BlueGreen Labs
bluegreenlabs.org
@koen_hufkens using mastodon.social

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list