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

Barry Smith bsmith at mcs.anl.gov
Mon Nov 15 08:11:09 CST 2010


  Should we put this rule or something similar in the conf/rules file so this issue doesn't bite other people?

   Barry


Begin forwarded message:

> From: Stephan Kramer <s.kramer at imperial.ac.uk>
> Date: November 15, 2010 5:41:42 AM CST
> To: PETSc users list <petsc-users at mcs.anl.gov>
> Subject: Re: [petsc-users] Help with "make: m2c: Command not found"
> Reply-To: PETSc users list <petsc-users at mcs.anl.gov>
> 
> 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-dev mailing list