<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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 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-size:10.0pt;}
@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">Carlo,<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:10.0pt;font-family:"Arial","sans-serif"">“<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">I tried your patch on both p7 and p8 (le).</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">It works on p7, but I get the following error on p8:</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">CMake Error at cmake/HelperFunctions.cmake:37 (message):</span><br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">  check_variable(): arch = ppc64le is unknown</span><o:p></o:p></p>
<p class="MsoNormal"><br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">That string name ("ppc64le") is the default for p8 machines and we would like it to be distinguished from the p7 one ("ppc64") in iomp.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">“<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Your patch has these lines in it:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-set(arch_possible_values        32e 32 arm ppc64)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+set(arch_possible_values        32e 32 arm ppc64 ppc64le)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">So the problem above should be taken care of by this.  The idea was to have my get_arch patch be independent of the recent architecture
 patches so that the commits can be in a logical order.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Ideally, the get_arch patch will be first, then the architecture ports are based off of that.<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">Some comments below on the ppc64le patch…<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">---Comment #1---<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Below, the KMP_ARCH_PPC macro should be removed, then undelete these two lines:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-#  undef KMP_ARCH_PPC64<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-#  define KMP_ARCH_PPC64 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">This way, there is generic KMP_ARCH_PPC64 and then the more specific KMP_ARCH_PPC64BE and KMP_ARCH_PPC64LE macros.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I think Jim wanted to get rid of the KMP_ARCH_PPC anyways because it might confuse between 32-bit and 64-bit.<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" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">--- a/runtime/src/kmp_os.h<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+++ b/runtime/src/kmp_os.h<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">@@ -75,7 +75,10 @@<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">#define KMP_ARCH_X86        0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">#define KMP_ARCH_X86_64        0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-#define KMP_ARCH_PPC64      0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#define KMP_ARCH_PPC64_BE   0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#define KMP_ARCH_PPC64_LE   0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#define KMP_ARCH_PPC (KMP_ARCH_PPC64_LE || KMP_ARCH_PPC64_BE)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">#ifdef _WIN32<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># undef KMP_OS_WINDOWS<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">@@ -116,7 +119,7 @@<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># define KMP_OS_UNIX 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">#endif<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-#if (KMP_OS_LINUX || KMP_OS_WINDOWS) && !KMP_OS_CNK && !KMP_ARCH_PPC64<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#if (KMP_OS_LINUX || KMP_OS_WINDOWS) && !KMP_OS_CNK && !KMP_ARCH_PPC<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># define KMP_AFFINITY_SUPPORTED 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">#else<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># define KMP_AFFINITY_SUPPORTED 0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">@@ -140,8 +143,13 @@<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">#  undef KMP_ARCH_X86<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">#  define KMP_ARCH_X86 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># elif defined __powerpc64__<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-#  undef KMP_ARCH_PPC64<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-#  define KMP_ARCH_PPC64 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#  if defined __LITTLE_ENDIAN__<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#   undef KMP_ARCH_PPC64_LE<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#   define KMP_ARCH_PPC64_LE 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#  else<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#   undef KMP_ARCH_PPC64_BE<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#   define KMP_ARCH_PPC64_BE 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#  endif<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># endif<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">#endif<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">In most places it seems there is already KMP_ARCH_PPC64.  So just eliminate the changes that look similar to this:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-#if KMP_ARCH_PPC64<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#if KMP_ARCH_PPC<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">---Comment #2---<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">It seems that there needs to be additions to the file
</span><span style="font-size:10.0pt;font-family:Consolas">/runtime/tools/src/common-defs.mk,
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">because inside this file<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Is where the architecture/platform checks are done.  It should look something like this:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">os       := $(call check_variable,os,lin lrb mac win)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-arch     := $(call check_variable,arch,32 32e 64 arm ppc64)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+arch     := $(call check_variable,arch,32 32e 64 arm ppc64 ppc64le)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">platform := $(os)_$(arch)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-platform := $(call check_variable,platform,lin_32 lin_32e lin_64 lin_arm lrb_32e mac_32 mac_32e win_32 win_32e win_64 lin_ppc64)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+platform := $(call check_variable,platform,lin_32 lin_32e lin_64 lin_arm lrb_32e mac_32 mac_32e win_32 win_32e win_64 lin_ppc64 lin_ppc64le)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># oa-opts means "os and arch options". They are passed to almost all perl scripts.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">oa-opts  := --os=$(os) --arch=$(arch)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You will also have to modify the legal_arch variable (also in common-defs.mk) of nested if’s to include ppc64le.<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">Also, this means you can get rid of the ppc64be value in these conditionals.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">--- a/runtime/src/makefile.mk<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+++ b/runtime/src/makefile.mk<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">@@ -491,7 +491,8 @@ cpp-flags += -D KMP_LIBRARY_FILE=\"$(lib_file)\"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">cpp-flags += -D KMP_VERSION_MAJOR=$(VERSION)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># customize ppc64 cache line size to 128, 64 otherwise<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-ifeq "$(arch)" "ppc64"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+#ifeq "$(arch)" "ppc64"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+ ifneq (,$(filter "$(arch)","ppc64be" "ppc64le" "ppc64"))<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">    cpp-flags += -D CACHE_LINE=128<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">else<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">    cpp-flags += -D CACHE_LINE=64<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">@@ -503,7 +504,7 @@ cpp-flags += -D KMP_ASM_INTRINS<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">cpp-flags += -D KMP_USE_INTERNODE_ALIGNMENT=0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"># Linux and MIC compile with version symbols<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">ifneq "$(filter lin lrb,$(os))" ""<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">-ifeq "$(filter ppc64,$(arch))" ""<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">+ifneq (,$(filter "$(arch)","ppc64be" "ppc64le" "ppc64"))<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">     cpp-flags += -D KMP_USE_VERSION_SYMBOLS<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">endif<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">endif<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"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-- Johnny<o:p></o:p></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<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""> Carlo Bertolli [mailto:cbertol@us.ibm.com]
<br>
<b>Sent:</b> Tuesday, December 23, 2014 12:50 PM<br>
<b>To:</b> Peyton, Jonathan L; Cownie, James H<br>
<b>Cc:</b> C Bergström; openmp-dev@dcs-maillist2.engr.illinois.edu<br>
<b>Subject:</b> RE: Getting Architecture Patch<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Hi</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Attached a patch that includes both Jonathan's own (cmake auto architecture detection) and some additional fix-ups by me to allow running on ppc64le architectures (Power 8).</span><br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">My part of the patch follows suggestions made by Jim Cownie regarding the macro definition.</span><br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">This also goes in the direction stated by Jim in one of his last e-mails related to a re-designing of architecture macros.</span><br>
<br>
<i>(See attached file: cmake_auto_arch_and_ppc64.patch)</i><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Let me know if you prefer a patch as diffed from Jonathan's one.</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Thanks</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">-- Carlo</span><br>
<br>
<br>
<img width="16" height="16" id="Picture_x0020_1" src="cid:image001.gif@01D029BA.B0888FE0" 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"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#424282">"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</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" <</span><a href="mailto:jonathan.l.peyton@intel.com"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">jonathan.l.peyton@intel.com</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">></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"">C Bergström <</span><a href="mailto:cbergstrom@pathscale.com"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">cbergstrom@pathscale.com</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">>,
 Carlo Bertolli/Watson/IBM@IBMUS</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"">"</span><a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">openmp-dev@dcs-maillist2.engr.illinois.edu</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">"
 <</span><a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">openmp-dev@dcs-maillist2.engr.illinois.edu</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">></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 07:28 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"">RE: Getting Architecture Patch</span><o:p></o:p></p>
