<html><body>
<p><font size="2" face="sans-serif">All</font><br>
<br>
<font size="2" face="sans-serif">This patch adds up to Jonathan's one with the ppc64le case. Be warned that it only implements auto-detection of the ppc64le architecture. I am working on integrating my own patch, which permits compilation of ppc64le, with this one.</font><br>
<br>
<i>(See attached file: cmake_get_arch_v3.patch)</i><br>
<br>
<font size="2" face="sans-serif">Please, let me know of any issues</font><br>
<br>
<font size="2" face="sans-serif">-- Carlo</font><br>
<br>
<img width="16" height="16" src="cid:2__=0ABBF725DFCD0DF08f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for "Peyton, Jonathan L" ---12/17/2014 07:28:07 PM---New patch is attached. 1) No and no.  You can’t use"><font size="2" color="#424282" face="sans-serif">"Peyton, Jonathan L" ---12/17/2014 07:28:07 PM---New patch is attached. 1) No and no.  You can’t use #warn or #warning or the #pragma ways of doing a</font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From:      </font><font size="1" face="sans-serif">"Peyton, Jonathan L" <jonathan.l.peyton@intel.com></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To:        </font><font size="1" face="sans-serif">C Bergström <cbergstrom@pathscale.com>, Carlo Bertolli/Watson/IBM@IBMUS</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Cc:        </font><font size="1" face="sans-serif">"openmp-dev@dcs-maillist2.engr.illinois.edu" <openmp-dev@dcs-maillist2.engr.illinois.edu></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date:      </font><font size="1" face="sans-serif">12/17/2014 07:28 PM</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject:   </font><font size="1" face="sans-serif">RE: Getting Architecture Patch</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<font size="2" color="#1F497D" face="Calibri">New patch is attached.</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">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.</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">Since you asked what others do, I had looked at what CMake does specifically when detecting the compiler:</font><br>
<font size="2" color="#1F497D" face="Calibri">* Creates and links a small executable that has a main() function in it with a few global variables defined like </font><br>
<font size="2" color="#1F497D" face="Calibri">     char cmake_compiler_name[] = “COMPILER_NAME=[gcc]”;</font><br>
<font size="2" color="#1F497D" face="Calibri">     char cmake_compiler_version_major[] = “COMPILER_VERISON_MAJOR=[00000004]”</font><br>
<font size="2" color="#1F497D" face="Calibri">     char cmake_compiler_version_minor[] = “COMPILER_VERISON_MINOR=[00000008]”</font><br>
<font size="2" color="#1F497D" face="Calibri">     etc.</font><br>
<font size="2" color="#1F497D" face="Calibri">     These variables are set through an extensive search through compiler predefined macros and some clever preprocessing macros/tricks.</font><br>
<font size="2" color="#1F497D" face="Calibri">* Searches through the executable via regex to find something like “COMPILER_NAME=[gcc]” and extracts gcc, then 4, then 8 etc.</font><br>
<font size="2" color="#1F497D" face="Calibri">* 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.</font><br>
<font size="2" color="#1F497D" face="Calibri">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 </font><font size="2" color="#1F497D" face="Wingdings">J</font><font size="2" color="#1F497D" face="Calibri">.</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">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.</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">3) I did this in the new patch along with ppc64le</font><br>
<a name="_MailEndCompose"></a><font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">-- Johnny</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" face="Calibri"><b>From:</b></font><font size="2" face="Calibri"> C Bergström [</font><font size="2" face="Calibri"><a href="mailto:cbergstrom@pathscale.com">mailto:cbergstrom@pathscale.com</a></font><font size="2" face="Calibri">] </font><font size="2" face="Calibri"><b><br>
Sent:</b></font><font size="2" face="Calibri"> Wednesday, December 17, 2014 1:24 PM</font><font size="2" face="Calibri"><b><br>
To:</b></font><font size="2" face="Calibri"> Carlo Bertolli</font><font size="2" face="Calibri"><b><br>
Cc:</b></font><font size="2" face="Calibri"> Peyton, Jonathan L; openmp-dev@dcs-maillist2.engr.illinois.edu</font><font size="2" face="Calibri"><b><br>
Subject:</b></font><font size="2" face="Calibri"> Re: Getting Architecture Patch</font><br>
<font size="3" face="Times New Roman"> </font><br>
<font size="3" face="Times New Roman">3 nits</font><br>
<font size="3" face="Times New Roman"> </font><br>
<font size="3" face="Times New Roman">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?)</font><br>
<font size="3" face="Times New Roman"> </font><br>
<font size="3" face="Times New Roman">2) Would anyone @Intel strongly oppose a global rename of 32e to something which is more commonly used (x86_64, amd64 /* joking */ or x8664)</font><br>
<font size="3" face="Times New Roman"> </font><br>
<font size="3" face="Times New Roman">3) Can you include ARM64</font><br>
<font size="3" face="Times New Roman"> </font><br>
<font size="3" face="Times New Roman">Thanks</font><br>
<font size="3" face="Times New Roman"> </font><br>
<font size="3" face="Times New Roman">On Thu, Dec 18, 2014 at 1:53 AM, Carlo Bertolli <</font><a href="mailto:cbertol@us.ibm.com" target="_blank"><font size="3" color="#0000FF" face="Times New Roman"><u>cbertol@us.ibm.com</u></font></a><font size="3" face="Times New Roman">> wrote:</font>
<ul style="padding-left: 4pt"><br>
<font size="3" face="Arial">Hi Johnny</font><font size="3" face="Times New Roman"><br>
<br>
</font><font size="3" face="Arial"><br>
Thanks for this patch. I will give it a try on our machines and let you know.</font><font size="3" face="Times New Roman"><br>
<br>
</font><font size="3" face="Arial"><br>
Cheers</font><font size="3" face="Times New Roman"><br>
</font><font size="3" face="Arial"><br>
-- Carlo</font><font size="3" face="Times New Roman"><br>
<br>
<br>
</font><img src="cid:2__=0ABBF725DFCD0DF08f9e8a93df938@us.ibm.com" width="16" height="16" alt="Inactive hide details for "Peyton, Jonathan L" ---12/17/2014 01:18:14 PM---Due to recent aarch64 and ppc64le port patches that "><font size="3" color="#424282" face="Arial">"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</font><font size="3" face="Times New Roman"><br>
</font><font size="1" color="#5F5F5F" face="Arial"><br>
From: </font><font size="1" face="Arial">"Peyton, Jonathan L" <</font><a href="mailto:jonathan.l.peyton@intel.com" target="_blank"><font size="1" color="#0000FF" face="Arial"><u>jonathan.l.peyton@intel.com</u></font></a><font size="1" face="Arial">></font><font size="1" color="#5F5F5F" face="Arial"><br>
To: </font><font size="1" face="Arial">"</font><a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank"><font size="1" color="#0000FF" face="Arial"><u>openmp-dev@dcs-maillist2.engr.illinois.edu</u></font></a><font size="1" face="Arial">" <</font><a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank"><font size="1" color="#0000FF" face="Arial"><u>openmp-dev@dcs-maillist2.engr.illinois.edu</u></font></a><font size="1" face="Arial">></font><font size="1" color="#5F5F5F" face="Arial"><br>
Cc: </font><font size="1" face="Arial">Carlo Bertolli/Watson/IBM@IBMUS, C Bergström <</font><a href="mailto:cbergstrom@pathscale.com" target="_blank"><font size="1" color="#0000FF" face="Arial"><u>cbergstrom@pathscale.com</u></font></a><font size="1" face="Arial">></font><font size="1" color="#5F5F5F" face="Arial"><br>
Date: </font><font size="1" face="Arial">12/17/2014 01:18 PM</font><font size="1" color="#5F5F5F" face="Arial"><br>
Subject: </font><font size="1" face="Arial">Getting Architecture Patch</font><br>
<hr width="100%" size="2" align="left" noshade><br>
<font size="3" face="Times New Roman"><br>
<br>
</font><font size="3" face="Calibri"><br>
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.<br>
 <br>
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.<br>
 <br>
-- Johnny<br>
 [attachment "cmake_get_arch.patch" deleted by Carlo Bertolli/Watson/IBM] [attachment "cmake_get_arch_v2.patch" deleted by Carlo Bertolli/Watson/IBM] </font><br>
</ul>
</body></html>