[petsc-users] Help with "make: m2c: Command not found"

Stephan Kramer s.kramer at imperial.ac.uk
Mon Nov 15 05:41:42 CST 2010


On 15/11/10 09:54, TAY wee-beng wrote:
> Hi,
>
> I have a modified makefile originally given to me by the PETSc team. It
> worked well but there's a small problem. Sometimes, when I have edited a
> fortran file and tries to rebuild, it gives this error:
>
> /opt/openmpi-1.4.1/bin/mpif90 -r8  -w95 -c -O3 -save airfoil.f90
> /opt/openmpi-1.4.1/bin/mpif90 -w95 -c -O3 -save grid.f90
> m2c    -o cell_data.o cell_data.mod
> make: m2c: Command not found
> make: *** [cell_data.o] Error 127
>
> However, if I delete all the *.o and *.mod files and build clean,
> there's no such problems. Is there anyway to solve this problem?
>
> I have attached the makefile
>
> Thanks!
>
> Yours sincerely,
>
> TAY wee-beng
>
>
>>>
>>>

This is caused by a built-in implicit make rule that tells make it can make object files
from modula-2 .mod files by running m2c - obviously not what you want. You can override it by adding the following
line to your makefile:

%.o: %.mod

Make sure the next line doesn't start with a tab.

Cheers
Stephan


More information about the petsc-users mailing list