Bug#909463: ITP: flang -- Fortran compiler using the LLVM toolkit

Alastair McKinstry mckinstry at debian.org
Mon Dec 3 14:53:39 GMT 2018


So,

I've got  a first packaging of the "flang" Fortran compiler using LLVM-7.

I'm uploading to unstable / NEW when a clean build is complete, but the 
code is available:
https://salsa.debian.org/mckinstry/flang.

It appears the "f18" replacement front-end is a while off, while flang 
could make Buster.

It would be good if the LLVM team could review this :-)

Several patches are required to make it build with gcc/gfortran (the 
developers work with PGI fortran).

eee_arithmetic and ieee_exceptions currently do not compile with 
gfortran, as it is pickier about the
quality of the Fortran (!) and C bindings.
I'm working on patches, and also exploring the possibilty of a 2-stage 
compile (rebuilding flang using flang).

This build is done against Debian's build of LLVM-7, rather than the 
adapted LLVM used with flang.
The flang fork of llvm handles several extensions to llvm debug metadata.
The flang llvm converts these to DWARF that is specific to Fortran.
These llvm changes are waiting to be upstreamed; they are in review at 
llvm.org right now.
By default, flang does not generate this extended metadata. There’s a 
flag that must be set at compile time.
Currently this is not set, and the code produced appears to work fine in 
Debian.

As a pre-release, the compiler does not have a version number; I have 
named the binary package 'flang-7'
as it uses LLVM-7, with a version 20180921, as this is the release dump 
of the tarball.

Binaries produced are linked against the flang runtime libraries, 
shipped in libflang0d-7.
Currently these do not have SONAMEs set (eg. they are named libflang.so) 
; I intend to patch this to set SOVERSION to 0d
as per Debian practice. (Hence the package name libflang0d-7).

flang-driver, which produces the top-end driver, is shipped as a 
separate tarball but included here as a subdirectory.
The driver, normally called 'clang-7', is renamed 'flang'

Flang uses a different module file format to gfortran (Module files, 
suffixed '.mod', are precompiled header files).
For the moment, flang places its standard module files in /usr/include, 
which is ok as gfortran keeps its
system module files in /usr/lib/gcc/x86_64-linux-gnu/8/finclude. For 
interoperability, gfortran and flang will need
to search for and keep their module files in different directories.  In 
Redhat/Fedora, Fortran module files are placed
in $LIBDIR/$FMODDIR, typically /usr/lib/fortran.  I am proposing to put 
them in /usr/lib/$multarch/fortran/$compiler
with compiler being gfortran-8, flang-7, etc. (mod file formats can 
become incompatible between compiler versions, eg.
gfortran-7 and gfortran-8). I am working on dh-fortran-mod, a debhelper 
extension, for user packages, and patches
for gfortran and flang to search $FMODDIR.

regards

Alastair

On 24/09/2018 15:03, Alastair McKinstry wrote:
>
> On 24/09/2018 10:47, Sylvestre Ledru wrote:
>> Hello,
>>
>> Looks luck! please let me know how I can help :)
>>
>> S
>
> Thanks!
>
> I'm following the instructions here: 
> https://github.com/flang-compiler/flang/wiki/Building-Flang
>
> and have gotten the flang-driver to build ok with llvm-7, once I 
> disabled including POLLY into the tools. (I'll come back to that 
> later). This appears to be a polyhedral optimizer:
> https://polly.llvm.org/
>
> Its now breaking because the main build needs llvm-lit.
>
> This appears to be an internal build tool to llvm. Can it be exposed, 
> or what would you recommend ?
>
> thanks
>
> Alastair
>
>
>>
>> Le 24/09/2018 à 10:08, Alastair McKinstry a écrit :
>>> Package: wnpp
>>> Severity: wishlist
>>> Owner: Alastair McKinstry <mckinstry at debian.org>
>>>
>>> * Package name    : flang
>>>    Version         : 7.0
>>>    Upstream Author : Steve Scalpone <sscalpone at nvidia.com>
>>> * URL             : https://github.com/flang-compiler
>>> * License         : BSD
>>>    Programming Lang: C++, Fortran
>>>    Description     : Fortran compiler using the LLVM toolkit
>>>
>>>
>>>
>>> Flang is a Fortran compiler targeting LLVM.
>>>
>>> Flang is a Fortran language front-end designed for integration with 
>>> LLVM and the LLVM optimizer.
>>>
>>> Flang+LLVM is a production-quality Fortran solution designed to be 
>>> co-installed and is fully interoperable with Clang C++.
>>>
>>> Flang single-core and OpenMP performance is now on par with GNU 
>>> Fortran; for certain applications up to 40% faster.
>>> Flang has implemented Fortran 2003 and has a near full 
>>> implementation of OpenMP through version 4.5 targeting multicore CPUs.
>>>
>>> This will be maintained with the LLVM packaging team.
>>>
>>> _______________________________________________
>>> Pkg-llvm-team mailing list
>>> Pkg-llvm-team at alioth-lists.debian.net
>>> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-llvm-team
>
-- 
Alastair McKinstry, <alastair at sceal.ie>, <mckinstry at debian.org>, https://diaspora.sceal.ie/u/amckinstry
Misentropy: doubting that the Universe is becoming more disordered.




More information about the Pkg-llvm-team mailing list