<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=us-ascii">
<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:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@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:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.contentpasted0
{mso-style-name:contentpasted0;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle21
{mso-style-type:personal-reply;
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;}
--></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" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Barry,<o:p></o:p></p>
<p class="MsoNormal"> Here is the output of win32fe cl --use clang --verbose sizeof.c<o:p></o:p></p>
<p class="MsoNormal">Using tool: clang<o:p></o:p></p>
<p class="MsoNormal">Win32 Development Tool Front End, version 1.11.4 Fri, Sep 10, 2021 6:33:40 PM<o:p></o:p></p>
<p class="MsoNormal">Attempting to create file: C:\cygwin64\tmp\wfe1EB0.tmp<o:p></o:p></p>
<p class="MsoNormal">clang<o:p></o:p></p>
<p class="MsoNormal">clang: error: no input files<o:p></o:p></p>
<p class="MsoNormal">del C:\cygwin64\tmp\wfe1EB0.tmp<o:p></o:p></p>
<p class="MsoNormal">Attempting to create file: C:\cygwin64\tmp\wfe1ED1.tmp<o:p></o:p></p>
<p class="MsoNormal">clang sizeof.c -link<o:p></o:p></p>
<p class="MsoNormal">LINK : fatal error LNK1181: cannot open input file 'ink.lib'<o:p></o:p></p>
<p class="MsoNormal">clang: error: linker command failed with exit code 1181 (use -v to see invocation)<o:p></o:p></p>
<p class="MsoNormal">del C:\cygwin64\tmp\wfe1ED1.tmp<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> clang sizeof.c works which produces a.exe.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> This is from clang -help:<o:p></o:p></p>
<p class="MsoNormal">OVERVIEW: clang LLVM compiler<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Barry Smith <bsmith@petsc.dev> <br>
<b>Sent:</b> Wednesday, January 25, 2023 7:48 AM<br>
<b>To:</b> Guo, Sam (DI SW STS SDDEV MECH PHY FEA FW) <sam.guo@siemens.com><br>
<b>Cc:</b> petsc-users <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] compile PETSc on win using clang<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"> Please do as Satish previously suggested<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">~/petsc/lib/petsc/bin/win32fe/win32fe cl --use clang --verbose sizeof.c<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> Also do <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">clang sizeof.c<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">and send the output of both. Where sizeof.c is <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">#include <stdio.h><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">int main(int argc,char **args)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">{<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> printf("%d\n",(int)sizeof(int));<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> return 0;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I may have typos in my sample code so please fix those.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Barry<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jan 24, 2023, at 6:22 PM, Guo, Sam <<a href="mailto:sam.guo@siemens.com">sam.guo@siemens.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black;background:white">Attached please find configure.log.</span><span style="font-size:13.5pt;font-family:"Helvetica",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black;background:white">error messgae:</span><span style="font-size:13.5pt;font-family:"Helvetica",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:13.5pt"><span class="contentpasted0"><span style="font-size:12.0pt;color:black;background:white">C:\home\xian\dev\star\petsc\src\sys\objects\device\INTERF~1\device.cxx(486): error C2065: 'PETSC_DEVICE_CASE': undeclared
identifier</span></span><span style="font-size:13.5pt;font-family:"Helvetica",sans-serif"><o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="1013" style="width:760.0pt" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b>From:</b><span class="apple-converted-space"> </span>Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>><br>
<b>Sent:</b><span class="apple-converted-space"> </span>Tuesday, January 24, 2023 2:00 PM<br>
<b>To:</b><span class="apple-converted-space"> </span>Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>><br>
<b>Cc:</b><span class="apple-converted-space"> </span>Guo, Sam (DI SW STS SDDEV MECH PHY FEA FW) <<a href="mailto:sam.guo@siemens.com">sam.guo@siemens.com</a>>;<span class="apple-converted-space"> </span><a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><span class="apple-converted-space"> </span><<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
<b>Subject:</b><span class="apple-converted-space"> </span>Re: [petsc-users] compile PETSc on win using clang<span style="font-size:13.5pt;font-family:"Helvetica",sans-serif"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica",sans-serif"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica",sans-serif"><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.wikihow.com%2FInstall-Clang-on-Windows&data=05%7C01%7Csam.guo%40siemens.com%7C34507bcd28884c9a119b08dafeeb8500%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638102584757255429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Y1zEjwZF3VgHmtqHgNMgcLmd7fYi7hzZ98vvNI3XA6s%3D&reserved=0">https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.wikihow.com%2FInstall-Clang-on-Windows&data=05%7C01%7Csam.guo%40siemens.com%7Ca6e1607f7e23403f9b4008dafe56627d%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638101944252560682%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=BOy9RDMGw11IlwRthzcB5Il3YUIgVVrukbzOMFdV8MI%3D&reserved=0</a><br>
<br>
Is the clang you have from visual studio - as described above?<br>
<br>
We don't have experience with using this variant of clang.<br>
<br>
If its compatible with 'cl' - and supports the same command interface as 'cl' then the following might work [assuming clang.exe is the compiler binary installed - and available in PATH]:<br>
<br>
'--with-cc=win32fe cl --use clang'<br>
<br>
Satish<br>
<br>
<br>
On Tue, 24 Jan 2023, Barry Smith wrote:<br>
<br>
><span class="apple-converted-space"> </span><br>
> Are you using clang as a replacement for the<br>
><span class="apple-converted-space"> </span><br>
> * "Unix-like" Cygwin GNU compilers compilers or<span class="apple-converted-space"> </span><br>
><span class="apple-converted-space"> </span><br>
> * MinGW GNU compilers that are compatible with the Microsoft compilers?<br>
><span class="apple-converted-space"> </span><br>
> If the former, follow the instructions for using the Cygwin GNU compilers, if the latter follow the directions for the MinGW compilers.<span class="apple-converted-space"> </span><br>
><span class="apple-converted-space"> </span><br>
> Send the configure.log and make.log if things go wrong and we'll help you out.<br>
><span class="apple-converted-space"> </span><br>
> Barry<br>
><span class="apple-converted-space"> </span><br>
><span class="apple-converted-space"> </span><br>
><span class="apple-converted-space"> </span><br>
><span class="apple-converted-space"> </span><br>
> > On Jan 24, 2023, at 4:01 PM, Guo, Sam <<a href="mailto:sam.guo@siemens.com">sam.guo@siemens.com</a>> wrote:<br>
> ><span class="apple-converted-space"> </span><br>
> > Hi PETSc dev team,<br>
> > I try to compile PETSc on win using clang. I am wondering if you could give me some hint. (I’ve already made intel compiler work on win using win32fe icl).<br>
> > <span class="apple-converted-space"> </span><br>
> > Thanks,<br>
> > Sam Guo<br>
><span class="apple-converted-space"> </span><br>
><span class="apple-converted-space"> </span><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><configure.log><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>