Dear Sir/Madam,<br> I hope you're having a nice day.<br> I asked several questions about src/ksp/ksp/example/tutorial/ex29.c before, and learned some beginning staff of PETSc. Right now, I want to start to use it to my own program. Firstly, I want to isolate the ComputeRHS function in ex29, which means I want to put ComputeRHS to another c program file. I did that; however, some problem pop up when I compile it. <br>
<br>/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/bin/mpicc -o ex29.o -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -I/home/zlwei/soft/mercurial/petsc-dev/include -I/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/include -I/home/zlwei/soft/mercurial/petsc-dev/src/dm/mesh/sieve -D__INSDIR__=src/ksp/ksp/examples/tutorials/ ex29.c<br>
ex29.c: In function ComputeRHS:<br>ex29.c:39: error: storage class specified for parameter BCType<br>ex29.c:44: error: expected specifier-qualifier-list before BCType<br>ex29.c:61: error: expected =, ,, ;, asm or __attribute__ before { token<br>
ex29.c:117: error: expected =, ,, ;, asm or __attribute__ before { token<br>ex29.c:130: error: expected =, ,, ;, asm or __attribute__ before { token<br>ex29.c:197: error: expected =, ,, ;, asm or __attribute__ before { token<br>
ex29.c:220: error: old-style parameter declarations in prototyped function definition<br>ex29.c:220: error: expected { at end of input<br>make: [ex29.o] Error 1 (ignored)<br>/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/bin/mpicc -o ComputeRHS.o -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -I/home/zlwei/soft/mercurial/petsc-dev/include -I/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/include -I/home/zlwei/soft/mercurial/petsc-dev/src/dm/mesh/sieve -D__INSDIR__=src/ksp/ksp/examples/tutorials/ ComputeRHS.c<br>
/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/bin/mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -o ex29 ex29.o ComputeRHS.o -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 <br>
gcc: ex29.o: No such file or directory<br>make: [ex29] Error 1 (ignored)<br><br>The program and modified makefile are attached. Could you please take a look and give me some suggestions. <br><br>best,<br>Alan<br>