<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: rgb(255, 255, 255);">Dear all,<div>
    I hope you&#39;re having a nice day.</div><div>    I met a problem on makefile of PETSc. Original PETSc has the makefile in the same directory of the .c files. However, I want to put all .c files to another directory. I changed the makefile also; however it always has a error saying the PETSc header files can not be found:</div>
<div><br></div><div><div>/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/bin/mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3  -o ComputerRHS.o  Programs/ComputeRHS.c -L/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/lib  -lpetsc -Wl,-rpath,/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/lib -lflapack -lfblas -lm -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -ldl -lmpich -lopa -lmpl -lrt -lpthread -lgcc_s -lmpichf90 -lgfortran -lm -lm -ldl -lmpich -lopa -lmpl -lrt -lpthread -lgcc_s -ldl </div>
<div>Programs/ComputeRHS.c:1:23: error: petscdmda.h: No such file or directory</div><div>Programs/ComputeRHS.c:2:22: error: petscksp.h: No such file or directory</div><div>Programs/ComputeRHS.c:3:23: error: petscpcmg.h: No such file or directory</div>
<div>Programs/ComputeRHS.c:4:23: error: petscdmmg.h: No such file or directory</div><div>In file included from Programs/ComputeRHS.c:5:</div><div>Programs/def.h:6:22: error: petscsys.h: No such file or directory</div><div>
In file included from Programs/ComputeRHS.c:5:</div><div>Programs/def.h:25: error: expected specifier-qualifier-list before PetscReal</div><div>Programs/def.h:29: error: expected specifier-qualifier-list before PetscScalar</div>
<div>Programs/def.h:35: error: expected specifier-qualifier-list before PetscInt</div><div>Programs/def.h:41: error: expected specifier-qualifier-list before PetscScalar</div><div>Programs/ComputeRHS.c:10: error: expected =, ,, ;, asm or __attribute__ before ComputeRHS</div>
<div>make: [ComputeRHS.o] Error 1 (ignored)</div><div>make: *** No rule to make target `Initialization.o&#39;, needed by `ex29&#39;.  Stop.</div></div><div><br></div><div>    My codes are attached. Could you please help me to figure this out?</div>
<div><br></div><div>thanks,</div><div>Alan</div></span>