<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBannerkpoo0bu { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #D0D8DC !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtonkpoo0bu:hover, .pfptPrimaryButtonkpoo0bu:focus {
background-color: #b4c1c7 !important; }
.pfptPrimaryButtonkpoo0bu:active {
background-color: #90a4ae !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
Thanks Satish. The first way worked. ( --with-cc=MPI-DIR/bin/mpicc --with-cxx=MPI-DIR/bin/mpicxx --with-fc=MPI-DIR/bin/mpif90) I also tried the 2nd way, it didn't work. Thanks, XIaodong On Mon, May 13, 2024 at 11: 57 AM Satish Balay <balay@ mcs. anl. gov>
</div>
<!-- Preheader Text : END -->
<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>
<!--[if ((ie)|(mso))]>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" ><tr><td>
<table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
<table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
<tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
This Message Is From an External Sender
</td></tr>
<tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
This message came from outside your organization.
</td></tr>
</table>
</td></tr></table>
</td></tr></table>
<![endif]-->
<![if !((ie)|(mso))]>
<div dir="ltr" id="pfptBannerkpoo0bu" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D0D8DC !important; background-color: #D0D8DC; border-top: 4px solid #90a4ae !important; border-top: 4px solid #90a4ae;">
<div id="pfptBannerkpoo0bu" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
<div id="pfptBannerkpoo0bu" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
This Message Is From an External Sender
</div>
<div id="pfptBannerkpoo0bu" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
This message came from outside your organization.
</div>
</div>
<div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
</div>
<![endif]>
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->
<!-- BaNnErBlUrFlE-BoDy-end -->
<div dir="ltr"><div>Thanks Satish.</div><div><br></div><div>The first way worked.(
--with-cc=MPI-DIR/bin/mpicc --with-cxx=MPI-DIR/bin/mpicxx --with-fc=MPI-DIR/bin/mpif90)</div><div>I also tried the 2nd way, it didn't work. <br></div><div><br></div><div>Thanks, <br></div><div><br></div><div>XIaodong <br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 13, 2024 at 11:57 AM Satish Balay <<a href="mailto:balay@mcs.anl.gov">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">If you are using mpicc/mpif90 as compilers from you pre-installed MPI - you don't need to list --with-mpi-include, --with-mpi-lib options.<br>
<br>
As mentioned - you can do this either with:<br>
<br>
[if you have then in PATH] --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90<br>
<br>
or:<br>
<br>
--with-cc=MPI-DIR/bin/mpicc --with-cxx=MPI-DIR/bin/mpicxx --with-fc=MPI-DIR/bin/mpif90<br>
<br>
or<br>
<br>
--with-mpi-dir=MPI-DIR<br>
<br>
If you are having trouble with any of the above modes - resend configure.log for it.<br>
<br>
Satish<br>
<br>
On Mon, 13 May 2024, neil liu wrote:<br>
<br>
> Thanks. I want to use the preinstalled OpenMPI to configure petsc. For the<br>
> preinstalled OpenMPI, the lib and include dir are at different places.<br>
> Then how should I configure with this preinstalled OpenMPI?<br>
> <br>
> Thanks,<br>
> <br>
> $ mpicc --show<br>
> gcc -I/usr/include/openmpi-x86_64 -Wl,-rpath -Wl,/usr/lib64/openmpi/lib<br>
> -Wl,--enable-new-dtags -L/usr/lib64/openmpi/lib -lmpi<br>
> [liuneil@localhost petsc]$ mpif90 --show<br>
> gfortran -I/usr/include/openmpi-x86_64 -I/usr/lib64/openmpi/lib -Wl,-rpath<br>
> -Wl,/usr/lib64/openmpi/lib -Wl,--enable-new-dtags -L/usr/lib64/openmpi/lib<br>
> -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi<br>
> <br>
> <br>
> On Mon, May 13, 2024 at 11:42 AM Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
> <br>
> > You are misinterpreting --with-mpi-include --with-mpi-lib options.<br>
> ><br>
> > Any particular reason you want to use these options instead of mpi<br>
> > compilers?<br>
> ><br>
> > >>>>>>><br>
> > balay@p1 /home/balay<br>
> > $ mpicc -show<br>
> > gcc -I/home/balay/soft/mpich-4.0.1/include<br>
> > -L/home/balay/soft/mpich-4.0.1/lib -Wl,-rpath<br>
> > -Wl,/home/balay/soft/mpich-4.0.1/lib -Wl,--enable-new-dtags -lmpi<br>
> > balay@p1 /home/balay<br>
> > $ mpif90 -show<br>
> > gfortran -fallow-argument-mismatch -I/home/balay/soft/mpich-4.0.1/include<br>
> > -I/home/balay/soft/mpich-4.0.1/include -L/home/balay/soft/mpich-4.0.1/lib<br>
> > -lmpifort -Wl,-rpath -Wl,/home/balay/soft/mpich-4.0.1/lib<br>
> > -Wl,--enable-new-dtags -lmpi<br>
> > <<<<<<br>
> ><br>
> > i.e here I would use:<br>
> ><br>
> > --with-cc=gcc --with-cxx=g++ --with-fc=gfortran<br>
> > --with-mpi-include=/home/balay/soft/mpich-4.0.1/include<br>
> > --with-mpi-lib="-L/home/balay/soft/mpich-4.0.1/lib -Wl,-rpath<br>
> > -Wl,/home/balay/soft/mpich-4.0.1/lib -lmpifort -lmpi"<br>
> ><br>
> > Satish<br>
> ><br>
> ><br>
> ><br>
> > On Mon, 13 May 2024, neil liu wrote:<br>
> ><br>
> > > Thanks, I tried the following, and it didn't work.<br>
> > ><br>
> > > ./configure --download-fblaslapack --with-mpi-lib=/usr/lib64/openmpi/lib<br>
> > > --with-mpi-include=/usr/include/openmpi-x86_64<br>
> > ><br>
> > =============================================================================================<br>
> > > Configuring PETSc to compile on your system<br>
> > ><br>
> > =============================================================================================<br>
> > > TESTING: check from<br>
> > > config.libraries(config/BuildSystem/config/libraries.py:186)<br>
> > ><br>
> > *********************************************************************************************<br>
> > > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for<br>
> > > details):<br>
> > ><br>
> > ---------------------------------------------------------------------------------------------<br>
> > > --with-mpi-lib=['/usr/lib64/openmpi/lib'] and<br>
> > > --with-mpi-include=['/usr/include/openmpi-x86_64'] did not work<br>
> > ><br>
> > *********************************************************************************************<br>
> > ><br>
> > > On Mon, May 13, 2024 at 11:32 AM Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
> > ><br>
> > > ><br>
> > > > On Mon, 13 May 2024, neil liu wrote:<br>
> > > ><br>
> > > > > Dear Petsc developers,<br>
> > > > ><br>
> > > > > I am trying to install Petsc with a preinstalled OpenMPi.<br>
> > > > ><br>
> > > > > ./configure --download-fblaslapack --with-mpi-dir=/usr/lib64/openmpi<br>
> > > ><br>
> > > > --with-mpi-dir=DIR is a bit unique [wrt other pkg-dir options].<br>
> > > ><br>
> > > > It means:<br>
> > > ><br>
> > > > --with-cc=DIR/bin/mpicc --with-cxx=DIR/bin/mpicxx<br>
> > --with-fc=DIR/bin/mpif90<br>
> > > ><br>
> > > > > --with-mpi-incdir=/usr/include/openmpi-x86_64<br>
> > > ><br>
> > > > There is no such configure option<br>
> > > ><br>
> > > > ><br>
> > > > > But the final information shows,<br>
> > > > > MPI:<br>
> > > > > Version: 3<br>
> > > > > Includes: -I/usr/lib64/openmpi/include (*This is not the right<br>
> > > > include<br>
> > > > > directory*)<br>
> > > ><br>
> > > > Can you send configure.log for this build [perhaps to petsc-maint]<br>
> > > ><br>
> > > > Satish<br>
> > > ><br>
> > > > > mpiexec: /usr/lib64/openmpi/bin/mpiexec<br>
> > > > > Implementation: openmpi<br>
> > > > > OMPI_VERSION: 4.1.1<br>
> > > > ><br>
> > > > > Did I use the wrong way to include the incdir?<br>
> > > > ><br>
> > > > > Thanks,<br>
> > > > > Xiaodong<br>
> > > > ><br>
> > > ><br>
> > > ><br>
> > ><br>
> ><br>
> <br>
</blockquote></div>