<div dir="ltr"><div>Hi, Marcos</div><div>  Could you attach the configure.log?</div><div>--Junchao Zhang</div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 8, 2024 at 2:19 PM Vanella, Marcos (Fed) via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg6013783798634584313">




<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi all, does anyone have experience compiling PETSc with gnu openmpi and cross compiling with cuda nvcc on these systems?</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
we have access to Vista, a machine in TACC and was trying to build PETSc with these libraries. I would need gnu openmpi to compile my code (fortran std 2018), and would like to keep the same cpu compiler/openmpi for PETSc.I have the following modules loaded:</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
Currently Loaded Modules:</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
  1) ucc/1.3.0   2) ucx/1.17.0   3) cmake/3.29.5   4) xalt/3.1   5) TACC   6) gcc/14.2.0   7) cuda/12.5 (g)   8) openmpi/5.0.5</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
  Where:</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
   g:  built for GPU</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Here mpicc points to the gcc compiler, etc. When configuring PETSc in the following form I get nvcc not working:</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
$ ./configure COPTFLAGS="-O2 -g" CXXOPTFLAGS="-O2 -g" FOPTFLAGS="-O2 -g" FCOPTFLAGS="-O2 -g" CUDAOPTFLAGS="-O2 -g" --with-debugging=1 --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpifort --with-cuda --with-cudac=nvcc --with-cuda-arch=90 --download-fblaslapack=1
 --with-make-np=8</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
=============================================================================================</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
                         Configuring PETSc to compile on your system</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
=============================================================================================</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
TESTING: checkCUDACompiler from config.setCompilers(config/BuildSystem/config/setCompilers.py:1541)</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
*********************************************************************************************</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
           UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
---------------------------------------------------------------------------------------------</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
  CUDA compiler you provided with -with-cudac=nvcc cannot be found or does not work.</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
  Cannot compile CUDA with nvcc.</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
*********************************************************************************************</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I have nvcc in my path:</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
$ nvcc --version</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
nvcc: NVIDIA (R) Cuda compiler driver</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
Copyright (c) 2005-2024 NVIDIA Corporation</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
Built on Thu_Jun__6_02:26:10_PDT_2024</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
Cuda compilation tools, release 12.5, V12.5.82</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
Build cuda_12.5.r12.5/compiler.34385749_0</div>
<div style="font-family:"Courier New",monospace;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I remember being able to do this cross compilation in polaris. Any help is most appreciated,</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Marcos</div>
</div>

</div></blockquote></div>