[petsc-users] compile PETSc on win using clang

Guo, Sam sam.guo at siemens.com
Wed Jan 25 11:31:47 CST 2023


Hi Barry,
   Here is the output of win32fe cl --use clang --verbose sizeof.c
Using tool: clang
Win32 Development Tool Front End, version 1.11.4 Fri, Sep 10, 2021  6:33:40 PM
Attempting to create file: C:\cygwin64\tmp\wfe1EB0.tmp
clang
clang: error: no input files
del C:\cygwin64\tmp\wfe1EB0.tmp
Attempting to create file: C:\cygwin64\tmp\wfe1ED1.tmp
clang sizeof.c -link
LINK : fatal error LNK1181: cannot open input file 'ink.lib'
clang: error: linker command failed with exit code 1181 (use -v to see invocation)
del C:\cygwin64\tmp\wfe1ED1.tmp

   clang sizeof.c works which produces a.exe.

   This is from clang -help:
OVERVIEW: clang LLVM compiler


From: Barry Smith <bsmith at petsc.dev>
Sent: Wednesday, January 25, 2023 7:48 AM
To: Guo, Sam (DI SW STS SDDEV MECH PHY FEA FW) <sam.guo at siemens.com>
Cc: petsc-users <petsc-users at mcs.anl.gov>
Subject: Re: [petsc-users] compile PETSc on win using clang


  Please do as Satish previously suggested

~/petsc/lib/petsc/bin/win32fe/win32fe cl --use clang --verbose sizeof.c


  Also do

clang sizeof.c

and send the output of both. Where sizeof.c is

#include <stdio.h>
int main(int argc,char **args)
{
   printf("%d\n",(int)sizeof(int));
   return 0;
}

I may have typos in my sample code so please fix those.

Barry



On Jan 24, 2023, at 6:22 PM, Guo, Sam <sam.guo at siemens.com<mailto:sam.guo at siemens.com>> wrote:

Attached please find configure.log.

error messgae:
C:\home\xian\dev\star\petsc\src\sys\objects\device\INTERF~1\device.cxx(486): error C2065: 'PETSC_DEVICE_CASE': undeclared identifier
________________________________
From: Satish Balay <balay at mcs.anl.gov<mailto:balay at mcs.anl.gov>>
Sent: Tuesday, January 24, 2023 2:00 PM
To: Barry Smith <bsmith at petsc.dev<mailto:bsmith at petsc.dev>>
Cc: Guo, Sam (DI SW STS SDDEV MECH PHY FEA FW) <sam.guo at siemens.com<mailto:sam.guo at siemens.com>>; petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov> <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>>
Subject: Re: [petsc-users] compile PETSc on win using clang

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<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>

Is the clang you have from visual studio - as described above?

We don't have experience with using this variant of clang.

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]:

'--with-cc=win32fe cl --use clang'

Satish


On Tue, 24 Jan 2023, Barry Smith wrote:

>
>    Are you using clang as a replacement for the
>
>    *  "Unix-like" Cygwin GNU compilers compilers or
>
>    *  MinGW GNU compilers that are compatible with the Microsoft compilers?
>
>   If the former, follow the instructions for using the Cygwin GNU compilers, if the latter follow the directions for the MinGW compilers.
>
>   Send the configure.log and make.log if things go wrong and we'll help you out.
>
>   Barry
>
>
>
>
> > On Jan 24, 2023, at 4:01 PM, Guo, Sam <sam.guo at siemens.com<mailto:sam.guo at siemens.com>> wrote:
> >
> > Hi PETSc dev team,
> >    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).
> >
> > Thanks,
> > Sam Guo
>
>
<configure.log>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230125/5d467892/attachment.html>


More information about the petsc-users mailing list