<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Don’t know if this still applies, but here is what Jed said about this 10 months ago (<a href="https://gitlab.com/petsc/petsc/-/merge_requests/2466#note_275686270" class="">https://gitlab.com/petsc/petsc/-/merge_requests/2466#note_275686270</a>):<div class="">“A minor issue is that <code class="">-ffp-contract=off</code> is implied by <code class="">-std=c*</code>, versus <code class="">-ffp-contract=fast</code> being default otherwise (with GCC).”</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pierre</div><div class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 14 Dec 2020, at 9:35 AM, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" class="">stefano.zampini@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">While we are discussing this dialect stuff, do we still want to test for gnu++{11|14} extensions before testing for c++{11|14} ? We get warnings when using KOKKOS since it replaces gnu++14 with c++14. What is the added value of using gnu++{11|14}?</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno lun 14 dic 2020 alle ore 08:21 Barry Smith <<a href="mailto:bsmith@petsc.dev" class="">bsmith@petsc.dev</a>> ha scritto:<br class=""></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;" class=""><div class=""><br class=""></div> So two configure sins. Setting values running configure without logging them into configure.log and setting values without testing them with configure tests :-)<div class=""><br class=""></div><div class=""> We need to finally deal properly with setting -cbin in configure; just defaulting causes all kinds of undebuggable problems. Why can't we also just set it to the C++ compiler? Is it because it cannot handle the MPI c++ compiler so it needs to be set to the underlying C++ compiler?</div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""></div><div class=""> It is also strange that Jacob's configure.log seems to believe the IBM compiler is a GNU compiler (but because of poor logging configure does not log this information; fix coming in a MR soon).</div><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Dec 13, 2020, at 6:32 PM, Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com" target="_blank" class="">junchao.zhang@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="">Jacob,</div><div class=""> Do you need to add 'CUDAFLAGS=-ccbin xlc++' to specify the host compiler for CUDA? Note in cuda.py I added</div><div class=""><br class=""></div><div class=""><div style="font-family:Menlo,Monaco,"Courier New",monospace;font-size:14px;line-height:21px;white-space:pre-wrap" class=""><div class=""> <span style="color:rgb(175,0,219)" class="">if</span> <span style="color:rgb(0,0,255)" class="">self</span>.compilers.cxxdialect <span style="color:rgb(0,0,255)" class="">in</span> [<span style="color:rgb(163,21,21)" class="">'C++11'</span>,<span style="color:rgb(163,21,21)" class="">'C++14'</span>]: <span style="color:rgb(0,128,0)" class="">#nvcc is a C++ compiler so it is always good to add -std=xxx. It is even crucial when using thrust complex (see MR 2822)</span></div><div class=""> <span style="color:rgb(0,0,255)" class="">self</span>.setCompilers.CUDAFLAGS += <span style="color:rgb(163,21,21)" class="">' -std='</span> + <span style="color:rgb(0,0,255)" class="">self</span>.compilers.cxxdialect.lower()</div></div></div><div class=""><br class=""></div><div class=""> In your configure.log, there are </div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class="">#define PETSC_HAVE_CXX_DIALECT_CXX11 1</div><div class="">#define PETSC_HAVE_CXX_DIALECT_CXX14 1</div></blockquote><div class=""><br class=""></div><div class="">I guess without -ccbin, nvcc uses gcc by default and your gcc does not support C++14.</div><div class=""><br class=""></div><div class=""><div dir="ltr" class=""><div dir="ltr" class="">--Junchao Zhang</div></div></div><br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 13, 2020 at 1:25 PM Jacob Faibussowitsch <<a href="mailto:jacob.fai@gmail.com" target="_blank" class="">jacob.fai@gmail.com</a>> wrote:<br class=""></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="">Hello All,<div class=""><br class=""></div><div class="">Does anyone have any experience building petsc with cuda support on Lassen? I’ve been having trouble building with ibm xl compilers + spectrum-mpi + nvcc. NVCC seems to not like -std=c++14 argument, complaining that its configured host compiler doesn’t support it, but compiling the following “<a href="http://test.cc/" target="_blank" class="">test.cc</a>":</div><div class=""><br class=""></div><div class="">#include <stdlib.h><br class=""><br class="">int main(int argc, char **argv)<br class="">{ <br class=""> int i = 1;<br class=""> i += argc;<br class=""> return(i);<br class="">}<br class=""><br class=""></div><div class="">With mpicc -std=c++14 <a href="http://test.cc/" target="_blank" class="">test.cc</a> produces zero errors. </div><div class="">------------------------------------------------------------------------</div><div class=""><br class=""></div><div class="">Modules loaded:</div><div class=""><br class=""></div><div class="">module load xl/2020.11.12-cuda-11.1.1 <br class="">module load spectrum-mpi<br class="">module load cuda/11.1.1<br class="">module load python/3.8.2<br class="">module load cmake<br class="">module load valgrind<br class="">module load lapack<br class=""><br class=""></div><div class="">My configure commands:</div><div class=""><br class=""></div><div class="">./configure --with-cc=mpicc --with-cxx=mpiCC --with-fc=mpifort --with-cuda --with-debugging=1 PETSC_ARCH=arch-linux-c-debug</div><div class=""><br class=""></div><div class="">The error:</div><div class=""><br class=""></div><div class="">TESTING: findMPIInc from config.packages.MPI(config/BuildSystem/config/packages/MPI.py:636) *******************************************************************************<br class=""> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):<br class="">-------------------------------------------------------------------------------<br class="">Bad compiler flag: -I/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/include<br class="">*******************************************************************************</div><div class=""><br class=""></div><div class="">The actual configure.log error:</div><div class=""><br class=""></div><div class="">Executing: nvcc -c -o /var/tmp/petsc-2v0k4k61/config.setCompilers/conftest.o -I/var/tmp/petsc-2v0k4\<br class="">k61/config.setCompilers -I/var/tmp/petsc-2v0k4k61/config.types -g -std=c++14 -I/usr/tce/packages/s\<br class="">pectrum-mpi/ibm/spectrum-mpi-rolling-release/include -Wno-deprecated-gpu-targets /var/tmp/petsc-2v\<br class="">0k4k61/config.setCompilers/<a href="http://conftest.cu/" target="_blank" class="">conftest.cu</a> <br class="">Possible ERROR while running compiler:<br class="">stderr:<br class="">nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be\<br class=""> ignored.<br class="">Source:<br class="">#include "confdefs.h"<br class="">#include "conffix.h"<br class=""><br class="">int main() {<br class="">;<br class=""> return 0;<br class="">}<br class=""> Rejecting compiler flag -I/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/include due to <br class="">nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><div class="">Best regards,<br class=""><br class="">Jacob Faibussowitsch<br class="">(Jacob Fai - booss - oh - vitch)<br class="">Cell: (312) 694-3391</div></div>
</div>
</div></div><div class=""><div class=""></div></div></blockquote></div>
</div></blockquote></div><br class=""></div></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature">Stefano</div>
</div></blockquote></div><br class=""></div></div></body></html>