Documentation: Replace flang-new with flang#171
Documentation: Replace flang-new with flang#171rouson wants to merge 5 commits intoBerkeleyLab:mainfrom
flang-new with flang#171Conversation
bonachea
left a comment
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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"` | |
There was a problem hiding this comment.
| |LLVM | 20-21 | `fpm test --compiler flang --flag "-O3"` | | |
| |LLVM | 20-22 | `fpm test --compiler flang --flag "-O3"` | |
| 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`. |
There was a problem hiding this comment.
Flang 22 is released, this final sentence should probably just be deleted.
| git clone -b gcc14.3.0-julienne3.2.0-caffeine0.6.0 \ | ||
| https://github.com/BerkeleyLab/flang-testing-project.git |
There was a problem hiding this comment.
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.
Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
| ### 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. |
There was a problem hiding this comment.
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 flangThis 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).
fpm0.13.0 recognizesflangas LLVMflang, which eliminates the need to use theflang-newalias. This PR replacesflang-newwithflangin the Julienne documentation and adds notes recommending the use offlang-newwith olderfpmversions.