<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thank you Matt I'll try this and let you know.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Marcos<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Matthew Knepley <knepley@gmail.com><br>
<b>Sent:</b> Monday, May 15, 2023 12:08 PM<br>
<b>To:</b> Vanella, Marcos (Fed) <marcos.vanella@nist.gov><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Compiling PETSC with Intel OneAPI compilers and OpenMPI</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Mon, May 15, 2023 at 11:19 AM Vanella, Marcos (Fed) via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br>
</div>
<div class="x_gmail_quote">
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg5623468101539357335">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hello, I'm trying to compile the PETSc library version 3.19.1 with OpenMPI 4.1.4 and the OneAPI 2022 Update 2 Intel Compiler suite on a Mac with OSX Ventura 13.3.1.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I can compile PETSc in debug mode with this configure and make lines. I can run the PETSC tests, which seem fine.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
When I compile the library in optimized mode, either using -O3 or O1, for example configuring with:</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I hate to yell "compiler bug" when this happens, but it sure seems like one. Can you just use</div>
<div><br>
</div>
<div> --with-debugging=0</div>
<div><br>
</div>
<div>without the custom COPTFLAGS, CXXOPTFLAGS, FOPTFLAGS? If that works, it is almost</div>
<div>certainly a compiler bug. If not, then we can go in the debugger and see what is failing.</div>
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg5623468101539357335">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Courier New",monospace">$ ./configure --prefix=/opt/petsc-oneapi22u3 --with-blaslapack-dir=/opt/intel/oneapi/mkl/2022.2.1 COPTFLAGS='-m64 -O1 -g -diag-disable=10441' CXXOPTFLAGS='-m64 -O1 -g -diag-disable=10441' FOPTFLAGS='-m64 -O1
-g' LDFLAGS='-m64' --with-debugging=0 --with-shared-libraries=0 --download-make</span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
and using mpicc (icc), mpif90 (ifort) from Open MPI, the static lib compiles. Yet, I see right off the bat this segfault error in the first PETSc example:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Courier New",monospace">$ make PETSC_DIR=/Users/mnv/Documents/Software/petsc-3.19.1 PETSC_ARCH=arch-darwin-c-opt test</span>
<div><span style="font-family:"Courier New",monospace">/Users/mnv/Documents/Software/petsc-3.19.1/arch-darwin-c-opt/bin/make --no-print-directory -f /Users/mnv/Documents/Software/petsc-3.19.1/gmakefile.test PETSC_ARCH=arch-darwin-c-opt PETSC_DIR=/Users/mnv/Documents/Software/petsc-3.19.1
test</span></div>
<div><span style="font-family:"Courier New",monospace">/opt/intel/oneapi/intelpython/latest/bin/python3 /Users/mnv/Documents/Software/petsc-3.19.1/config/gmakegentest.py --petsc-dir=/Users/mnv/Documents/Software/petsc-3.19.1 --petsc-arch=arch-darwin-c-opt --testdir=./arch-darwin-c-opt/tests</span></div>
<div><span style="font-family:"Courier New",monospace">Using MAKEFLAGS: --no-print-directory -- PETSC_ARCH=arch-darwin-c-opt PETSC_DIR=/Users/mnv/Documents/Software/petsc-3.19.1</span></div>
<div><span style="font-family:"Courier New",monospace"> CC arch-darwin-c-opt/tests/sys/classes/draw/tests/ex1.o</span></div>
<div><span style="font-family:"Courier New",monospace">In file included from /Users/mnv/Documents/Software/petsc-3.19.1/include/petscsys.h(44),</span></div>
<div><span style="font-family:"Courier New",monospace"> from /Users/mnv/Documents/Software/petsc-3.19.1/src/sys/classes/draw/tests/ex1.c(4):</span></div>
<div><span style="font-family:"Courier New",monospace">/Users/mnv/Documents/Software/petsc-3.19.1/include/petscsystypes.h(68): warning #2621: attribute "warn_unused_result" does not apply here</span></div>
<div><span style="font-family:"Courier New",monospace"> PETSC_ERROR_CODE_TYPEDEF enum PETSC_ERROR_CODE_NODISCARD {</span></div>
<div><span style="font-family:"Courier New",monospace"> ^</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace"> CLINKER arch-darwin-c-opt/tests/sys/classes/draw/tests/ex1</span></div>
<div><span style="font-family:"Courier New",monospace"> TEST arch-darwin-c-opt/tests/counts/sys_classes_draw_tests-ex1_1.counts</span></div>
<div><span style="font-family:"Courier New",monospace">not ok sys_classes_draw_tests-ex1_1
<b># Error code: 139</b></span></div>
<div><b><span style="font-family:"Courier New",monospace"># [excess:98681] *** Process received signal ***</span></b></div>
<div><b><span style="font-family:"Courier New",monospace"># [excess:98681] Signal: Segmentation fault: 11 (11)</span></b></div>
<div><b><span style="font-family:"Courier New",monospace"># [excess:98681] Signal code: Address not mapped (1)</span></b></div>
<div><b><span style="font-family:"Courier New",monospace"># [excess:98681] Failing at address: 0x7f</span></b></div>
<div><b><span style="font-family:"Courier New",monospace"># [excess:98681] *** End of error message ***</span></b></div>
<div><span style="font-family:"Courier New",monospace"># --------------------------------------------------------------------------</span></div>
<div><span style="font-family:"Courier New",monospace"># Primary job terminated normally, but 1 process returned</span></div>
<div><span style="font-family:"Courier New",monospace"># a non-zero exit code. Per user-direction, the job has been aborted.</span></div>
<div><span style="font-family:"Courier New",monospace"># --------------------------------------------------------------------------</span></div>
<div><span style="font-family:"Courier New",monospace"># --------------------------------------------------------------------------</span></div>
<div><span style="font-family:"Courier New",monospace"># mpiexec noticed that process rank 0 with PID 0 on node excess exited on signal 11 (Segmentation fault: 11).</span></div>
<div><span style="font-family:"Courier New",monospace"># --------------------------------------------------------------------------</span></div>
<span style="font-family:"Courier New",monospace"> ok sys_classes_draw_tests-ex1_1 # SKIP Command failed so no diff</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Courier New",monospace"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Calibri,Helvetica,sans-serif">I see the same segfault error in all PETSc examples.
<br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Calibri,Helvetica,sans-serif">Any help is mostly appreciated, I'm starting to work with PETSc. Our plan is to use the linear solver from PETSc for the Poisson equation on our numerical scheme and test this on a GPU cluster. So also,
any guideline on how to interface PETSc with a fortran code and personal experience is also most appreciated!</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Calibri,Helvetica,sans-serif"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Calibri,Helvetica,sans-serif">Marcos<br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Calibri,Helvetica,sans-serif"><br>
</span><span style="font-family:"Courier New",monospace"></span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
<span class="x_gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="http://www.cse.buffalo.edu/~knepley/" originalsrc="http://www.cse.buffalo.edu/~knepley/" shash="mg9pYDTBqDzx6OFf+jfaJnx0l/5/LUpiSMozOxqtSG/HgrN6t3f6Uhj05uZWofpfC64pEMOOSri4yr02sXYfPn16/mW0RS35qkGx5VdUSXbkusQXT27FgSDxq7QZkNvJBy1l143WWCskSBuZUehsPfd+dLrMQgkkr8+ULXavLz0=" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>