Bug 228011

Summary: math/openblas: switch to flang
Product: Ports & Packages Reporter: robert.ayrapetyan
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Open ---    
Severity: Affects Many People CC: arrowd, michael.osipov, phd_kimberlite, rhurlin, sergey, yuri
Priority: --- Flags: phd_kimberlite: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
necessary changes for switching to flang
none
poudriere log for a patched port
none
necessary changes for switching to flang
none
poudriere log for a patched port
none
proper handling of non-supported archs none

Description robert.ayrapetyan 2018-05-06 06:11:20 UTC
Created attachment 193076 [details]
necessary changes for switching to flang

There are lot of known problems with gfortran when clang is involved, e.g.:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196862

This patch switches to using flang compiler (on amd64 only) and resolves gcc linking issues.

Note:
- deleted file "files/patch-exports+Makefile" (backward compatibility checked on gfortran builds)
- patched "Makefile" contains a "ditry" arch check, I believe it's the best available option now until "flang" will be set by default for all amd64 ports in fortran.mk.
Comment 1 robert.ayrapetyan 2018-05-06 22:06:51 UTC
Created attachment 193122 [details]
poudriere log for a patched port
Comment 2 Yuri Victorovich freebsd_committer 2018-05-07 00:16:35 UTC
There are 2 issues with this patch:
1. The correct way to do this is using the port option FLANG, see math/R how this is done there. Please resubmit the patch doing this 
2. Some people might disagree with this, not sure. This adds a certain level of complexity.

Also, for this all ports that depend on lapack should probably be rebuilt and retested.
Comment 3 robert.ayrapetyan 2018-05-07 06:41:26 UTC
Created attachment 193137 [details]
necessary changes for switching to flang

A less-destructive switch to flang (OPTION).
Comment 4 robert.ayrapetyan 2018-05-07 06:41:50 UTC
Created attachment 193138 [details]
poudriere log for a patched port
Comment 5 robert.ayrapetyan 2018-05-07 22:24:01 UTC
Created attachment 193167 [details]
proper handling of non-supported archs
Comment 6 Dmitry Marakasov freebsd_committer 2021-02-16 02:20:21 UTC
The patch no longer applies. I'm afraid it needs to be updated.
Comment 7 Gleb Popov freebsd_committer 2021-03-20 08:06:11 UTC
There is no reason to refresh the patch yet.

The thing that is now called "flang" is a completely different project than the one from back then in 2018. At the moment, the new Flang isn't able to compile anything, so it is impossible to switch to it. Once the new Flang matures, it will be included in the devel/llvmXX port (I presume), and then we will be able to make a switch.