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@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 <ba...@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@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@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 <ba...@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 > > > > > > > > > > > > > > > > > > >