Bug 228011 - math/openblas: switch to flang
Summary: math/openblas: switch to flang
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-06 06:11 UTC by robert.ayrapetyan
Modified: 2021-03-20 08:06 UTC (History)
5 users (show)

See Also:
phd_kimberlite: maintainer-feedback+


Attachments
necessary changes for switching to flang (2.60 KB, patch)
2018-05-06 06:11 UTC, robert.ayrapetyan
no flags Details | Diff
poudriere log for a patched port (205.63 KB, application/x-7z-compressed)
2018-05-06 22:06 UTC, robert.ayrapetyan
no flags Details
necessary changes for switching to flang (3.18 KB, patch)
2018-05-07 06:41 UTC, robert.ayrapetyan
no flags Details | Diff
poudriere log for a patched port (207.00 KB, application/x-7z-compressed)
2018-05-07 06:41 UTC, robert.ayrapetyan
no flags Details
proper handling of non-supported archs (3.39 KB, patch)
2018-05-07 22:24 UTC, robert.ayrapetyan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.