[petsc-users] Can not find the header file for OpenMPI

neil liu liufield at gmail.com
Mon May 13 11:13:19 CDT 2024


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 at mcs.anl.gov> wrote:

> 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.
>
> As mentioned - you can do this either with:
>
> [if you have then in PATH] --with-cc=mpicc --with-cxx=mpicxx
> --with-fc=mpif90
>
> or:
>
> --with-cc=MPI-DIR/bin/mpicc --with-cxx=MPI-DIR/bin/mpicxx
> --with-fc=MPI-DIR/bin/mpif90
>
> or
>
> --with-mpi-dir=MPI-DIR
>
> If you are having trouble with any of the above modes - resend
> configure.log for it.
>
> Satish
>
> On Mon, 13 May 2024, neil liu wrote:
>
> > Thanks. I want to use the preinstalled OpenMPI to configure petsc. For
> the
> > preinstalled OpenMPI, the lib and include dir are at different places.
> > Then how should I configure with this preinstalled OpenMPI?
> >
> > Thanks,
> >
> > $ mpicc --show
> > gcc -I/usr/include/openmpi-x86_64 -Wl,-rpath -Wl,/usr/lib64/openmpi/lib
> > -Wl,--enable-new-dtags -L/usr/lib64/openmpi/lib -lmpi
> > [liuneil at localhost petsc]$ mpif90 --show
> > gfortran -I/usr/include/openmpi-x86_64 -I/usr/lib64/openmpi/lib
> -Wl,-rpath
> > -Wl,/usr/lib64/openmpi/lib -Wl,--enable-new-dtags
> -L/usr/lib64/openmpi/lib
> > -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi
> >
> >
> > On Mon, May 13, 2024 at 11:42 AM Satish Balay <balay at mcs.anl.gov> wrote:
> >
> > > You are misinterpreting  --with-mpi-include --with-mpi-lib options.
> > >
> > > Any particular reason you want to use these options instead of mpi
> > > compilers?
> > >
> > > >>>>>>>
> > > balay at p1 /home/balay
> > > $ mpicc -show
> > > gcc -I/home/balay/soft/mpich-4.0.1/include
> > > -L/home/balay/soft/mpich-4.0.1/lib -Wl,-rpath
> > > -Wl,/home/balay/soft/mpich-4.0.1/lib -Wl,--enable-new-dtags -lmpi
> > > balay at p1 /home/balay
> > > $ mpif90 -show
> > > gfortran -fallow-argument-mismatch
> -I/home/balay/soft/mpich-4.0.1/include
> > > -I/home/balay/soft/mpich-4.0.1/include
> -L/home/balay/soft/mpich-4.0.1/lib
> > > -lmpifort -Wl,-rpath -Wl,/home/balay/soft/mpich-4.0.1/lib
> > > -Wl,--enable-new-dtags -lmpi
> > > <<<<<
> > >
> > > i.e here I would use:
> > >
> > > --with-cc=gcc --with-cxx=g++ --with-fc=gfortran
> > > --with-mpi-include=/home/balay/soft/mpich-4.0.1/include
> > > --with-mpi-lib="-L/home/balay/soft/mpich-4.0.1/lib -Wl,-rpath
> > > -Wl,/home/balay/soft/mpich-4.0.1/lib -lmpifort -lmpi"
> > >
> > > Satish
> > >
> > >
> > >
> > > On Mon, 13 May 2024, neil liu wrote:
> > >
> > > > Thanks, I tried the following, and it didn't work.
> > > >
> > > > ./configure --download-fblaslapack
> --with-mpi-lib=/usr/lib64/openmpi/lib
> > > > --with-mpi-include=/usr/include/openmpi-x86_64
> > > >
> > >
> =============================================================================================
> > > >                          Configuring PETSc to compile on your system
> > > >
> > >
> =============================================================================================
> > > > TESTING: check from
> > > > config.libraries(config/BuildSystem/config/libraries.py:186)
> > > >
> > >
> *********************************************************************************************
> > > >            UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log
> for
> > > > details):
> > > >
> > >
> ---------------------------------------------------------------------------------------------
> > > >   --with-mpi-lib=['/usr/lib64/openmpi/lib'] and
> > > >   --with-mpi-include=['/usr/include/openmpi-x86_64'] did not work
> > > >
> > >
> *********************************************************************************************
> > > >
> > > > On Mon, May 13, 2024 at 11:32 AM Satish Balay <balay at mcs.anl.gov>
> wrote:
> > > >
> > > > >
> > > > > On Mon, 13 May 2024, neil liu wrote:
> > > > >
> > > > > > Dear Petsc developers,
> > > > > >
> > > > > > I am trying to install Petsc with a preinstalled OpenMPi.
> > > > > >
> > > > > > ./configure --download-fblaslapack
> --with-mpi-dir=/usr/lib64/openmpi
> > > > >
> > > > > --with-mpi-dir=DIR is a bit unique [wrt other pkg-dir options].
> > > > >
> > > > > It means:
> > > > >
> > > > > --with-cc=DIR/bin/mpicc --with-cxx=DIR/bin/mpicxx
> > > --with-fc=DIR/bin/mpif90
> > > > >
> > > > > > --with-mpi-incdir=/usr/include/openmpi-x86_64
> > > > >
> > > > > There is no such configure option
> > > > >
> > > > > >
> > > > > > But the final information shows,
> > > > > >   MPI:
> > > > > >   Version:    3
> > > > > >   Includes:   -I/usr/lib64/openmpi/include (*This is not the
> right
> > > > > include
> > > > > > directory*)
> > > > >
> > > > > Can you send configure.log for this build [perhaps to petsc-maint]
> > > > >
> > > > > Satish
> > > > >
> > > > > >   mpiexec: /usr/lib64/openmpi/bin/mpiexec
> > > > > >   Implementation: openmpi
> > > > > >   OMPI_VERSION: 4.1.1
> > > > > >
> > > > > > Did I use the wrong way to include the incdir?
> > > > > >
> > > > > > Thanks,
> > > > > > Xiaodong
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240513/a6804b33/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.log
Type: text/x-log
Size: 988220 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240513/a6804b33/attachment-0001.bin>


More information about the petsc-users mailing list