CFLAGS                = 
FFLAGS                =
CPPFLAGS        =
FPPFLAGS        = 
LOCDIR          = src/vec/vec/examples/tests/
EXAMPLESC       = ex1.c ex2.c ex3.c ex4.c ex5.c ex6.c ex7.c ex8.c ex9.c ex10.c \
                  ex11.c ex12.c  ex14.c ex15.c ex16.c ex17.c ex18.c ex21.c ex22.c \
                  ex23.c ex24.c ex25.c ex28.c ex29.c ex31.c ex33.c ex34.c ex35.c ex36.c
EXAMPLESF       = ex17f.F ex19f.F ex20f.F ex30f.F ex32f.F
MANSEC          = Vec

include ${PETSC_DIR}/conf/variables
include ${PETSC_DIR}/conf/rules

ex1: ex1.o  chkopts 
        -${CLINKER} -o ex1 ex1.o ${PETSC_VEC_LIB}
        ${RM} -f ex1.o

ex2: ex2.o  chkopts
        -${CLINKER} -o ex2 ex2.o  ${PETSC_VEC_LIB}
        ${RM} -f ex2.o

ex3: ex3.o  chkopts
        -${CLINKER} -o ex3 ex3.o  ${PETSC_VEC_LIB}
        ${RM} -f ex3.o

ex4: ex4.o  chkopts
        -${CLINKER} -o ex4 ex4.o  ${PETSC_VEC_LIB}
        ${RM} -f ex4.o

ex5: ex5.o  chkopts
        -${CLINKER} -o ex5 ex5.o  ${PETSC_VEC_LIB}
        ${RM} -f ex5.o

ex6: ex6.o  chkopts
        -${CLINKER} -o ex6 ex6.o  ${PETSC_VEC_LIB}
        ${RM} -f ex6.o

ex7: ex7.o  chkopts
        -${CLINKER} -o ex7 ex7.o  ${PETSC_VEC_LIB}
        ${RM} -f ex7.o

ex8: ex8.o  chkopts
        -${CLINKER} -o ex8 ex8.o  ${PETSC_VEC_LIB}
        ${RM} -f ex8.o

ex9: ex9.o  chkopts
        -${CLINKER} -o ex9 ex9.o  ${PETSC_VEC_LIB}
        ${RM} -f ex9.o

ex10: ex10.o  chkopts
        -${CLINKER} -o ex10 ex10.o  ${PETSC_VEC_LIB}
        ${RM} -f ex10.o

ex11: ex11.o  chkopts
        -${CLINKER} -o ex11 ex11.o  ${PETSC_VEC_LIB}
        ${RM} -f ex11.o

ex12: ex12.o  chkopts
        -${CLINKER} -o ex12 ex12.o  ${PETSC_VEC_LIB}
        ${RM} -f ex12.o

ex13: ex13.o  chkopts
        -${CLINKER} -o ex13 ex13.o  ${PETSC_VEC_LIB}
        ${RM} -f ex13.o

ex14: ex14.o  chkopts
        -${CLINKER} -o ex14 ex14.o  ${PETSC_VEC_LIB}
        ${RM} -f ex14.o

ex15: ex15.o  chkopts
        -${CLINKER} -o ex15 ex15.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex15.o

ex16: ex16.o  chkopts
        -${CLINKER} -o ex16 ex16.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex16.o

ex17: ex17.o  chkopts
        -${CLINKER} -o ex17 ex17.o  ${PETSC_VEC_LIB}
        ${RM} -f ex17.o

ex17f: ex17f.o  chkopts
        -${FLINKER} -o ex17f ex17f.o ${PETSC_VEC_LIB}
        ${RM} -f ex17f.o

ex18: ex18.o  chkopts
        -${CLINKER} -o ex18 ex18.o  ${PETSC_VEC_LIB}
        ${RM} -f ex18.o

ex19f: ex19f.o  chkopts
        -${FLINKER} -o ex19f ex19f.o ${PETSC_VEC_LIB}
        ${RM} -f ex19f.o