<div>
<div>
<div class="MsoNormal">
<hr size="2" width="100%" noshade="" style="color:#8091A5" align="left">
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">New patch is attached.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><br>
<span style="font-size:10.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.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><br>
<span style="font-size:10.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:</span><br>
<span style="font-size:10.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
</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     char cmake_compiler_name[] = “COMPILER_NAME=[gcc]”;</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     char cmake_compiler_version_major[] = “COMPILER_VERISON_MAJOR=[00000004]”</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     char cmake_compiler_version_minor[] = “COMPILER_VERISON_MINOR=[00000008]”</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">     etc.</span><br>
<span style="font-size:10.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.</span><br>
<span style="font-size:10.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.</span><br>
<span style="font-size:10.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.</span><br>
<span style="font-size:10.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:10.0pt;font-family:Wingdings;color:#1F497D">J</span><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><br>
<span style="font-size:10.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.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">3) I did this in the new patch along with ppc64le</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-- Johnny</span><br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><br>
<b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif""> C Bergström [</span><a href="mailto:cbergstrom@pathscale.com"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">mailto:cbergstrom@pathscale.com</span></a><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">]
<b><br>
Sent:</b> Wednesday, December 17, 2014 1:24 PM<b><br>
To:</b> Carlo Bertolli<b><br>
Cc:</b> Peyton, Jonathan L; </span><a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">openmp-dev@dcs-maillist2.engr.illinois.edu</span></a><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
Subject:</span></b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif""> Re: Getting Architecture Patch</span><br>
 <br>
3 nits<br>
 <br>
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?)<br>
 <br>
2) Would anyone @Intel strongly oppose a global rename of 32e to something which is more commonly used (x86_64, amd64 /* joking */ or x8664)<br>
 <br>
3) Can you include ARM64<br>
 <br>
Thanks<br>
 <br>
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>
<p class="MsoNormal" style="margin-left:.5in"><br>
<span style="font-family:"Arial","sans-serif"">Hi Johnny</span><br>
<br>
<span style="font-family:"Arial","sans-serif""><br>
Thanks for this patch. I will give it a try on our machines and let you know.</span><br>
<br>
<span style="font-family:"Arial","sans-serif""><br>
Cheers</span><br>
<span style="font-family:"Arial","sans-serif""><br>
-- Carlo</span><br>
<br>
<br>
<img border="0" width="16" height="16" id="Picture_x0020_3" src="cid:image001.gif@01D029BA.B0888FE0" 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>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F"><br>
From: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">"Peyton, Jonathan L" <</span><a href="mailto:jonathan.l.peyton@intel.com" target="_blank"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">jonathan.l.peyton@intel.com</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">><span style="color:#5F5F5F"><br>
To: </span>"</span><a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">openmp-dev@dcs-maillist2.engr.illinois.edu</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">"
 <</span><a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">openmp-dev@dcs-maillist2.engr.illinois.edu</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">><span style="color:#5F5F5F"><br>
Cc: </span>Carlo Bertolli/Watson/IBM@IBMUS, C Bergström <</span><a href="mailto:cbergstrom@pathscale.com" target="_blank"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">cbergstrom@pathscale.com</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">><span style="color:#5F5F5F"><br>
Date: </span>12/17/2014 01:18 PM<span style="color:#5F5F5F"><br>
Subject: </span>Getting Architecture Patch</span><o:p></o:p></p>
<div style="margin-left:.5in">
<div>
<div class="MsoNormal">
<hr size="2" width="100%" noshade="" style="color:#A0A0A0" align="left">
</div>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><br>
<br>
<br>
<span style="font-family:"Calibri","sans-serif""><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]
</span><o:p></o:p></p>
</div>
</body>
</html>