<html 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=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
p.p1, li.p1, div.p1
        {mso-style-name:p1;
        margin:0cm;
        font-size:8.5pt;
        font-family:Menlo;
        color:#32F4F1;}
p.p2, li.p2, div.p2
        {mso-style-name:p2;
        margin:0cm;
        font-size:8.5pt;
        font-family:Menlo;
        color:black;}
p.p3, li.p3, div.p3
        {mso-style-name:p3;
        margin:0cm;
        font-size:8.5pt;
        font-family:Menlo;
        color:#FB1EFF;}
p.p4, li.p4, div.p4
        {mso-style-name:p4;
        margin:0cm;
        font-size:8.5pt;
        font-family:Menlo;
        color:black;}
span.s2
        {mso-style-name:s2;
        color:black;}
span.s3
        {mso-style-name:s3;
        color:#FB1EFF;}
span.s4
        {mso-style-name:s4;
        color:black;
        background:#E0E409;}
span.s1
        {mso-style-name:s1;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:429787939;
        mso-list-type:hybrid;
        mso-list-template-ids:1826634354 127834156 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";
        color:windowtext;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:802578846;
        mso-list-type:hybrid;
        mso-list-template-ids:564016794 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2
        {mso-list-id:974480449;
        mso-list-type:hybrid;
        mso-list-template-ids:1872659540 1980505548 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l2:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:11.0pt;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";
        color:windowtext;}
@list l2:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l3
        {mso-list-id:1418215166;
        mso-list-template-ids:-745788050;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style>
</head>
<body lang="en-RU" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Hi all again,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Thanks again for your help and very quick replies. I managed to fix it at the end – unfortunately I cannot exactly pin-point what went wrong as I was trying different things until they worked
 – not very scientific of me xD. But the steps were as follows, I am not sure if this will be useful at all, but here it is anyway,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="color:black;margin-left:0cm;mso-list:l2 level1 lfo5">
<span lang="EN-US" style="font-size:11.0pt;color:windowtext">Based on our emails, I decided to specify the same cxx, cc, fc flags for PETSC when configuring it as in the Chombo’s Make.defs.local file (the file we use to compile the Chombo library). For example,
 in my case I had to use </span>COPTFLAGS="-O3 -xCOMMON-AVX512" CXXOPTFLAGS="-O3 -xCOMMON-AVX512"
<span lang="EN-US" style="font-size:11.0pt;color:windowtext">as per the flags I use to compile Chombo. And of course, one has to use -lpetsc in syslibflags.</span><o:p></o:p></li></ol>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<ol style="margin-top:0cm" start="2" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l2 level1 lfo5"><span lang="EN-US" style="font-size:11.0pt">Then I created a module-file to set my environment variables, like this<o:p></o:p></span></li></ol>
<p class="MsoListParagraph"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="p1"><span class="s1"><span style="color:black">#%Module</span></span><span style="color:black"><o:p></o:p></span></p>
<p class="p2"><o:p> </o:p></p>
<p class="p3"><span class="s2">set PETSC_DIR </span><span class="s1"><span style="color:black">"$::env(HOME)/petsc"</span></span><span style="color:black"><o:p></o:p></span></p>
<p class="p3"><span class="s2">set PETSC_ARCH </span><span class="s1"><span style="color:black">"arch-linux-c-debug"</span></span><span style="color:black"><o:p></o:p></span></p>
<p class="p4"><span class="s1">prepend-path LD_LIBRARY_PATH </span><span class="s3"><span style="color:black">"$PETSC_DIR/$PETSC_ARCH/lib"</span></span></p>
<p class="p3"><span class="s2">prepend-path LIBRARY_PATH </span><span class="s1"><span style="color:black">"$PETSC_DIR/$PETSC_ARCH/lib"</span></span><span style="color:black"><o:p></o:p></span></p>
<p class="p3"><span class="s2">prepend-path CPATH </span><span class="s1"><span style="color:black">"$PETSC_DIR/</span></span><span class="s4">include</span><span class="s1"><span style="color:black">:$PETSC_DIR/$PETSC_ARCH/</span></span><span class="s4">include</span><span class="s1"><span style="color:black">"</span></span><span style="color:black"><o:p></o:p></span></p>
<p class="p3"><span class="s2">prepend-path PKG_CONFIG_PATH </span><span class="s1"><span style="color:black">"$PETSC_DIR/$PETSC_ARCH/lib/pkgconfig"</span></span><span style="color:black"><o:p></o:p></span></p>
<p class="p4"><span class="s1">prepend-path CMAKE_PREFIX_PATH </span><span class="s3"><span style="color:black">"$PETSC_DIR/$PETSC_ARCH/"</span></span></p>
<p class="p4"><span class="s1">setenv PETSC_DIR $PETSC_DIR</span></p>
<p class="p4"><span class="s1">setenv PETSC_ARCH $PETSC_ARCH</span></p>
<p class="MsoListParagraph"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<ol style="margin-top:0cm" start="3" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l2 level1 lfo5"><span lang="EN-US" style="font-size:11.0pt">Loading module, and compiling everything magically got rid off the error.<o:p></o:p></span></li></ol>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Tamara<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Mark Adams <mfadams@lbl.gov><br>
<b>Date: </b>Friday, 4 February 2022, 03:35<br>
<b>To: </b>Jed Brown <jed@jedbrown.org><br>
<b>Cc: </b>Evstafyeva,Tamara <te307@cam.ac.uk>, petsc-users <petsc-users@mcs.anl.gov><br>
<b>Subject: </b>Re: [petsc-users] cannot open source file "petsc.h"<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">On Thu, Feb 3, 2022 at 6:12 PM Jed Brown <</span><a href="mailto:jed@jedbrown.org" target="_blank"><span style="font-size:11.0pt">jed@jedbrown.org</span></a><span style="font-size:11.0pt">> wrote:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt">"Evstafyeva,Tamara" <</span><a href="mailto:te307@cam.ac.uk" target="_blank"><span style="font-size:11.0pt">te307@cam.ac.uk</span></a><span style="font-size:11.0pt">> writes:<br>
<br>
> Thanks for your prompt reply. I am attaching the makefile; the line for execution “make all -j 4”<br>
><br>
> I guess using both was my attempt at trying multiple things until they work – using either one or the other produced the same error for me.<br>
<br>
petsc.pc isn't being used here. What's probably happening is that Chombo's mk/Make.test has rules (not just variables) and those rules are replacing PETSc rules. Mark Adams (Cc'd) works with Chombo and will know for sure.
<o:p></o:p></span></p>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">It seems like you are trying to build a makefile system for Chombo, with PETSc, from scratch. I think you want to go through Chombo. They have worked out makefiles with PETSc and we don't want to try to recreate
 that.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">It appears that you did not find any instructions on building Chombo with PETSc, including example makefiles. They exist, but I don't know anything about the Chombo distribution and support.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">I would contact Chombo and see if they can help you.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">I wish I could be of more help,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Good luck,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Mark<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt">I'm mildly afraid of Chombo and would use Makefile.user to extract exactly the information you want from PETSc.<br>
<br>
Alternatively, include only ${PETSC_DIR}/lib/petsc/conf/variables from PETSc and append the variables as needed to Chombo. The downside of this is that some variables are not namespaced so there could be conflicts depending on Chombo's naming conventions.<o:p></o:p></span></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>