ex20f: ex20f.o  chkopts
        -${FLINKER} -o ex20f ex20f.o ${PETSC_VEC_LIB}
        ${RM} -f ex20f.o

ex21: ex21.o  chkopts
        -${CLINKER} -o ex21 ex21.o  ${PETSC_VEC_LIB}
        ${RM} -f ex21.o

ex22: ex22.o  chkopts
        -${CLINKER} -o ex22 ex22.o   ${PETSC_VEC_LIB}
        ${RM} -f ex22.o

ex23: ex23.o  chkopts
        -${CLINKER} -o ex23 ex23.o  ${PETSC_VEC_LIB}
        ${RM} -f ex23.o

ex24: ex24.o chkopts
        -${CLINKER} -o ex24 ex24.o ${PETSC_VEC_LIB} 
        ${RM} -f ex24.o 

ex25: ex25.o chkopts
        -${CLINKER} -o ex25 ex25.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex25.o 

ex26: ex26.o chkopts
        -${CLINKER} -o ex26 ex26.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex26.o 

ex27: ex27.o chkopts
        -${CLINKER} -o ex27 ex27.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex27.o 

ex28: ex28.o chkopts
        -${CLINKER} -o ex28 ex28.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex28.o 

ex29: ex29.o chkopts
        -${CLINKER} -o ex29 ex29.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex29.o 

ex30: ex30.o chkopts
        -${CLINKER} -o ex30 ex30.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex30.o 

ex30f: ex30f.o  chkopts
        -${FLINKER} -o ex30f ex30f.o ${PETSC_VEC_LIB}
        ${RM} -f ex30f.o

ex31: ex31.o chkopts
        -${CLINKER} -o ex31 ex31.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex31.o 

ex32f: ex32f.o chkopts
        -${FLINKER} -o ex32f ex32f.o ${PETSC_VEC_LIB} 
        ${RM} -f ex32f.o 

ex33: ex33.o chkopts
        -${CLINKER} -o ex33 ex33.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex33.o 

ex34: ex34.o chkopts
        -${CLINKER} -o ex34 ex34.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex34.o 

ex35: ex35.o chkopts
        -${CLINKER} -o ex35 ex35.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex35.o 

ex36: ex36.o chkopts
        -${CLINKER} -o ex36 ex36.o  ${PETSC_VEC_LIB} 
        ${RM} -f ex36.o 

#--------------------------------------------------------------------------
runex1:
        -@${MPIEXEC} -n 1  ./ex1 ; \
           ${RM} -f ex1_1.tmp
runex1_2:
        -@${MPIEXEC} -n 2 ./ex1 > ex1_2.tmp 2>&1;\
           if (${DIFF} output/ex1_2.out ex1_2.tmp) then true ;  \
           else echo "Possible problem with ex1_2, diffs above"; fi ;\
           ${RM} -f ex1_2.tmp
runex2:
        -@${MPIEXEC} -n 1  ./ex2 > ex2_1.tmp 2>&1;\
           if (${DIFF} output/ex2_1.out ex2_1.tmp) then true; \
           else echo "Possible problem with ex2_1, diffs above"; fi;\
           ${RM} -f ex2_1.tmp
runex3:
        -@${MPIEXEC} -n 2 ./ex3 > ex3_1.tmp 2>&1;\
           if (${DIFF} output/ex3_1.out ex3_1.tmp) then true; \
           else echo "Possible problem with ex3_1, diffs above"; fi;\
           ${RM} -f ex3_1.tmp
runex4:
        -@${MPIEXEC} -n 2 ./ex4 > ex4_1.tmp 2>&1;\
           if (${DIFF} output/ex4_1.out ex4_1.tmp) then true; \
           else echo "Possible problem with ex4_1, diffs above"; fi;\
           ${RM} -f ex4_1.tmp
runex5:
        -@${MPIEXEC} -n 2 ./ex5 > ex5_1.tmp 2>&1;\
           if (${DIFF} output/ex5_1.out ex5_1.tmp) then true; \
           else echo "Possible problem with ex5_1, diffs above"; fi;\
           ${RM} -f ex5_1.tmp
