<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle21
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:136339972;
        mso-list-type:hybrid;
        mso-list-template-ids:-1824259930 -653128938 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;
        mso-fareast-font-family:DengXian;
        mso-bidi-font-family:Arial;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi all<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">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.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">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.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">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.<o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have posted some patches for review that do all three of these things:<o:p></o:p></p>
<p class="MsoNormal"><a href="https://reviews.llvm.org/D84855">https://reviews.llvm.org/D84855</a><o:p></o:p></p>
<p class="MsoNormal"><a href="https://reviews.llvm.org/D84856">https://reviews.llvm.org/D84856</a><o:p></o:p></p>
<p class="MsoNormal"><a href="https://reviews.llvm.org/D84857">https://reviews.llvm.org/D84857</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I feel like we should try and get this cherry picked to the LLVM 11 branch also.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ta<o:p></o:p></p>
<p class="MsoNormal">Rich<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> flang-dev <flang-dev-bounces@lists.llvm.org>
<b>On Behalf Of </b>Steve Scalpone via flang-dev<br>
<b>Sent:</b> 24 June, 2020 22:51<br>
<b>To:</b> Szaday, Justin Josef <szaday2@illinois.edu>; flang-dev@lists.llvm.org <flang-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [flang-dev] Difficulties with In-Tree Build of Flang<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">Hi Justin,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">- Steve<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span lang="EN-US" style="font-size:12.0pt;color:black">From:
</span></b><span lang="EN-US" style="font-size:12.0pt;color:black">flang-dev <<a href="mailto:flang-dev-bounces@lists.llvm.org">flang-dev-bounces@lists.llvm.org</a>> on behalf of flang-dev <<a href="mailto:flang-dev@lists.llvm.org">flang-dev@lists.llvm.org</a>><br>
<b>Reply-To: </b>"Szaday, Justin Josef" <<a href="mailto:szaday2@illinois.edu">szaday2@illinois.edu</a>><br>
<b>Date: </b>Wednesday, June 24, 2020 at 2:02 PM<br>
<b>To: </b>flang-dev <<a href="mailto:flang-dev@lists.llvm.org">flang-dev@lists.llvm.org</a>><br>
<b>Subject: </b>[flang-dev] Difficulties with In-Tree Build of Flang<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<table class="MsoNormalTable" border="1" cellpadding="0" style="margin-left:.5in;background:#FFEB9C">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black">External email: Use caution opening links or attachments</span></b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black">
</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">Hello all,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">I am having a very difficult time getting in-tree builds of Flang working. My build commands are as follows:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">cmake -G Ninja -DLLVM_ENABLE_PROJECTS="flang" -DCMAKE_INSTALL_PREFIX=$(pwd) -DCMAKE_BUILD_TYPE=MinSizeRel ../llvm<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">cmake --build . --target check-flang<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">cmake --build . --target install<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US">Justin<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>