Closed PhMakowski closed 3 years ago
It seems you are compiling bitpit with openmpi-devel-4.1.0, however PETSc is compiled with a different MPI version:
Which distribution are you using? Maybe you will be able to find matching PETSc/MPI packages in the official repositories of your distribution.
Which distribution are you using? Maybe you will be able to find matching PETSc/MPI packages in the official repositories of your distribution. I'm using Fedora with petsc-openmpi-devel and openmpi-devel By the way, under Ubuntu 20, I don't find the correct way to use openmpi and petsc from the package and build bitpit with.
PETSc could not be found. Be sure to set PETSC_DIR and PETSC_ARCH. (missing: PETSC_INCLUDES PETSC_LIBRARIES PETSC_EXECUTABLE_RUNS)
Ok, I found the solution under Fedora. you have to change variables to :
cmake -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_MPI=ON -DPETSC_LIBRARIES=/usr/lib64/openmpi/lib/ -DPETSC_INCLUDES=/usr/include/openmpi-x86_64/petsc -DLAPACKE_DIR=/usr/lib64 -DLAPACKE_INCLUDE_DIRS=/usr/include/lapacke -DPETSC_EXECUTABLE_RUNS=/usr/lib64/petsc -DCBLAS_INCLUDE_DIRS=/usr/include/cblas/ ..
instead of (without MPI) :
cmake -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_MPI=OFF -DPETSC_INCLUDES=/usr/include/petsc -DPETSC_LIBRARIES=/usr/lib64 -DPETSC_EXECUTABLE_RUNS=/usr/lib64/petsc -DLAPACKE_DIR=/usr/lib64 -DLAPACKE_INCLUDE_DIRS=/usr/include/lapacke -DCBLAS_INCLUDE_DIRS=/usr/include/cblas/ ..
Under Ubuntu20 with MPI :
cmake -DENABLE_MPI=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DPETSC_EXECUTABLE_RUNS=/usr/lib/petsc -DPETSC_INCLUDES=/usr/include/petsc -DPETSC_LIBRARIES=/usr/lib/petsc ..
Without MPI :
cmake -DENABLE_MPI=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DPETSC_EXECUTABLE_RUNS=/usr/lib/petsc -DPETSC_INCLUDES=/usr/include/petsc -DPETSC_LIBRARIES=/usr/lib/petsc -DCMAKE_CXX_FLAGS=-isystem\ /usr/include/openmpi/
Yes, the build without MPI need mpi.h ! Strange.
You can close the bug, but maybe it can be put in some doc.
I think the serial version still needs MPI because PETSc in Ubuntu20 seems compiled with MPI support (you are using the same PETSc version for both MPI and non-MPI code, so I think that the PETSc library under /usr/lib/petsc is compiled with MPI support). If you need a MPI-free version, you need to compile PETSc without MPI support (https://www.mcs.anl.gov/petsc/documentation/installation.html see paragraph "Installing without MPI"). Fedora seems to have two different versions of PETSc: /usr/lib64/petsc looks like the serial version, whereas /usr/lib64/openmpi/lib looks like the MPI version.
I'm closing the issue. Feel free to reopen it if you still have problems
Hi, I have openmpi-devel-4.1.0, petsc-openmpi-devel-3.14.4, gcc-11.1.1 but I can't build bitpit 1.7.1 with ENABLE_MPI ON.
The log is here : https://paste.centos.org/view/cc010a87
the first 2 errors are :