<div dir="ltr"><div dir="ltr">On Thu, Aug 29, 2019 at 4:02 PM Sam Guo <<a href="mailto:sam.guo@cd-adapco.com">sam.guo@cd-adapco.com</a>> wrote:<br></div><div class="gmail_quote"><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"><div>Thanks for the quick response. Attached please find the configure.log containing the configure error. </div></div></blockquote><div><br></div><div>Executing: /home/xianzhongg/petsc-3.11.3/lib/petsc/bin/win32fe/win32fe cl -c -o /tmp/petsc-6DsCEk/config.libraries/conftest.o -I/tmp/petsc-6DsCEk/config.compilers -I/tmp/petsc-6DsCEk/config.setCompilers -I/tmp/petsc-6DsCEk/config.utilities.closure -I/tmp/petsc-6DsCEk/config.headers -I/tmp/petsc-6DsCEk/config.utilities.cacheDetails -I/tmp/petsc-6DsCEk/config.types -I/tmp/petsc-6DsCEk/config.atomics -I/tmp/petsc-6DsCEk/config.functions -I/tmp/petsc-6DsCEk/config.utilities.featureTestMacros -I/tmp/petsc-6DsCEk/config.utilities.missing -I/tmp/petsc-6DsCEk/PETSc.options.scalarTypes -I/tmp/petsc-6DsCEk/config.libraries  -MD -wd4996 -Z7  /tmp/petsc-6DsCEk/config.libraries/conftest.c <br>stdout: conftest.c<br>Successful compile:<br>Source:<br>#include "confdefs.h"<br>#include "conffix.h"<br>/* Override any gcc2 internal prototype to avoid an error. */<br>char MPI_Init();<br>static void _check_MPI_Init() { MPI_Init(); }<br>char MPI_Comm_create();<br>static void _check_MPI_Comm_create() { MPI_Comm_create(); }<br><br>int main() {<br>_check_MPI_Init();<br>_check_MPI_Comm_create();;<br>  return 0;<br>}<br>Executing: /home/xianzhongg/petsc-3.11.3/lib/petsc/bin/win32fe/win32fe cl  -o /tmp/petsc-6DsCEk/config.libraries/conftest.exe    -MD -wd4996 -Z7 /tmp/petsc-6DsCEk/config.libraries/conftest.o  /home/xianzhongg/dev/star/lib/win64/intel18.3vc14/lib/StarMpiWrapper.lib Ws2_32.lib <br>stdout:<br>LINK : C:\cygwin64\tmp\PE81BA~1\CONFIG~1.LIB\conftest.exe not found or not built by the last incremental link; performing full link<br>conftest.obj : error LNK2019: unresolved external symbol MPI_Init referenced in function _check_MPI_Init<br>conftest.obj : error LNK2019: unresolved external symbol MPI_Comm_create referenced in function _check_MPI_Comm_create<br>C:\cygwin64\tmp\PE81BA~1\CONFIG~1.LIB\conftest.exe : fatal error LNK1120: 2 unresolved externals<br>Possible ERROR while running linker: exit code 2<br>stdout:<br>LINK : C:\cygwin64\tmp\PE81BA~1\CONFIG~1.LIB\conftest.exe not found or not built by the last incremental link; performing full link<br>conftest.obj : error LNK2019: unresolved external symbol MPI_Init referenced in function _check_MPI_Init<br>conftest.obj : error LNK2019: unresolved external symbol MPI_Comm_create referenced in function _check_MPI_Comm_create<br>C:\cygwin64\tmp\PE81BA~1\CONFIG~1.LIB\conftest.exe : fatal error LNK1120: 2 unresolved externals<br></div><div><br></div><div>The link is definitely failing. Does it work if you do it by hand?</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </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"><div>Regarding our dup, our wrapper does support it. In fact, everything works fine on Linux. I suspect on windows, PETSc picks the system mpi.h somehow. I am investigating it.</div><div><br></div><div>Thanks,</div><div>Sam</div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr">On Thu, Aug 29, 2019 at 3:39 PM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)"><div dir="ltr"><div dir="ltr">On Thu, Aug 29, 2019 at 3:33 PM Sam Guo via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear PETSc dev team,<div>   I am looking some tips porting petsc to windows. We have our mpi wrapper (so we can switch different mpi). I configure petsc using --with-mpi-lib and --with-mpi-include</div><div> ./configure --with-cc="win32fe cl" --with-fc=0 --download-f2cblaslapack --with-mpi-lib=/home/xianzhongg/dev/star/lib/win64/intel18.3vc14/lib/StarMpiWrapper.lib --with-mpi-include=/home/xianzhongg/dev/star/base/src/mpi/include --with-shared-libaries=1</div><div><br></div><div>But I got error</div><div>===============================================================================<br>             Configuring PETSc to compile on your system<br>===============================================================================<br>TESTING: check from config.libraries(config/BuildSystem/config/libraries.py:154)         *******************************************************************************<br>         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):<br>-------------------------------------------------------------------------------<br>--with-mpi-lib=['/home/xianzhongg/dev/star/lib/win64/intel18.3vc14/lib/StarMpiWrapper.lib'] and<br>--with-mpi-include=['/home/xianzhongg/dev/star/base/src/mpi/include'] did not work<br>*******************************************************************************</div></div></div></div></div></div></div></div></blockquote><div><br></div><div>Your MPI wrapper should pass the tests here. Send the configure.log</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>To fix the configuration error,  in config/BuildSystem/config/package.py, I removed </div><div> self.executeTest(self.checkDependencies)<br> self.executeTest(self.configureLibrary)<br> self.executeTest(self.checkSharedLibrary)</div><div><br></div><div>To link, I add my mpi wrapper to ${PTESTC_ARCH}/lib/petsc/conf/petscvariables:</div><div>PCC_LINKER_FLAGS =    -MD -wd4996 -Z7 /home/xianzhongg/dev/star/lib/win64/intel18.3vc14/lib/StarMpiWrapper.lib</div><div><br></div><div>I got libpetstc.dll and libpetstc.lib. When I try to test it inside our code, PETSc somehow crates a duplicate of communicator with only 1 MPI process and PETSC_COMM_WORLD is set to 2. If I set PETSC_COMM_WORLD to 1 (our MPI_COMM_WORLD), PETSc is hanging. </div></div></div></div></div></div></div></div></blockquote><div><br></div><div>We do dup the communicator on entry. Shouldn't that be supported by your wrapper?</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I am wondering if you could give me some tips how to debug this problem.</div><div><br></div><div>BR,</div><div>Sam</div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div class="gmail-m_-2618992345834597221gmail-m_1576933098793190505gmail_signature" dir="ltr"><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/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>