# First official release of Flang!

**URL:** <https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333>\
**Category:** Flang\
**Created:** [March 12, 2025, 12:33am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333 "2025-03-12T00:33:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mleair](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mleair](https://fortran-lang.discourse.group/u/mleair)\
**Post date:** [March 12, 2025, 12:33am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/1 "2025-03-12T00:33:34Z")

</div>

Announcing the first official release of Flang! Congratulations to everyone who has contributed to this LLVM Fortran project, which began in late 2020. The blog post below provides a historical recap of the project.

> **[LLVM Fortran Levels Up: Goodbye flang-new, Hello flang!](https://blog.llvm.org/posts/2025-03-11-flang-new/)**
>
> LLVM has included a Fortran compiler “Flang” since LLVM 11 in late 2020. However, until recently the Flang binary was not flang (like clang) but instead flang-new.
> LLVM 20 ends the era of flang-new.

Also, big thanks to Peter Klausler who wrote the first component to Flang, the parser! Peter continues to be one of the main contributors to the project (in fact, he is now the #24 all-time contributor to the LLVM project).

There is still work to be done, but it is great to reach this milestone today!

-Mark

---

<div class="post-metadata">

**Author:** ![jacobwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jacobwilliams/32/10_2.png) [@jacobwilliams](https://fortran-lang.discourse.group/u/jacobwilliams)\
**Post date:** [March 12, 2025, 3:00am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/2 "2025-03-12T03:00:32Z")

</div>

How does one install flang on a Mac (`macos-arm64`) machine? My preferred solution is conda, but [this flang package](https://anaconda.org/conda-forge/flang) doesn’t have a Mac build. I see various llvm packages (e.g., [llvm](https://anaconda.org/conda-forge/llvm)), but installing them they don’t seem to include the actual compiler?

---

<div class="post-metadata">

**Author:** ![jorgeg](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jorgeg/32/6835_2.png) [@jorgeg](https://fortran-lang.discourse.group/u/jorgeg)\
**Post date:** [March 12, 2025, 10:38am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/3 "2025-03-12T10:38:19Z")

</div>

I think @JeffH has installed it on an apple silicon mac and should have some good insights on this. Otherwise, you can probably build it yourself if you have a spare couple of hours for it build from source 🙂

---

<div class="post-metadata">

**Author:** ![rwmsu](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@rwmsu](https://fortran-lang.discourse.group/u/rwmsu)\
**Post date:** [March 12, 2025, 11:52am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/4 "2025-03-12T11:52:02Z")

</div>

Of the long list of tar files etc. given in the download link in the referenced blog, which one actually has a working version of the flang binary. Is it the entire llvm-20.1 tar file. Are any of the other files listed required as well. If the LLVM flang people want us to try their compiler they can stop assuming we are all mind readers and give us explicit instructions on how to install their compiler on our preferred OS. Also, is this still just a alpha release or is it a full working compiler. If the former, what works and what doesn’t work.

---

<div class="post-metadata">

**Author:** ![msz59](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@msz59](https://fortran-lang.discourse.group/u/msz59)\
**Post date:** [March 12, 2025, 12:08pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/5 "2025-03-12T12:08:01Z")

</div>

> [@jacobwilliams](#):
>
> My preferred solution is conda, but [this flang package](https://anaconda.org/conda-forge/flang) doesn’t have a Mac build.

That’s the 19.1.7 version, anyway. Not the LLVM 20 mentioned by OP.

Edit: Also, MacOS comes with Apple’s ‘LLVM clang’ compiler, so one should be careful installing third-party LLVM suite.

---

<div class="post-metadata">

**Author:** ![JeffH](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jeffh/32/595_2.png) [@JeffH](https://fortran-lang.discourse.group/u/JeffH)\
**Post date:** [March 12, 2025, 12:17pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/6 "2025-03-12T12:17:45Z")

</div>

[HPCInfo/buildscripts/llvm-git.sh at master · jeffhammond/HPCInfo · GitHub](https://github.com/jeffhammond/HPCInfo/blob/master/buildscripts/llvm-git.sh) is broken for MacOS, unfortunately. I haven’t cared enough to debug. I am sure the fix is not that hard. I’d love a pull request if somebody can fix it.

---

<div class="post-metadata">

**Author:** ![jacobwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jacobwilliams/32/10_2.png) [@jacobwilliams](https://fortran-lang.discourse.group/u/jacobwilliams)\
**Post date:** [March 12, 2025, 8:22pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/7 "2025-03-12T20:22:30Z")

</div>

I’ve gone this long without building any compilers from source so I’m not going to start now. 😆

---

<div class="post-metadata">

**Author:** ![rwmsu](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@rwmsu](https://fortran-lang.discourse.group/u/rwmsu)\
**Post date:** [March 12, 2025, 8:33pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/8 "2025-03-12T20:33:55Z")

</div>

Same here. Further proof that the old adage that “great minds think alike” is true. 😀

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [March 12, 2025, 11:03pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/9 "2025-03-12T23:03:31Z")

</div>

I am only willing to build compilers that I write myself. 🙂

Yes, as a user I install flang, gfortran and lfortran using conda-forge, but indeed on macOS/arm there is no flang package, so that should be fixed.

---

<div class="post-metadata">

**Author:** ![khb](https://avatars.discourse-cdn.com/v4/letter/k/d6d6ee/32.png) [@khb](https://fortran-lang.discourse.group/u/khb)\
**Post date:** [March 13, 2025, 4:58am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/10 "2025-03-13T04:58:25Z")

</div>

1. install [Homebrew](https://brew.sh)
2. brew install flang

That won’t the the new llvm20 based, but it is quite usable.  
Homebrew flang-new version 19.1.7  
Target: arm64-apple-darwin24.4.0  
Thread model: posix  
InstalledDir: /opt/homebrew/Cellar/flang/19.1.7\_1/libexec  
Configuration file: /opt/homebrew/Cellar/flang/19.1.7\_1/libexec/flang.cfg  
Configuration file: /opt/homebrew/etc/clang/arm64-apple-darwin24.cfg

Note that “quad precision” (kind=16) isn’t supported, but won’t be diagnosed.

---

<div class="post-metadata">

**Author:** ![wyphan](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/wyphan/32/632_2.png) [@wyphan](https://fortran-lang.discourse.group/u/wyphan)\
**Post date:** [March 13, 2025, 5:32am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/11 "2025-03-13T05:32:38Z")

</div>

Congrats to everyone involved in this effort, and thanks for all your hard work so far!

Once [this PR](https://github.com/spack/spack/pull/49456) gets merged into the [Spack package manager](https://spack.io/), you will also be able to build it from sources using `spack install llvm@20 +flang`

---

<div class="post-metadata">

**Author:** ![Carltoffel](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/carltoffel/32/1680_2.png) [@Carltoffel](https://fortran-lang.discourse.group/u/Carltoffel)\
**Post date:** [March 13, 2025, 7:20am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/12 "2025-03-13T07:20:15Z")

</div>

I recommend that you don’t try to build flang yourself. Yesterday morning, I began building the AUR package, and it was completed in the evening. My ThinkPad was almost unusable during that period. 😂  
It took way longer than building LFortran. I think because it had to build mlir (Multi-Level IR Compiler Framework for LLVM), too.

---

<div class="post-metadata">

**Author:** ![jorgeg](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jorgeg/32/6835_2.png) [@jorgeg](https://fortran-lang.discourse.group/u/jorgeg)\
**Post date:** [March 13, 2025, 8:19am UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/13 "2025-03-13T08:19:15Z")

</div>

yeah on a 40 core machine that I ssh into it took ~2 hours hahaha don’t build it on your laptop 😛

---

<div class="post-metadata">

**Author:** ![Rekindle](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rekindle](https://fortran-lang.discourse.group/u/Rekindle)\
**Post date:** [March 14, 2025, 3:18pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/14 "2025-03-14T15:18:40Z")

</div>

I used MacPorts to install Flang20 but I am confused as to what was installed. there are three flang compilers in the bin folder - flang-20-mp-20, flang-mp-20 and flang-new-mp-20. not sure what each one does. Anyone else use this MacPorts install?

---

<div class="post-metadata">

**Author:** ![PierU](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/pieru/32/1848_2.png) [@PierU](https://fortran-lang.discourse.group/u/PierU)\
**Post date:** [March 14, 2025, 5:02pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/15 "2025-03-14T17:02:34Z")

</div>

> [@Rekindle](#):
>
> flang-20-mp-20, flang-mp-20 and flang-new-mp-20

Guess: flang-mp-20 is the classic flang v20, flang-new-mp-20 is the llvm-based flang (“v20”), but I don’t know what can be flang-20-mp-20!

---

<div class="post-metadata">

**Author:** ![Rekindle](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rekindle](https://fortran-lang.discourse.group/u/Rekindle)\
**Post date:** [March 14, 2025, 5:46pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/16 "2025-03-14T17:46:20Z")

</div>

they all give the same response with --version:  
flang version 20.1.0  
Target: arm64-apple-darwin24.3.0  
Thread model: posix

I assume mp refers to openmp compatibility. Will be happier when the Homebrew recipe is updated.

---

<div class="post-metadata">

**Author:** ![jwmwalrus](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jwmwalrus/32/4483_2.png) [@jwmwalrus](https://fortran-lang.discourse.group/u/jwmwalrus)\
**Post date:** [March 14, 2025, 6:28pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/17 "2025-03-14T18:28:14Z")

</div>

Hi @Rekindle and welcome.

Notice that all three binaries end with `-mp-20`, so if the size is the same, they’re simply the same thing (`flang`, `flang-new`, `flang-20`).

And there’s a [PR for homebrew](https://github.com/Homebrew/homebrew-core/pull/206362) in the works.

---

<div class="post-metadata">

**Author:** ![Rekindle](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rekindle](https://fortran-lang.discourse.group/u/Rekindle)\
**Post date:** [March 14, 2025, 7:28pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/18 "2025-03-14T19:28:52Z")

</div>

good to hear about the homebrew PR.

I did find I may have been looking in the wrong directory. the opt/local/lbexec/llvm-20/bin directory has flang, flang-20, and flang-new files. But flang and flang-20 are aliases to flang-new.

---

<div class="post-metadata">

**Author:** ![septc](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/septc/32/77_2.png) [@septc](https://fortran-lang.discourse.group/u/septc)\
**Post date:** [May 16, 2025, 11:29pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/19 "2025-05-16T23:29:38Z")

</div>

I’ve just installed flang-20 via Homebrew 🙂 I will try compiling my programs later.

```auto
% flang --version
Homebrew flang version 20.1.5
Target: arm64-apple-darwin24.4.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/flang/20.1.5/libexec
Configuration file: /opt/homebrew/Cellar/flang/20.1.5/libexec/flang.cfg
Configuration file: /opt/homebrew/etc/clang/arm64-apple-darwin24.cfg

```

---

<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:** [May 17, 2025, 4:08pm UTC](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333/20 "2025-05-17T16:08:19Z")

</div>

I am now also working with Flang 20.1.3 (Linux Fedora 42) to compile gtk-fortran. First, I had to add for Flang the `-fPIC` option in order to avoid a linking error for the shared library (`.so`):

> emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table.

I am now working on other errors and warnings in the examples. It is interesting as Flang gives you errors and warnings different from those of Intel ifx, themselves different from GFortran’s ones. As if each compiler was more concerned with different kinds of problems… So having several compilers is really interesting as they are complementary. I am now eager to do the same thing with LFortran when it will be ready.

[Next page](https://fortran-lang.discourse.group/t/first-official-release-of-flang/9333.md?page=2)
