How to enable language C and language Fortran when installing package from cmake in order to make executable

I was trying to install this package from cmake shown in order to make an executable for lammps, but I got an error that my language C and language Fortran was not enabled. Any steps on what to do next would be appreciated.

What is the project() call at the top of your project? To find MPI’s C libraries, you need the C language enabled. Same with the CXX libraries. Also, what does the find_package(MPI) call look like?

Note that the error message given is a bit noisy and contains red herrings. It was fixed recently (CMake 3.20 I think).


Have you set up your environment for MPI? For example, are things like mpirun and mpicxx in your path?