runex6:
        -@${MPIEXEC} -n 1  ./ex6 > ex6_1.tmp 2>&1;\
           if (${DIFF} output/ex6_1.out ex6_1.tmp) then true; \
           else echo "Possible problem with ex6_1, diffs above"; fi;\
           ${RM} -f ex6_1.tmp
runex7:
        -@${MPIEXEC} -n 1  ./ex7 > ex7_1.tmp 2>&1;\
           if (${DIFF} output/ex7_1.out ex7_1.tmp) then true; \
           else echo "Possible problem with ex7_1, diffs above"; fi;\
           ${RM} -f ex7_1.tmp
runex8:
        -@${MPIEXEC} -n 1  ./ex8 > ex8_1.tmp 2>&1;\
           if (${DIFF} output/ex8_1.out ex8_1.tmp) then true; \
           else echo "Possible problem with ex8_1, diffs above"; fi;\
           ${RM} -f ex8_1.tmp
runex9:
        -@${MPIEXEC}  -n 2 ./ex9 > ex9_1.tmp 2>&1;\
           if (${DIFF} output/ex9_1.out ex9_1.tmp) then true; \
           else echo "Possible problem with ex9_1, diffs above"; fi;\
           ${RM} -f ex9_1.tmp
runex10:
        -@${MPIEXEC}  -n 2 ./ex10 > ex10_1.tmp 2>&1;\
           if (${DIFF} output/ex10_1.out ex10_1.tmp) then true; \
           else echo "Possible problem with ex10_1, diffs above"; fi;\
           ${RM} -f ex10_1.tmp
runex11:
        -@${MPIEXEC}  -n 2 ./ex11 > ex11_1.tmp 2>&1;\
           if (${DIFF} output/ex11_1.out ex11_1.tmp) then true; \
           else echo "Possible problem with ex11_1, diffs above"; fi;\
           ${RM} -f ex11_1.tmp
runex12:
        -@${MPIEXEC}  -n 2 ./ex12 > ex12_1.tmp 2>&1;\
           if (${DIFF} output/ex12_1.out ex12_1.tmp) then true; \
           else echo "Possible problem with ex12_1, diffs above"; fi;\
           ${RM} -f ex12_1.tmp
runex13:
        -@${MPIEXEC}  -n 2 ./ex13 > ex13_1.tmp 2>&1;\
           if (${DIFF} output/ex13_1.out ex13_1.tmp) then true; \
           else echo "Possible problem with ex13_1, diffs above"; fi;\
           ${RM} -f ex13_1.tmp
runex14:
        -@${MPIEXEC}  -n 2 ./ex14 > ex14_1.tmp 2>&1;\
           if (${DIFF} output/ex14_1.out ex14_1.tmp) then true; \
           else echo "Possible problem with ex14_1, diffs above"; fi;\
           ${RM} -f ex14_1.tmp
runex15:
        -@${MPIEXEC}  -n 1 ./ex15 > ex15_1.tmp 2>&1;\
           if (${DIFF} output/ex15_1.out ex15_1.tmp) then true; \
           else echo "Possible problem with ex15_1, diffs above"; fi;\
           ${RM} -f ex15_1.tmp
runex16:
        -@${MPIEXEC} -n 2 ./ex16 > ex16_1.tmp 2>&1;\
           if (${DIFF} output/ex16_1.out ex16_1.tmp) then true; \
           else echo "Possible problem with ex16_1, diffs above"; fi;\
           ${RM} -f ex16_1.tmp
runex17:
        -@${MPIEXEC}  -n 2 ./ex17 > ex17_1.tmp 2>&1;\
           if (${DIFF} output/ex17_1.out ex17_1.tmp) then true; \
           else echo "Possible problem with ex17_1, diffs above"; fi;\
           ${RM} -f ex17_1.tmp
runex17f:
        -@${MPIEXEC}  -n 3 ./ex17f > ex17f_1.tmp 2>&1;\
           if (${DIFF} output/ex17f_1.out ex17f_1.tmp) then true; \
           else echo "Possible problem with ex17f_1, diffs above"; fi;\
           ${RM} -f ex17f_1.tmp
