Created attachment 183864 [details] patch This patch: * Adds GFORTRAN and FLANG options - The FLANG option takes advantage of the newly proposed fortran:flang argument to build with llvm-based flang instead of the gcc-based gfortran * Adds the patch patch-configure to prevent the configuration failure due to configure script expecting G77 fortran, test for which flang fails for some reason - This should probably be reported either upstream to flang, or upstream to R, depending on if flang is or isn't expected to be G77 * Adds the patch patch-src_main_complex.c because cpow and clog functions are missing for some reason with flang Builds in poudriere. Passes simple tests.
Another way is to just switch to flang permanently.
Created attachment 183893 [details] patch adding FORTRAN options
Created attachment 183894 [details] patch switching fortran to flang Please use either one of the patches.
Non-default Flang support was added directly to math/R in r445026. Thanks for submitting.
devel/rstudio can't be built with default settings without flang being the default in math/R.
I understand and I think flang could soon be the default (at least on amd64, but hopefully other architectures as well when they are supported), but let's first give a little time to confirm R works reliably with flang. I am running with flang and so far so good, but I would like to have more time to test. Also, with flang depending specifically on llvm39, I am seeing two versions of llvm being pulled in, llvm40 for some ports and then llvm39 for flang. I think most users would not be pleased to need two different versions of llvm installed when they are each over 1 GB.
I first missed that flang doesn't support i386 yet. It looks like it has some maturing to do. We need to wait.
Thanks for the patch! Exciting to see uses for flang! I am hoping to clean up my patches soon and upstream them, after which i386 should be possible. However, I don't have any i386 to test on. Concerning the llvm39 dependency: that's what upstream has and I really don't want to open the can of worms to change that. I am hoping that they will keep updating to newer llvm releases.
(In reply to Johannes M Dieterich from comment #8) You are welcome! Thanks for maintaining the flang port. It looks like flang currently fails to build several packages, for example lapack. So it isn't too mature yet. I tried it with llvm40 and it worked fine. I created several upstream bug reports about build failures, llvm40, and i386 support. IMO, patch in bug#220313 should be committed as an experimental feature for now to allow those who can benefit use it.