I think it’s worth sharing this since it took me quiet some time and installing petsc from source is a bit of a challenge. Maybe we can link this post in the original thread.
I had exactly the same issue as described in this (unresolved) post… I also ran
make all test in order to successfully test my petsc installation, but
cmake refused to pick up the petsc installation. In the end, I managed it by using the following commands (after downloading the sources):
tar xvzf petsc-x-y-z.tar.gz cd petsc-x-y-z ./config/configure.py --with-shared=1 --with-x=0 --with-mpi=1 --with-debugging=0 \ COPTFLAGS='-O3 -march=native -mtune=native' CXXOPTFLAGS='-O3 -march=native -mtune=native' \ --with-cc=gcc --with-cxx=g++ --with-fc=0
I think the main point here is the definition of the compiler. I used gcc 10.2 and OpenMPI 4.0.4 and not the mpi wrapper. I think preCICE does the same thing in the end.
However, in my first installation, I also had a non-default installation prefix and I don’t recommend to use it, i.e., install petsc directly in the build directory.
Maybe this helps some future reader.