runex18:
        -@${MPIEXEC} -n 1 ./ex18 > ex18_1.tmp 2>&1;\
           if (${DIFF} output/ex18_1.out ex18_1.tmp) then true; \
           else echo "Possible problem with ex18_1, diffs above"; fi;\
           ${RM} -f ex18_1.tmp
runex19f:
        -@${MPIEXEC} -n 1 ./ex19f -n 25 > ex19_1.tmp 2>&1;\
           if (${DIFF} output/ex19_1.out ex19_1.tmp) then true; \
           else echo "Possible problem with ex19f_1, diffs above"; fi;\
           ${RM} -f ex19_1.tmp
runex20f:
        -@${MPIEXEC} -n 1 ./ex20f > ex20_1.tmp 2>&1;\
           if (${DIFF} output/ex20f_1.out ex20_1.tmp) then true; \
           else echo "Possible problem with ex20_1, diffs above"; fi;\
           ${RM} -f ex20_1.tmp vector.dat
runex21:
        -@${MPIEXEC} -n 1 ./ex21 > ex21_1.tmp 2>&1;\
           if (${DIFF} output/ex21_1.out ex21_1.tmp) then true; \
           else echo "Possible problem with ex21_1, diffs above"; fi;\
           ${RM} -f ex21_1.tmp
runex21_2:
        -@${MPIEXEC} -n 2 ./ex21 > ex21_2.tmp 2>&1;\
           if (${DIFF} output/ex21_2.out ex21_2.tmp) then true; \
           else echo "Possible problem with ex21_2, diffs above"; fi;\
           ${RM} -f ex21_2.tmp
runex22:
        -@${MPIEXEC} -n 4 ./ex22 > ex22_1.tmp 2>&1;\
           if (${DIFF} output/ex22_1.out ex22_1.tmp) then true; \
           else echo "Possible problem with ex22_1, diffs above"; fi;\
           ${RM} -f ex22_1.tmp
runex23:
        -@${MPIEXEC} -n 2 ./ex23 > ex23_1.tmp 2>&1;\
           if (${DIFF} output/ex23_1.out ex23_1.tmp) then true; \
           else echo "Possible problem with ex23_1, diffs above"; fi;\
           ${RM} -f ex23_1.tmp input.dat
runex24:
        -@${MPIEXEC} -n 3 ./ex24 > ex24_1.tmp 2>&1;\
           if (${DIFF} output/ex24_1.out ex24_1.tmp) then true; \
           else echo "Possible problem with ex24_1, diffs above"; fi;\
           ${RM} -f ex24_1.tmp input.dat
runex25:
        -@${MPIEXEC} -n 3 ./ex25 > ex25_1.tmp 2>&1;\
           if (${DIFF} output/ex25_1.out ex25_1.tmp) then true; \
           else echo "Possible problem with ex25_1, diffs above"; fi;\
           ${RM} -f ex25_1.tmp
runex26:
        -@${MPIEXEC} -n 4 ./ex26 > ex26_1.tmp 2>&1;\
           if (${DIFF} output/ex26_1.out ex26_1.tmp) then true; \
           else echo "Possible problem with ex26_1, diffs above"; fi;\
           ${RM} -f ex26_1.tmp
runex28:
        -@${MPIEXEC} -n 3 ./ex28
runex29:
        -@${MPIEXEC} -n 3 ./ex29 -n 126 > ex29_1.tmp 2>&1;\
           if (${DIFF} output/ex29_1.out ex29_1.tmp) then true; \
           else echo "Possible problem with ex29_1, diffs above"; fi;\
           ${RM} -f ex29_1.tmp
runex30f:
        -@${MPIEXEC}  -n 4 ./ex30f > ex30f_1.tmp 2>&1;\
           if (${DIFF} output/ex30f_1.out ex30f_1.tmp) then true; \
           else echo "Possible problem with ex30f_1, diffs above"; fi;\
           ${RM} -f ex30f_1.tmp
