1

I am trying to install PETSc on Ubuntu running within the windows subsystem for windows, but the steps detailed on the official webpage lead to a compilation error.

First I cloned the PETSc repo and ran the configure command: ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-openmpi --download-fblaslapack, which worked. (I already had OpenMPI installed before, but the configure command didn't work without the --download-openmpi switch.) Then I executed the make command output by the ./configure code (make PETSC_DIR=/mnt/c/Stuff/Petsc/petsc PETSC_ARCH=arch-linux2-c-debug all) and got this error:

In file included from /mnt/c/Stuff/Petsc/petsc/src/mat/order/qmdmrg.c:4:0:
/mnt/c/Stuff/Petsc/petsc/include/petscsys.h:134:12: fatal error: mpi.h: No such file or directory
 #  include <mpi.h>
            ^~~~~~~
compilation terminated.
gmakefile:153: recipe for target 'arch-linux2-c-debug/obj/mat/order/qmdmrg.o' failed
make[2]: *** [arch-linux2-c-debug/obj/mat/order/qmdmrg.o] Error 1

(The full make output is here, the error above was only a small part.) Apparently the PETSc make routine can't find MPI, but I have it installed: Running which mpicc gives the expected /usr/bin/mpicc. Does anyone have an idea? Thanks for the help!

Pux
  • 421
  • 3
  • 18

1 Answers1

0

The solution was very simple: I just ran make all test. Unlike the suggested command that worked.

Pux
  • 421
  • 3
  • 18