<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=""><div class=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class="">you need to have host and device compiler either both using c++17 or neither using c++17.</div></div></blockquote></div><div class=""><br class=""></div>I will create a fixup MR for this that tries to address it in configure. I had previously come across this behavior in CI, but was never able to reproduce the linker errors on multiple machines (summit included!). <div class=""><br class=""></div><div class="">Oddly enough the above rule isn’t even always required. Some compiler combinations seem to work perfectly fine mixing c++11/14 with c++17… It doesn’t scale with compiler age either, I tested linking with a compiler far older than the one breaking in CI and it compiled and linked without a problem.<div class=""><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>Best regards,<br class=""><br class="">Jacob Faibussowitsch<br class="">(Jacob Fai - booss - oh - vitch)<br class=""></div></div></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Aug 30, 2021, at 13:02, Jacob Faibussowitsch <<a href="mailto:jacob.fai@gmail.com" class="">jacob.fai@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><blockquote type="cite" class=""><div dir="ltr" class="">No luck with C++14</div></blockquote><div class=""><br class=""></div><div class="">TL;DR: you need to have host and device compiler either both using c++17 or neither using c++17.</div><div class=""><br class=""></div><div class="">Long version:</div><div class="">C++17 among other things changed how static constexpr member variables for classes worked. Previously if I had a class with a static constexpr member variable I would have to not only declare it inline within the class, but also define it within an executable otherwise the variable would not actually have any physical memory address:</div><div class=""><br class=""></div><div class="">// foo.hpp</div><div class="">class foo</div><div class="">{</div><div class="">  static constexpr int bar = 5;</div><div class="">};</div><div class=""><br class=""></div><div class="">// foo.cpp</div><div class="">int foo::bar;</div><div class=""><br class=""></div><div class="">In c++17 however this changed because you can have static “inline” variables. All this does is force the compiler define the variable for you instead. The issue of course is that static constexpr implicitly makes that variable inline in c++17. So to sum it up:</div><div class=""><br class=""></div><div class="">1. The c++17 compiler (nvcc) sees the static constexpr variable, goes “hmm ok I will define this in some undefined location”.</div><div class="">2. The c++11/14 compiler comes along, sees your hand-coded definition of the variable and goes “ah but I think I’ve seen this before, I’ll ignore it”. This silent rejection is due to the hand-coded definition idiom being deprecated from c++17 onwards. Stupid, I know.</div><div class="">2. The linker (driven by the c++11/14 compiler since PETSc links using the host compiler) comes along and now suddenly cannot find the literal definition, because it doesn’t know what the c++17 did. Disaster!</div><div class=""><br class=""></div><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Best regards,<br class=""><br class="">Jacob Faibussowitsch<br class="">(Jacob Fai - booss - oh - vitch)<br class=""></div></div></div>
</div>
<div class=""><br class=""><blockquote type="cite" class=""><div class="">On Aug 30, 2021, at 10:12, Mark Adams <<a href="mailto:mfadams@lbl.gov" class="">mfadams@lbl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">No luck with C++14<div class=""><br class=""></div><div class="">       CUDAC arch-summit-hypre-cuda-dbg/obj/vec/is/sf/impls/basic/cuda/sfcuda.o<br class="">   CUDAC.dep arch-summit-hypre-cuda-dbg/obj/vec/is/sf/impls/basic/cuda/sfcuda.o<br class="">     CLINKER arch-summit-hypre-cuda-dbg/lib/libpetsc.so.3.015.3<br class="">arch-summit-hypre-cuda-dbg/obj/sys/objects/device/impls/cupm/cuda/cupmcontext.o:(.rodata._ZN5Petsc13CUPMInterfaceILNS_14CUPMDeviceKindE0EE21cupmStreamNonBlockingE[_ZN5Petsc13CUPMInterfaceILNS_14CUPMDeviceKindE0EE21cupmStreamNonBlockingE]+0x0): multiple definition of `Petsc::CUPMInterface<(Petsc::CUPMDeviceKind)0>::cupmStreamNonBlocking'<br class="">arch-summit-hypre-cuda-dbg/obj/sys/objects/device/interface/cupminterface.o:(.rodata+0x44): first defined here<br class="">/usr/bin/ld: link errors found, deleting executable `arch-summit-hypre-cuda-dbg/lib/libpetsc.so.3.015.3'<br class="">collect2: error: ld returned 1 exit status<br class="">gmake[3]: *** [gmakefile:113: arch-summit-hypre-cuda-dbg/lib/libpetsc.so.3.015.3] Error 1<br class="">gmake[2]: *** [/gpfs/alpine/csc314/scratch/adams/petsc2/lib/petsc/conf/rules:50: libs] Error 2<br class="">**************************ERROR*************************************<br class="">  Error during compile, check arch-summit-hypre-cuda-dbg/lib/petsc/conf/make.log<br class="">  Send it and arch-summit-hypre-cuda-dbg/lib/petsc/conf/configure.log to <a href="mailto:petsc-maint@mcs.anl.gov" target="_blank" class="">petsc-maint@mcs.anl.gov</a><br class="">********************************************************************<br class="">gmake[1]: *** [makefile:40: all] Error 1<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 30, 2021 at 10:50 AM Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank" class="">mfadams@lbl.gov</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 dir="ltr" class="">Stefano suggested C++14 in configure. I was using C++11.</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 30, 2021 at 10:46 AM Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com" target="_blank" class="">junchao.zhang@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 dir="ltr" class=""> Petsc::CUPMInterface<div class=""><a class="gmail_plusreply" id="gmail-m_686454589642789192gmail-m_-7452409094428198801gmail-m_4835741043396578066plusReplyChip-0" href="mailto:jacob.fai@gmail.com" target="_blank">@Jacob Faibussowitsch</a> <br clear="all" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class="">--Junchao Zhang</div></div></div><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 30, 2021 at 9:35 AM Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank" class="">mfadams@lbl.gov</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 dir="ltr" class="">I was running fine this AM and am bouncing between modules to help two apps (ECP milestone season) at the same time and something broke. I did update main and I get the same error in main and a hypre branch of Stefano's. <div class="">I started with a clean build and checked my modules...<div class="">Any ideas?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Mark<br class=""><div class=""><br class=""></div><div class="">       CC arch-summit-hypre-cuda-dbg/obj/tao/interface/taosolver.o<br class="">          CC arch-summit-hypre-cuda-dbg/obj/ts/interface/ts.o<br class="">       CUDAC arch-summit-hypre-cuda-dbg/obj/mat/impls/dense/seq/cuda/densecuda.o<br class="">   CUDAC.dep arch-summit-hypre-cuda-dbg/obj/mat/impls/dense/seq/cuda/densecuda.o<br class="">       CUDAC arch-summit-hypre-cuda-dbg/obj/mat/impls/aij/seq/seqcusparse/aijcusparseband.o<br class="">   CUDAC.dep arch-summit-hypre-cuda-dbg/obj/mat/impls/aij/seq/seqcusparse/aijcusparseband.o<br class="">       CUDAC arch-summit-hypre-cuda-dbg/obj/ts/utils/dmplexlandau/cuda/landaucu.o<br class="">   CUDAC.dep arch-summit-hypre-cuda-dbg/obj/ts/utils/dmplexlandau/cuda/landaucu.o<br class="">       CUDAC arch-summit-hypre-cuda-dbg/obj/vec/vec/impls/seq/seqcuda/veccuda2.o<br class="">   CUDAC.dep arch-summit-hypre-cuda-dbg/obj/vec/vec/impls/seq/seqcuda/veccuda2.o<br class="">       CUDAC arch-summit-hypre-cuda-dbg/obj/mat/impls/aij/mpi/mpicusparse/mpiaijcusparse.o<br class="">   CUDAC.dep arch-summit-hypre-cuda-dbg/obj/mat/impls/aij/mpi/mpicusparse/mpiaijcusparse.o<br class="">       CUDAC arch-summit-hypre-cuda-dbg/obj/mat/impls/aij/seq/seqcusparse/aijcusparse.o<br class="">   CUDAC.dep arch-summit-hypre-cuda-dbg/obj/mat/impls/aij/seq/seqcusparse/aijcusparse.o<br class="">       CUDAC arch-summit-hypre-cuda-dbg/obj/vec/is/sf/impls/basic/cuda/sfcuda.o<br class="">   CUDAC.dep arch-summit-hypre-cuda-dbg/obj/vec/is/sf/impls/basic/cuda/sfcuda.o<br class="">     CLINKER arch-summit-hypre-cuda-dbg/lib/libpetsc.so.3.015.3<br class="">arch-summit-hypre-cuda-dbg/obj/sys/objects/device/impls/cupm/cuda/cupmcontext.o:(.rodata._ZN5Petsc13CUPMInterfaceILNS_14CUPMDeviceKindE0EE21cupmStreamNonBlockingE[_ZN5Petsc13CUPMInterfaceILNS_14CUPMDeviceKindE0EE21cupmStreamNonBlockingE]+0x0): multiple definition of `Petsc::CUPMInterface<(Petsc::CUPMDeviceKind)0>::cupmStreamNonBlocking'<br class="">arch-summit-hypre-cuda-dbg/obj/sys/objects/device/interface/cupminterface.o:(.rodata+0x44): first defined here<br class="">/usr/bin/ld: link errors found, deleting executable `arch-summit-hypre-cuda-dbg/lib/libpetsc.so.3.015.3'<br class="">collect2: error: ld returned 1 exit status<br class="">gmake[3]: *** [gmakefile:113: arch-summit-hypre-cuda-dbg/lib/libpetsc.so.3.015.3] Error 1<br class="">gmake[2]: *** [/gpfs/alpine/csc314/scratch/adams/petsc2/lib/petsc/conf/rules:50: libs] Error 2<br class="">**************************ERROR*************************************<br class="">  Error during compile, check arch-summit-hypre-cuda-dbg/lib/petsc/conf/make.log<br class="">  Send it and arch-summit-hypre-cuda-dbg/lib/petsc/conf/configure.log to <a href="mailto:petsc-maint@mcs.anl.gov" target="_blank" class="">petsc-maint@mcs.anl.gov</a><br class="">********************************************************************<br class="">gmake[1]: *** [makefile:40: all] Error 1<br class="">make: *** [GNUmakefile:9: all] Error 2<br class=""></div></div></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></body></html>