<div dir="ltr">I see. crazy graph of compiler flags.<div>OK, nothing critical. GNU works fine and the app that I support has given up on nvhpc also (don't know why).</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 4, 2021 at 9:08 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</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 style="overflow-wrap: break-word;"><div><br></div><div>   This comes from the persistent problem with PETSc's make system using too many flags for compiling CUDA that have not been tested by configure. See below the -mp=gpu is provided probably from the CPPFLAGS or CXXPPFLAGS(sp) that is improperly used by the PETSc makefiles to compile CUDA code! </div><div><br></div><div><br></div>Using CUDA compile: /global/common/software/nersc/cos1.3/cuda/11.3.0/bin/nvcc -o .o -I/opt/cray/pe/mpich/8.1.10/ofi/nvidia/20.7/include -I/opt/cray/pe/libsci/<a href="http://21.08.1.2/NVIDIA/20.7/x86_64/include" target="_blank">21.08.1.2/NVIDIA/20.7/x86_64/include</a> -I/opt/cray/pe/pmi/6.0.14/include -I/opt/cray/pe/dsmml/0.2.2/dsmml//include -I/opt/cray/xpmem/2.2.40-7.0.1.0_3.1__g1d7a24d.shasta/include  -g -Xcompiler -rdynamic -DLANDAU_DIM=2 -DLANDAU_MAX_SPECIES=10 -DLANDAU_MAX_Q=4 -Xcompiler -fPIC -std=c++17 -gencode arch=compute_80,code=sm_80  -Wno-deprecated-gpu-targets  -c --compiler-options=-I/global/homes/m/madams/petsc/include -I/global/homes/m/madams/petsc/arch-perlmutter-opt-nvidia-cuda/include -I/global/common/software/nersc/cos1.3/cuda/11.3.0/include -mp=gpu -I/global/homes/m/madams/petsc/include -I/global/homes/m/madams/petsc/arch-perlmutter-opt-nvidia-cuda/include -I/global/common/software/nersc/cos1.3/cuda/11.3.0/include <div><br></div><div><br><div><br><blockquote type="cite"><div>On Nov 4, 2021, at 7:31 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:</div><br><div><div dir="ltr">OK, configure is done.<div>Maybe I have too many -mp=gpu</div><div><br></div><div>       CUDAC arch-perlmutter-opt-nvidia-cuda/obj/sys/classes/random/impls/curand/curand2.o<br>gcc: error: unrecognized command line option ‘-mp=gpu’; did you mean ‘-mpku’?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 4, 2021 at 5:51 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</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><div><br></div>  Need the same thing for the C++ preprocessor flag<div><br></div><div><br><div><div><br><blockquote type="cite"><div>On Nov 4, 2021, at 5:44 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:</div><br><div><div dir="ltr">It gets a lot further.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 4, 2021 at 5:32 PM Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.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 dir="ltr">OK, sorry I missed the CPPFLAGS. It is running now.<div>Thanks,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 4, 2021 at 4:43 PM Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@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">Multiple e-mail threads on the same issue (:<br>
<br>
As suggested in my earlier thread - add -mp=gpu to both CPPFLAGS and CFLAGS [or LDFLAGS]<br>
<br>
Satish<br>
<br>
-------<br>
Executing: cc  -o /tmp/petsc-Vvs8_T/config.setCompilers/conftest   -g -DLANDAU_DIM=2 -DLANDAU_MAX_SPECIES=10 -DLANDAU_MAX_Q=4 /tmp/petsc-Vvs8_T/config.setCompilers/conftest.o<br>
Possible ERROR while running linker:<br>
stderr:<br>
nvc-Warning-The -gpu option has no effect unless a language-specific option to enable GPU code generation is used (e.g.: -acc, -mp=gpu, -stdpar, -cuda)<br>
<br>
<br>
On Thu, 4 Nov 2021, Mark Adams wrote:<br>
<br>
> It is CPPFLAGS. I seem to get the same behavior.<br>
> <br>
> FWIW, I did get this response from NERSc but I don't know how to interpret<br>
> it.<br>
> <br>
> He seems to be saying that I don't need -mp=gpu for the device compiler<br>
> (nvcc). He seems to think that I am adding -gpu.<br>
> <br>
> nvcc -- The device compiler does not need any of those flags because it<br>
> already knows that it's being fed cuda code. The warning you're seeing is<br>
> coming from nvc (which is the host / CPU side compiler) if you're in the<br>
> PrgEnv-nvidia environment. You should not need to add -mp=gpu and -cuda,<br>
> please just add the -cuda flag (to your host code) not to the device code.<br>
> <br>
> I will try to talk with this guy again.<br>
> <br>
> Thanks,<br>
> <br>
> <br>
> On Thu, Nov 4, 2021 at 4:11 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:<br>
> <br>
> ><br>
> >   Yes, you need to use the CPPFLAGS which maybe called CPPCFLAGS I am not<br>
> > sure<br>
> ><br>
> ><br>
> > On Nov 4, 2021, at 3:23 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:<br>
> ><br>
> > Ah, CCFLAGS does not seem to work.<br>
> ><br>
> > On Thu, Nov 4, 2021 at 3:07 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:<br>
> ><br>
> >><br>
> >>   You have to pass in the flag to turn off the bitching about -gpu to the<br>
> >> C preprocessor, not the C compiler.<br>
> >><br>
> >><br>
> >> stderr:<br>
> >> nvc-Warning-The -gpu option has no effect unless a language-specific<br>
> >> option to enable GPU code generation is used (e.g.: -acc, -mp=gpu, -stdpar,<br>
> >> -cuda)<br>
> >> Source:<br>
> >> #include "confdefs.h"<br>
> >> #include "conffix.h"<br>
> >> #include <stdlib.h><br>
> >><br>
> >><br>
> >><br>
> >> > On Nov 4, 2021, at 2:49 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:<br>
> >> ><br>
> >> > on Perlmutter with nvhpc:<br>
> >> ><br>
> >> >               Defined make macro "CPP" to "cc --use cpp32"<br>
> >> > Preprocessing source:<br>
> >> > #include "confdefs.h"<br>
> >> > #include "conffix.h"<br>
> >> > #include <stdlib.h><br>
> >> ><br>
> >> > Executing: cc --use cpp32  -I/tmp/petsc-jV9U1b/config.setCompilers<br>
> >> /tmp/petsc-jV9U1b/config.setCompilers/conftest.c<br>
> >> > Possible ERROR while running preprocessor: exit code 1<br>
> >> > stderr:<br>
> >> > nvc-Error-Unknown switch: --use<br>
> >> > Source:<br>
> >> > <configure.log><br>
> >><br>
> >> <configure.log><br>
> ><br>
> ><br>
> ><br>
> <br>
<br>
</blockquote></div>
</blockquote></div>
<span id="gmail-m_1749652365269375285gmail-m_-4702671338611196325cid:f_kvlh8gl80"><configure.log></span></div></blockquote></div><br></div></div></div></blockquote></div>
<span id="gmail-m_1749652365269375285cid:f_kvll01990"><make.log></span><span id="gmail-m_1749652365269375285cid:f_kvll019e1"><configure.log></span></div></blockquote></div><br></div></div></blockquote></div>