runex32f:
        -@${MPIEXEC}  -n 1 ./ex32f > ex32f_1.tmp 2>&1;\
           if (${DIFF} output/ex32f_1.out ex32f_1.tmp) then true; \
           else echo "Possible problem with ex32f_1, diffs above"; fi;\
           ${RM} -f ex32f_1.tmp
runex33:
        -@${MPIEXEC} -n 4 ./ex33 > ex33_1.tmp 2>&1;\
           if (${DIFF} output/ex33_1.out ex33_1.tmp) then true; \
           else echo "Possible problem with ex33_1, diffs above"; fi;\
           ${RM} -f ex33_1.tmp
runex34:
        -@${MPIEXEC} -n 1  ./ex34 > ex34_1.tmp 2>&1;
        -@cat ex34_1.tmp | sed s/e-00/e+00/g | awk '{ $$1=""; if (v!="") { if (v!=$$0) {print "  orig <" v "> \n  cached <" $$0 ">"}; v=""} else {v=$$0} }' > ex34_1.dif
        -@if [ ` cat ex34_1.dif | wc -l ` -gt 0 ] ; then \
            echo "Possible problem with ex34_1:"; cat ex34_1.dif; fi; \
           ${RM} -f ex34_1.tmp ex34_1.dif
runex35:
        -@${MPIEXEC} -n 1 ./ex35 > ex35_1.tmp 2>&1;\
           if (${DIFF} output/ex35_1.out ex35_1.tmp) then true; \
           else echo "Possible problem with ex35_1, diffs above"; fi;\
           ${RM} -f ex35_1.tmp
runex36:
        -@${MPIEXEC} -n 2 ./ex36 -set_option_negidx -set_values_negidx -get_values_negidx > ex36_1.tmp 2>&1;\
           if (${DIFF} output/ex36_1.out ex36_1.tmp) then true; \
           else echo "Possible problem with ex36_1, diffs above"; fi;\
           ${RM} -f ex36_1.tmp

TESTEXAMPLES_C                    = ex1.PETSc runex1 ex1.rm ex2.PETSc runex2 ex2.rm ex3.PETSc runex3 ex3.rm \
                              ex4.PETSc runex4 ex4.rm ex5.PETSc ex5.rm ex6.PETSc runex6 ex6.rm ex7.PETSc \
                              runex7 ex7.rm ex8.PETSc runex8 ex8.rm ex9.PETSc runex9 ex9.rm ex11.PETSc runex11 \
                              ex11.rm ex12.PETSc runex12 ex12.rm  ex14.PETSc runex14 \
                              ex14.rm ex15.PETSc runex15 ex15.rm ex16.PETSc runex16 ex16.rm ex17.PETSc runex17 \
                              ex17.rm ex21.PETSc runex21 runex21_2 ex21.rm ex25.PETSc runex25 ex25.rm ex29.PETSc \
                              runex29 ex29.rm ex34.PETSc runex34 ex34.rm ex36.PETSc runex36 ex36.rm
TESTEXAMPLES_C_X11            = ex10.PETSc runex10 ex10.rm ex22.PETSc runex22 ex22.rm ex23.PETSc runex23 ex23.rm \
                              ex24.PETSc runex24 ex24.rm ex28.PETSc runex28 ex28.rm ex33.PETSc runex33 ex33.rm
TESTEXAMPLES_FORTRAN            = ex17f.PETSc runex17f ex17f.rm ex19f.PETSc ex19f.rm ex20f.PETSc ex20f.rm ex30f.PETSc \
                              runex30f ex30f.rm 
TESTEXAMPLES_FORTRAN_NOCOMPLEX = ex32f.PETSc runex32f ex32f.rm
TESTEXAMPLES_FORTRAN_MPIUNI = ex19f.PETSc runex19f ex19f.rm 
TESTEXAMPLES_C_X11_MPIUNI   = ex2.PETSc runex2 ex2.rm ex4.PETSc ex4.rm ex6.PETSc runex6 ex6.rm ex7.PETSc runex7 \
                              ex7.rm ex8.PETSc runex8 ex8.rm ex14.PETSc ex14.rm 

include ${PETSC_DIR}/conf/test