Skip to content

Documentation: Replace flang-new with flang#171

Open
rouson wants to merge 5 commits intoBerkeleyLab:mainfrom
rouson:doc-no-more-flang-new
Open

Documentation: Replace flang-new with flang#171
rouson wants to merge 5 commits intoBerkeleyLab:mainfrom
rouson:doc-no-more-flang-new

Conversation

@rouson
Copy link
Contributor

@rouson rouson commented Feb 20, 2026

fpm 0.13.0 recognizes flang as LLVM flang, which eliminates the need to use the flang-new alias. This PR replaces flang-new with flang in the Julienne documentation and adds notes recommending the use of flang-new with older fpm versions.

Copy link
Member

@bonachea bonachea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed changes look correct, but while we're updating these docs we might as well also fix all the other outdated information.

```
fpm run scaffold \
--compiler flang-new \
--compiler flang \ # with `fpm` 0.12.0 or older, replace "flang" with "flang-new"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bash comments (as suggested by the # above) don't work like this, you cannot insert them in the middle of a command. If a naive user literally pasted this block into bash the "comment" would cause failure.

Suggest instead putting the comment before or after the command.

Comment on lines 47 to 53
As of this writing, however, the above `install.sh` does not install the
Caffeine library file due to an apparent `fpm` bug. Therefore, the next step is
to find the resulting library. For example, use
```
find build -name libcaffeine.a
```
Then move `libcaffeine.a` to the `<caffeine-install-path>/lib` directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire block above is outdated and should be deleted.

Caffeine now does install libcaffeine.a to $PREFIX/lib.

|Vendor | Version(s) Tested | Example shell command |
|-------|-------------------------|--------------------------------------------------|
|LLVM | 20-21 | `fpm test --compiler flang-new --flag "-O3"` |
|LLVM | 20-21 | `fpm test --compiler flang --flag "-O3"` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|LLVM | 20-21 | `fpm test --compiler flang --flag "-O3"` |
|LLVM | 20-22 | `fpm test --compiler flang --flag "-O3"` |

Comment on lines 6 to +8
of a program. As of this writing, "Flang 22" refers to the main branch of
[llvm-project](https://github.com/llvm/llvm-project), which when built from
source, responds to `flang-new --version` with text that includes `22.0.0git`.
source, responds to `flang --version` with text that includes `22.0.0git`.
Copy link
Member

@bonachea bonachea Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flang 22 is released, this final sentence should probably just be deleted.

Comment on lines 25 to 26
git clone -b gcc14.3.0-julienne3.2.0-caffeine0.6.0 \
https://github.com/BerkeleyLab/flang-testing-project.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this recommending building from source using an old snapshot from our fork?

At this point it's probably better to clone from the LLVM upstream.

Better yet, download the LLVM 22 binary release package, or (once Brew packaging is finished) just brew install llvm flang.

rouson and others added 3 commits March 5, 2026 05:50
Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
Comment on lines 22 to 33
### Build a LLVM Flang
```bash
brew install gcc@14 # (gcc@15 failed to build LLVM on the tested computer)
git clone -b gcc14.3.0-julienne3.2.0-caffeine0.6.0 \
https://github.com/BerkeleyLab/flang-testing-project.git
git clone https://github.com/rouson/handy-dandy
chmod u+x handy-dandy/src/fresh-llvm-build.sh
cd flang-testing-project
../handy-dandy/src/fresh-llvm-build.sh --prefix=<llvm-install-path>
cd ..
```
where angular brackets denote variables to replace with your chosen value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest replacing the entire section above with something like the following:
(the suggest feature doesn't seem to be working correctly here, I think it's the nested code block)

Install LLVM Flang

Use Homebrew to install LLVM and Flang version 22 or later:

brew update
brew install llvm flang

This should install LLVM flang in your PATH (likely /opt/homebrew/bin/flang) and LLVM clang in a location like /opt/homebrew/opt/llvm/bin/clang (usually not in your PATH).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants