Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 748087 - sys-devel/flang: request new package as a part of llvm-11 project
Summary: sys-devel/flang: request new package as a part of llvm-11 project
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-12 16:17 UTC by Sergey Torokhov
Modified: 2021-10-03 13:05 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Torokhov 2020-10-12 16:17:41 UTC
The Flang (Fortran 2018 compiler) is the part of the latest LLVM-11 project release.

Could llvm@gentoo project add this package to portage tree?

Reproducible: Always
Comment 1 Sergey Torokhov 2020-10-12 16:23:11 UTC
Related release notes: https://releases.llvm.org/11.0.0/tools/flang/docs/ReleaseNotes.html
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-12 16:34:56 UTC
Note:
"Flang is not yet able to generate LLVM IR for the source code and thus is unable to compile a running binary.

Flang is able to unparse the input source code into a canonical form and emit it to allow testing. Flang can also invoke an external Fortran compiler on this canonical input."

I'll tentatively assign this to llvm@ but they may not want the workload. If that's the case, llvm@, just assign to maintainer-wanted@.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-02-28 22:59:54 UTC
I think that last I checked it, flang depended on mlir, and mlir did not support standalone builds.
Comment 4 unhappy-ending 2021-10-02 05:03:22 UTC
LLVM 13 marks the official release of Flang. Any chance we can get an ebuild? It's been 2 releases and maybe mlir can be built stand alone now?
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-10-02 07:16:16 UTC
(In reply to unhappy-ending from comment #4)
> LLVM 13 marks the official release of Flang. Any chance we can get an
> ebuild? It's been 2 releases and maybe mlir can be built stand alone now?

I'll verify that and try to package them today.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-10-02 13:27:49 UTC
Nope, it's not ready yet.  It doesn't explode right away but it needs a lot of hacks to even build correctly.  I've gotten as far as to having tools installed and I've decided it's not worth the effort.

Someone really needs to start fixing this upstream.  For a start, make tools buildable and installable without hacks and linking to libMLIR.so.

If someone wants to play with it, the ebuild's on 'mlir-wip' branch of https://github.com/mgorny/gentoo.
Comment 7 Sergey Torokhov 2021-10-02 20:23:53 UTC
(In reply to Michał Górny from comment #6)
> Nope, it's not ready yet.  It doesn't explode right away but it needs a lot
> of hacks to even build correctly.  I've gotten as far as to having tools
> installed and I've decided it's not worth the effort.
> 
> Someone really needs to start fixing this upstream.  For a start, make tools
> buildable and installable without hacks and linking to libMLIR.so.
> 
> If someone wants to play with it, the ebuild's on 'mlir-wip' branch of
> https://github.com/mgorny/gentoo.

Is it current problem to provide the both proper build and slotted installation of mril for further use of it? Or is mril almost ready to use and is problem with flang build itself?
Comment 8 Sergey Torokhov 2021-10-03 13:05:46 UTC
Maybe it could help anyone: I found fedora spec files for mlir [1] and flang [2] with their patches. The mlir is compile for me not fast ('dev-python/lit' should be installed before src_configure() phase to run tests).

The one of the main difference from mlir ebuild provided by Michał Górny is option `-DBUILD_SHARED_LIBS=OFF`. With this option enabled build provides smaller number of .so files with many static libs. The list of syn libs after src_install() phase is:

```
# tree | grep "\.so"
    │   ├── libMLIR.so -> libMLIR.so.13
    │   ├── libMLIR.so.13
    │   ├── libmlir_async_runtime.so -> libmlir_async_runtime.so.13
    │   ├── libmlir_async_runtime.so.13
    │   ├── libmlir_c_runner_utils.so -> libmlir_c_runner_utils.so.13
    │   ├── libmlir_c_runner_utils.so.13
    │   ├── libmlir_runner_utils.so -> libmlir_runner_utils.so.13
    │   └── libmlir_runner_utils.so.13

```
instead of list of 177 dynamic libraries (+ symlinks) without `-DBUILD_SHARED_LIBS=OFF` option.


My cpu is slow so testing of trying to create flang ebuild will take long time. 


[1] : https://src.fedoraproject.org/rpms/mlir/blob/rawhide/f/mlir.spec
[2] : https://src.fedoraproject.org/rpms/flang/blob/rawhide/f/flang.spec