# LLVM 11.0 Finally Available With Flang Fortran Compiler

**URL:** <https://fortran-lang.discourse.group/t/llvm-11-0-finally-available-with-flang-fortran-compiler/341>\
**Category:** Announcements\
**Created:** [October 12, 2020, 1:16pm UTC](https://fortran-lang.discourse.group/t/llvm-11-0-finally-available-with-flang-fortran-compiler/341 "2020-10-12T13:16:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [October 12, 2020, 1:16pm UTC](https://fortran-lang.discourse.group/t/llvm-11-0-finally-available-with-flang-fortran-compiler/341/1 "2020-10-12T13:16:00Z")

</div>

> **[LLVM 11.0 Finally Available With Flang Fortran Compiler, Continued C++20 Work...](https://www.phoronix.com/scan.php?page=news_item&px=LLVM-11.0-Released)**

Does anyone have experience installing this? I would be grateful to learn how well it works.

I believe this is also worth including in the next Fortran monthly newsletter.

---

<div class="post-metadata">

**Author:** ![tiziano.mueller](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/tiziano.mueller/32/12_2.png) [@tiziano.mueller](https://fortran-lang.discourse.group/u/tiziano.mueller)\
**Post date:** [October 12, 2020, 2:55pm UTC](https://fortran-lang.discourse.group/t/llvm-11-0-finally-available-with-flang-fortran-compiler/341/2 "2020-10-12T14:55:40Z")

</div>

```auto
git clone https://github.com/llvm/llvm-project.git
mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja -DLLVM_ENABLE_PROJECTS='flang' ../llvm
cmake --build .
cmake --build . -- install

```

But the HEAD from October 9 still showed the following (and I doubt they changed that for the release);

```auto
$ f18 --version

f18 compiler (under development), version 12.0.0
$ f18 --help
f18: LLVM Fortran compiler

Usage: f18 [options] <input files>

Defaults:
  When invoked with input files, and no options to tell
  it otherwise, f18 will unparse its input and pass that on to an
  external compiler to continue the compilation.
  The external compiler is specified by the F18_FC environment
  variable. The default is 'gfortran'.
  If invoked with no input files, f18 reads source code from
  stdin and runs with -fdebug-measure-parse-tree -funparse.
[...]

```

So, it can parse Fortran, but not generate code yet (for that you need either GFortran or the driver from the Flang project).

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [October 13, 2020, 7:45am UTC](https://fortran-lang.discourse.group/t/llvm-11-0-finally-available-with-flang-fortran-compiler/341/3 "2020-10-13T07:45:55Z")

</div>

The flang package is available in Fedora Rawhide (development version):

> **[Flang Download (DEB, RPM, TXZ)](https://pkgs.org/download/flang)**

```
$ flang --version

f18 compiler (under development), version 11.0.0

```

But yes, the code is generated by gfortran… Have you any information about when it will be able to compile the code by itself ?

---

<div class="post-metadata">

**Author:** ![tiziano.mueller](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/tiziano.mueller/32/12_2.png) [@tiziano.mueller](https://fortran-lang.discourse.group/u/tiziano.mueller)\
**Post date:** [October 13, 2020, 8:22am UTC](https://fortran-lang.discourse.group/t/llvm-11-0-finally-available-with-flang-fortran-compiler/341/4 "2020-10-13T08:22:51Z")

</div>

It seems that when building from the LLVM `master` you can already enable the new driver by adding `-DFLANG_BUILD_NEW_DRIVER=ON` to the cmake incantation, see [https://github.com/llvm/llvm-project/tree/master/flang#build-the-new-flang-driver](https://github.com/llvm/llvm-project/tree/master/flang#build-the-new-flang-driver)  
When building you may have to use `--parallel N` to reduce the number of parallel build steps because some targets require \>=8GB of memory while linking.

And if I remember correctly Gary mentioning in his talk at FortranCon that the current state should be enough to start developing tools like `flang-format`, or some static analysis (the `flang-doc` build target is supposed to generate FIR documentation).
