<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">New patch is attached.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">1) No and no.  You can’t use #warn or #warning or the #pragma ways of doing a preprocessor warn/message/info because it isn’t standard (MSVC doesn’t have either
 #warn or #warning), #error is standard.  Also, you can’t rely on running a small program, and EVERYTHING I’ve seen emphasizes this point.  You can link but not actually run.  There is a specific reason, cross-compiling.  For example, if you relied on printf
 and are cross-compiling arm on an x86 host, then it won’t run on the x86 host system.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Since you asked what others do, I had looked at what CMake does specifically when detecting the compiler:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">* Creates and links a small executable that has a main() function in it with a few global variables defined like
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     char cmake_compiler_name[] = “COMPILER_NAME=[gcc]”;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     char cmake_compiler_version_major[] = “COMPILER_VERISON_MAJOR=[00000004]”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     char cmake_compiler_version_minor[] = “COMPILER_VERISON_MINOR=[00000008]”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     etc.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     These variables are set through an extensive search through compiler predefined macros and some clever preprocessing macros/tricks.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">* Searches through the executable via regex to find something like “COMPILER_NAME=[gcc]” and extracts gcc, then 4, then 8 etc.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">* An aside: because not every compiler produces a.out as default executable and not every compiler has –o flag to redirect output, it searches every file that
 was produced in the temporary work space besides the temporary.c file.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">If you look at how LLVM does it, just look at GetHostTriple.cmake in llvm_root/cmake/modules/GetHostTriple.cmake.  It calls config.guess on non-Windows platforms
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">2) I personally don’t know about his one.  32e is embedded in lots of places including our internal tools and commercial product.  I can check with everybody
 else of course and see what they think, but you would have to wait till after the holiday season for anything to happen about it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">3) I did this in the new patch along with ppc64le<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-- Johnny<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> C Bergström [mailto:cbergstrom@pathscale.com]
<br>
<b>Sent:</b> Wednesday, December 17, 2014 1:24 PM<br>
<b>To:</b> Carlo Bertolli<br>
<b>Cc:</b> Peyton, Jonathan L; openmp-dev@dcs-maillist2.engr.illinois.edu<br>
<b>Subject:</b> Re: Getting Architecture Patch<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">3 nits<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">1) I think you can change it to #warn and avoid the compiler failure (please see what others are doing with similar approach and let me know). There's also possibility of actually linking and doing a printf which would avoid the whole regex
 mess.. Is there a strong reason for #error? (maybe faster?)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">2) Would anyone @Intel strongly oppose a global rename of 32e to something which is more commonly used (x86_64, amd64 /* joking */ or x8664)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">3) Can you include ARM64<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Dec 18, 2014 at 1:53 AM, Carlo Bertolli <<a href="mailto:cbertol@us.ibm.com" target="_blank">cbertol@us.ibm.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p><span style="font-family:"Arial","sans-serif"">Hi Johnny</span><br>
<br>
<br>
<span style="font-family:"Arial","sans-serif"">Thanks for this patch. I will give it a try on our machines and let you know.</span><br>
<br>
<br>
<span style="font-family:"Arial","sans-serif"">Cheers</span><br>
<br>
<span style="font-family:"Arial","sans-serif"">-- Carlo</span><br>
<br>
<br>
<img border="0" width="16" height="16" id="_x0000_i1025" src="cid:image001.gif@01D01A22.D1924A20" alt="Inactive hide details for "Peyton, Jonathan L" ---12/17/2014 01:18:14 PM---Due to recent aarch64 and ppc64le port patches that "><span style="font-family:"Arial","sans-serif";color:#424282">"Peyton,
 Jonathan L" ---12/17/2014 01:18:14 PM---Due to recent aarch64 and ppc64le port patches that have been sent, I have finished up this bit of c</span><br>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">From:
</span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">"Peyton, Jonathan L" <<a href="mailto:jonathan.l.peyton@intel.com" target="_blank">jonathan.l.peyton@intel.com</a>></span><br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">To: </span>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif"">"<a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.engr.illinois.edu</a>" <<a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.engr.illinois.edu</a>></span><br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">Cc: </span>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif"">Carlo Bertolli/Watson/IBM@IBMUS, C Bergström <<a href="mailto:cbergstrom@pathscale.com" target="_blank">cbergstrom@pathscale.com</a>></span><br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">Date:
</span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">12/17/2014 01:18 PM</span><br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">Subject:
</span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">Getting Architecture Patch</span><o:p></o:p></p>
<div class="MsoNormal">
<hr size="2" width="100%" noshade="" style="color:#8091A5" align="left">
</div>
<p class="MsoNormal"><br>
<br>
<br>
<span style="font-family:"Calibri","sans-serif"">Due to recent aarch64 and ppc64le port patches that have been sent, I have finished up this bit of code for CMake which detects the architecture by probing the compiler.</span><br>
<span style="font-family:"Calibri","sans-serif""> </span><br>
<span style="font-family:"Calibri","sans-serif"">Carlo and C. Bergström can you two look at this patch and see if it adequately solves the detecting architecture problem for you both and add the proper macro into the GetArchitecture.cmake (this will make sense
 once you look at the patch)?  I would like this to be committed before either port so both ports can use this new patch.</span><br>
<span style="font-family:"Calibri","sans-serif""> </span><br>
<span style="font-family:"Calibri","sans-serif"">-- Johnny</span><br>
<span style="font-family:"Calibri","sans-serif""> [attachment "cmake_get_arch.patch" deleted by Carlo Bertolli/Watson/IBM]
</span><o:p></o:p></p>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>