[flang-dev] Difficulties with In-Tree Build of Flang

Richard Barton via flang-dev flang-dev at lists.llvm.org
Wed Jul 29 08:41:43 PDT 2020

Hi all

I feel like we could make a few simple tweaks to the throwaway driver to make it a bit friendlier in situations like Justin’s.

  *   If flang, when invoked with no input source files, printed a message explaining that it was waiting on standard input then that would immediately have allowed Justin to understand what was happening rather than have to contact the list.
  *   Additionally, we could do a better job in the –help screen of explaining the default Flang behaviour when invoked without input files and with input files, including the F18_FC setting. That would have helped him interpret the failure he was getting.
  *   We could easily support -h as a synonym to –help, -help and -? which we already support, which would then have helped him find that info.

I have posted some patches for review that do all three of these things:

I feel like we should try and get this cherry picked to the LLVM 11 branch also.


From: flang-dev <flang-dev-bounces at lists.llvm.org> On Behalf Of Steve Scalpone via flang-dev
Sent: 24 June, 2020 22:51
To: Szaday, Justin Josef <szaday2 at illinois.edu>; flang-dev at lists.llvm.org <flang-dev at lists.llvm.org>
Subject: Re: [flang-dev] Difficulties with In-Tree Build of Flang

Hi Justin,

The flang script reads from standard input if a source file is not provided on the command line.  It appears to hang, but it’s really just waiting for input.

Flang isn’t hooked up to a code generator yet, so instead, by default, flang generates another Fortran source file and tries to compile that file with a different compiler.  The default is pgf90, but you can set the environment variable F18_FC to be a different compiler, like gfortran.

The flang script that you are running is just a throwaway driver until the real driver is ready.  That work is under development right now, but I don’t know when it will be ready.  Until then, we have this quirky script that lets us test flang semantics.

- Steve

From: flang-dev <flang-dev-bounces at lists.llvm.org<mailto:flang-dev-bounces at lists.llvm.org>> on behalf of flang-dev <flang-dev at lists.llvm.org<mailto:flang-dev at lists.llvm.org>>
Reply-To: "Szaday, Justin Josef" <szaday2 at illinois.edu<mailto:szaday2 at illinois.edu>>
Date: Wednesday, June 24, 2020 at 2:02 PM
To: flang-dev <flang-dev at lists.llvm.org<mailto:flang-dev at lists.llvm.org>>
Subject: [flang-dev] Difficulties with In-Tree Build of Flang

External email: Use caution opening links or attachments

Hello all,

I am having a very difficult time getting in-tree builds of Flang working. My build commands are as follows:
cmake --build . --target check-flang
cmake --build . --target install

The build itself completes successfully, and all the Flang tests pass when using “check-flang”; however, “flang -v” and “flang -h” hang (it does not produce any output and has to be killed) and, when trying to compile a program, I get the error message “execvp(pgf90) failed: No such file or directory” (which fails even if I set F18_FC to gfortran or flang). I have tried building it on a few machines to no avail. I have tested both the Debug and MinSizeRel build types, used both Ninja and Unix Makefiles to build it, and tested a few different versions of GCC/G++, ultimately settling on v9.1.0. I am building from master of the llvm-project GitHub repository.

Any insights here would be appreciated, I am at a loss about what else to try here. Any other debugging suggestions or usage tips would be appreciated as well.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/flang-dev/attachments/20200729/19b1a73c/attachment-0001.html>

More information about the flang-dev mailing list