xref: /petsc/makefile (revision c3a89c15c66be42c1ea3c2eab6faebba95f76ffa)
1753a1a87SJed Brown#
2753a1a87SJed Brown# This is the makefile for compiling PETSc. See
3753a1a87SJed Brown# http://www.mcs.anl.gov/petsc/documentation/installation.html for directions on installing PETSc.
4753a1a87SJed Brown# See also conf for additional commands.
5753a1a87SJed Brown#
6753a1a87SJed BrownALL: all
7753a1a87SJed BrownLOCDIR	 = ./
8e5c64ceaSJed BrownDIRS	 = src include tutorials interfaces
9753a1a87SJed BrownCFLAGS	 =
10753a1a87SJed BrownFFLAGS	 =
11d4f3a1abSSatish BalayCPPFLAGS =
12d4f3a1abSSatish BalayFPPFLAGS =
13753a1a87SJed Brown
14753a1a87SJed Brown# next line defines PETSC_DIR and PETSC_ARCH if they are not set
15af0996ceSBarry Smithinclude ././${PETSC_ARCH}/lib/petsc/conf/petscvariables
16af0996ceSBarry Smithinclude ${PETSC_DIR}/lib/petsc/conf/variables
17af0996ceSBarry Smithinclude ${PETSC_DIR}/lib/petsc/conf/rules
18af0996ceSBarry Smithinclude ${PETSC_DIR}/lib/petsc/conf/test
19753a1a87SJed Brown
20753a1a87SJed Brown#
21753a1a87SJed Brown# Basic targets to build PETSc libraries.
22753a1a87SJed Brown# all: builds the c, fortran, and f90 libraries
234a18a678SSatish Balayall: chk_makej
24af0996ceSBarry Smith	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} chk_petscdir chk_upgrade | tee ${PETSC_ARCH}/lib/petsc/conf/make.log
25af0996ceSBarry Smith	@ln -sf ${PETSC_ARCH}/lib/petsc/conf/make.log make.log
26ac1d0f13SJed Brown	@if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \
27af0996ceSBarry Smith	   ${OMAKE_PRINTDIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-gnumake-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \
289481793eSSatish Balay	elif [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \
29af0996ceSBarry Smith	   ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-cmake-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log \
30753a1a87SJed Brown		| egrep -v '( --check-build-system |cmake -E | -o CMakeFiles/petsc[[:lower:]]*.dir/| -o lib/libpetsc|CMakeFiles/petsc[[:lower:]]*\.dir/(build|depend|requires)|-f CMakeFiles/Makefile2|Dependee .* is newer than depender |provides\.build. is up to date)'; \
31753a1a87SJed Brown	 else \
32af0996ceSBarry Smith	   ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-legacy-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log \
33753a1a87SJed Brown                | ${GREP} -v "has no symbols"; \
34753a1a87SJed Brown	 fi
35af0996ceSBarry Smith	@egrep -i "( error | error: |no such file or directory)" ${PETSC_ARCH}/lib/petsc/conf/make.log | tee ${PETSC_ARCH}/lib/petsc/conf/error.log > /dev/null
36af0996ceSBarry Smith	@if test -s ${PETSC_ARCH}/lib/petsc/conf/error.log; then \
37af0996ceSBarry Smith           printf ${PETSC_TEXT_HILIGHT}"**************************ERROR*************************************\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \
38af0996ceSBarry Smith           echo "  Error during compile, check ${PETSC_ARCH}/lib/petsc/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \
39af0996ceSBarry Smith           echo "  Send it and ${PETSC_ARCH}/lib/petsc/conf/configure.log to petsc-maint@mcs.anl.gov" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
40af0996ceSBarry Smith           printf "********************************************************************"${PETSC_TEXT_NORMAL}"\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
41753a1a87SJed Brown	 else \
42af0996ceSBarry Smith	  ${OMAKE} shared_install PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log ;\
43753a1a87SJed Brown        fi #solaris make likes to print the whole command that gave error. So split this up into the smallest chunk below
44af0996ceSBarry Smith	@echo "Finishing at: `date`" >> ${PETSC_ARCH}/lib/petsc/conf/make.log
45af0996ceSBarry Smith	@if test -s ${PETSC_ARCH}/lib/petsc/conf/error.log; then exit 1; fi
46753a1a87SJed Brown
479481793eSSatish Balayall-gnumake:
48ac1d0f13SJed Brown	@if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \
49227c2ee5SSatish Balay          ${OMAKE_PRINTDIR}  PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} PETSC_BUILD_USING_CMAKE="" all;\
509481793eSSatish Balay        else printf ${PETSC_TEXT_HILIGHT}"Build not configured for GNUMAKE. Quiting"${PETSC_TEXT_NORMAL}"\n"; exit 1; fi
519481793eSSatish Balay
524252f254SSatish Balayall-cmake:
534252f254SSatish Balay	@if [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \
54ac1d0f13SJed Brown          ${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} MAKE_IS_GNUMAKE="" all;\
555484e79dSBarry Smith        else printf ${PETSC_TEXT_HILIGHT}"Build not configured for CMAKE. Quiting"${PETSC_TEXT_NORMAL}"\n"; exit 1; fi
56753a1a87SJed Brown
574252f254SSatish Balayall-legacy:
58ac1d0f13SJed Brown	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} PETSC_BUILD_USING_CMAKE="" MAKE_IS_GNUMAKE="" all
599481793eSSatish Balay
6050a4861cSBarry Smithall-gnumake-local: chk_makej info gnumake matlabbin mpi4py-build petsc4py-build libmesh-build slepc-build
614252f254SSatish Balay
62f55f1886SBarry Smithall-cmake-local: chk_makej info cmakegen cmake matlabbin mpi4py-build petsc4py-build
634252f254SSatish Balay
64f55f1886SBarry Smithall-legacy-local: chk_makej chklib_dir info deletelibs deletemods build matlabbin shared_nomesg mpi4py-build petsc4py-build
65753a1a87SJed Brown#
66753a1a87SJed Brown# Prints information about the system and version of PETSc being compiled
67753a1a87SJed Brown#
684a18a678SSatish Balayinfo: chk_makej
69753a1a87SJed Brown	-@echo "=========================================="
70753a1a87SJed Brown	-@echo " "
71753a1a87SJed Brown	-@echo "See documentation/faq.html and documentation/bugreporting.html"
72753a1a87SJed Brown	-@echo "for help with installation problems.  Please send EVERYTHING"
73bc10b077SJed Brown	-@echo "printed out below when reporting problems.  Please check the"
74bc10b077SJed Brown	-@echo "mailing list archives and consider subscribing."
75753a1a87SJed Brown	-@echo " "
76bc10b077SJed Brown	-@echo "  http://www.mcs.anl.gov/petsc/miscellaneous/mailing-lists.html"
77753a1a87SJed Brown	-@echo " "
78753a1a87SJed Brown	-@echo "=========================================="
7944d0de36SSatish Balay	-@echo Starting on `hostname` at `date`
80753a1a87SJed Brown	-@echo Machine characteristics: `uname -a`
81753a1a87SJed Brown	-@echo "-----------------------------------------"
82753a1a87SJed Brown	-@echo "Using PETSc directory: ${PETSC_DIR}"
83753a1a87SJed Brown	-@echo "Using PETSc arch: ${PETSC_ARCH}"
84753a1a87SJed Brown	-@echo "-----------------------------------------"
85753a1a87SJed Brown	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
86753a1a87SJed Brown	-@echo "-----------------------------------------"
87753a1a87SJed Brown	-@echo "Using configure Options: ${CONFIGURE_OPTIONS}"
88753a1a87SJed Brown	-@echo "Using configuration flags:"
897cab4194SSatish Balay	-@grep "\#define " ${PETSCCONF_H}
90753a1a87SJed Brown	-@echo "-----------------------------------------"
91da0b7683SSatish Balay	-@echo "Using C/C++ compile: ${PETSC_COMPILE}"
92607e78e0SSatish Balay	-@if [ "${PETSC_LANGUAGE}" = "CONLY" -a "${MPICC_SHOW}" != "" ]; then \
93fd0cdb26SSatish Balay             printf  "mpicc -show: %b\n" "${MPICC_SHOW}"; \
94607e78e0SSatish Balay	  elif [ "${PETSC_LANGUAGE}" = "CXXONLY" -a "${MPICXX_SHOW}" != "" ]; then \
95fd0cdb26SSatish Balay             printf "mpicxx -show: %b\n" "${MPICXX_SHOW}"; \
96607e78e0SSatish Balay          fi;
97753a1a87SJed Brown	-@if [ "${FC}" != "" ]; then \
98da0b7683SSatish Balay	   echo "Using Fortran compile: ${PETSC_FCOMPILE}";\
99607e78e0SSatish Balay           if [ "${MPIFC_SHOW}" != "" ]; then \
100fd0cdb26SSatish Balay             printf "mpif90 -show: %b\n" "${MPIFC_SHOW}"; \
101607e78e0SSatish Balay           fi; \
102da0b7683SSatish Balay         fi
103da0b7683SSatish Balay	-@if [ "${CUDAC}" != "" ]; then \
104da0b7683SSatish Balay	   echo "Using CUDA compile: ${PETSC_CUCOMPILE}";\
105753a1a87SJed Brown         fi
106753a1a87SJed Brown	-@echo "-----------------------------------------"
107753a1a87SJed Brown	-@echo "Using C/C++ linker: ${PCC_LINKER}"
108753a1a87SJed Brown	-@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}"
109753a1a87SJed Brown	-@if [ "${FC}" != "" ]; then \
110753a1a87SJed Brown	   echo "Using Fortran linker: ${FC_LINKER}";\
111753a1a87SJed Brown	   echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\
112753a1a87SJed Brown         fi
113753a1a87SJed Brown	-@echo "-----------------------------------------"
1141d2d58a3SSatish Balay	-@echo "Using system modules: ${LOADEDMODULES}"
115ac8fb971SBarry Smith	-@echo Using mpi.h: `echo '#include <mpi.h>' > ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/mpitest.c; ${CPP} ${PETSC_CCPPFLAGS} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/mpitest.c |grep 'mpi\.h' |  ( head -1 ; cat > /dev/null )`
1161d2d58a3SSatish Balay	-@echo "-----------------------------------------"
117753a1a87SJed Brown	-@echo "Using libraries: ${PETSC_LIB}"
118753a1a87SJed Brown	-@echo "------------------------------------------"
119753a1a87SJed Brown	-@echo "Using mpiexec: ${MPIEXEC}"
120753a1a87SJed Brown	-@echo "=========================================="
121753a1a87SJed Brown
122753a1a87SJed Brown#
123753a1a87SJed Brown# Builds the PETSc libraries
124753a1a87SJed Brown# This target also builds fortran77 and f90 interface
125753a1a87SJed Brown# files and compiles .F files
126753a1a87SJed Brown#
1274a18a678SSatish Balaybuild: chk_makej
128753a1a87SJed Brown	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
129753a1a87SJed Brown	-@echo "========================================="
130753a1a87SJed Brown	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
131753a1a87SJed Brown	-@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}  > tmpf 2>&1 ; ${GREP} -v "has no symbols" tmpf; ${RM} tmpf;
132753a1a87SJed Brown	-@echo "Completed building libraries"
133753a1a87SJed Brown	-@echo "========================================="
134753a1a87SJed Brown#
135d2b3add8SSatish Balay# Build MatLab binaries
136d2b3add8SSatish Balay#
137d2b3add8SSatish Balaymatlabbin:
13826e98103SSatish Balay	-@if [ "${MATLAB_MEX}" != "" -a "${PETSC_SCALAR}" = "real" -a "${PETSC_PRECISION}" = "double" ]; then \
139d2b3add8SSatish Balay          echo "BEGINNING TO COMPILE MATLAB INTERFACE"; \
140d2b3add8SSatish Balay            if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc" ] ; then ${MKDIR}  ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc; fi; \
141d2b3add8SSatish Balay            if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab" ] ; then ${MKDIR}  ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab; fi; \
142d2b3add8SSatish Balay            cd src/sys/classes/viewer/impls/socket/matlab && ${OMAKE} matlabcodes PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR}; \
143d2b3add8SSatish Balay            echo "========================================="; \
144d2b3add8SSatish Balay        fi
145753a1a87SJed Brown#
146753a1a87SJed Brown# Builds PETSc test examples for a given architecture
147753a1a87SJed Brown#
1483cfc63a1SBarry Smithtest_install: test
14956879a31SBarry Smithcheck: test
150753a1a87SJed Browntest:
151de3d9997SSatish Balay	-@${OMAKE} PATH="${PETSC_DIR}/${PETSC_ARCH}/lib:${PATH}" PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} test_build 2>&1 | tee ./${PETSC_ARCH}/lib/petsc/conf/test.log
1525f6f18d4SSatish Balay	-@if [ "${PETSC_WITH_BATCH}" = "" ]; then \
1535f6f18d4SSatish Balay          printf "=========================================\n"; \
1545f6f18d4SSatish Balay          printf "Now to evaluate the computer systems you plan use - do:\n"; \
155dc32dc79SSatish Balay          printf "make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} streams\n"; \
1565f6f18d4SSatish Balay        fi
157753a1a87SJed Browntestx:
158af0996ceSBarry Smith	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testx_build 2>&1 | tee ./${PETSC_ARCH}/lib/petsc/conf/testx.log
159753a1a87SJed Browntest_build:
160753a1a87SJed Brown	-@echo "Running test examples to verify correct installation"
161753a1a87SJed Brown	-@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}"
162227c2ee5SSatish Balay	@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} clean
163227c2ee5SSatish Balay	@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex19
164e5d08945SBarry Smith	@if [ "${HYPRE_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \
165*c3a89c15SBarry Smith          cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} DIFF=${PETSC_DIR}/lib/petsc/bin/petscdiff runex19_hypre; \
166e5d08945SBarry Smith         fi;
167e5d08945SBarry Smith	@if [ "${MUMPS_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \
168*c3a89c15SBarry Smith          cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR}  DIFF=${PETSC_DIR}/lib/petsc/bin/petscdiff runex19_fieldsplit_mumps; \
169e5d08945SBarry Smith         fi;
170e5d08945SBarry Smith	@if [ "${SUPERLU_DIST_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \
171*c3a89c15SBarry Smith          cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR}  DIFF=${PETSC_DIR}/lib/petsc/bin/petscdiff runex19_superlu_dist; \
172e5d08945SBarry Smith         fi;
173e5d08945SBarry Smith	@if ( [ "${ML_LIB}" != "" ] ||  [ "${TRILINOS_LIB}" != "" ] ) && [ "${PETSC_WITH_BATCH}" = "" ]; then \
174*c3a89c15SBarry Smith          cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR}  DIFF=${PETSC_DIR}/lib/petsc/bin/petscdiff runex19_ml; \
175e5d08945SBarry Smith         fi;
176e5d08945SBarry Smith	@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ex19.rm
1775061939cSBarry Smith	@if [ "${PETSC4PY}" = "yes" ]; then \
1789c049d36SBarry Smith          cd src/ksp/ksp/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex100; \
1795061939cSBarry Smith         fi;
1807cab4194SSatish Balay	@egrep "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \
181cb297985SSatish Balay         if test -s .ftn.log; then \
182cb297985SSatish Balay          cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex5f; \
183cb297985SSatish Balay         fi; ${RM} .ftn.log;
184227c2ee5SSatish Balay	@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} clean
185753a1a87SJed Brown	-@echo "Completed test examples"
186753a1a87SJed Browntestx_build:
187753a1a87SJed Brown	-@echo "Running graphics test example to verify correct X11 installation"
188753a1a87SJed Brown	-@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}"
189227c2ee5SSatish Balay	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} clean
190227c2ee5SSatish Balay	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testxex19
191227c2ee5SSatish Balay	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} clean
192753a1a87SJed Brown	-@echo "Completed graphics test example"
193753a1a87SJed Brown
194753a1a87SJed Browntestexamples: info
195753a1a87SJed Brown	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
196753a1a87SJed Brown	-@echo "Due to different numerical round-off on certain"
197753a1a87SJed Brown	-@echo "machines some of the numbers may not match exactly."
198753a1a87SJed Brown	-@echo "========================================="
199753a1a87SJed Brown	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C  tree
200753a1a87SJed Brown	-@echo "Completed compiling and running test examples"
201753a1a87SJed Brown	-@echo "========================================="
202753a1a87SJed Browntestfortran: info
203753a1a87SJed Brown	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
204753a1a87SJed Brown	-@echo "========================================="
205753a1a87SJed Brown	-@echo "Due to different numerical round-off on certain"
206753a1a87SJed Brown	-@echo "machines or the way Fortran formats numbers"
207753a1a87SJed Brown	-@echo "some of the results may not match exactly."
208753a1a87SJed Brown	-@echo "========================================="
209753a1a87SJed Brown	-@if [ "${FC}" != "" ]; then \
210753a1a87SJed Brown            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran tree; \
211753a1a87SJed Brown            echo "Completed compiling and running Fortran test examples"; \
212753a1a87SJed Brown          else \
213753a1a87SJed Brown            echo "Error: No FORTRAN compiler available"; \
214753a1a87SJed Brown          fi
215753a1a87SJed Brown	-@echo "========================================="
216753a1a87SJed Browntestexamples_uni: info
217753a1a87SJed Brown	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
218753a1a87SJed Brown	-@echo "Due to different numerical round-off on certain"
219753a1a87SJed Brown	-@echo "machines some of the numbers may not match exactly."
220753a1a87SJed Brown	-@echo "========================================="
221753a1a87SJed Brown	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C_X_MPIUni  tree
222753a1a87SJed Brown	-@echo "Completed compiling and running uniprocessor test examples"
223753a1a87SJed Brown	-@echo "========================================="
224753a1a87SJed Browntestfortran_uni: info
225753a1a87SJed Brown	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
226753a1a87SJed Brown	-@echo "Due to different numerical round-off on certain"
227753a1a87SJed Brown	-@echo "machines some of the numbers may not match exactly."
228753a1a87SJed Brown	-@echo "========================================="
229753a1a87SJed Brown	-@if [ "${FC}" != "" ]; then \
230753a1a87SJed Brown            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni  tree; \
231753a1a87SJed Brown            echo "Completed compiling and running uniprocessor fortran test examples"; \
232753a1a87SJed Brown          else \
233753a1a87SJed Brown            echo "Error: No FORTRAN compiler available"; \
234753a1a87SJed Brown          fi
235753a1a87SJed Brown	-@
236753a1a87SJed Brown	-@echo "========================================="
237753a1a87SJed Brown
238753a1a87SJed Brown# Ranlib on the libraries
239753a1a87SJed Brownranlib:
240753a1a87SJed Brown	${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}
241753a1a87SJed Brown
242753a1a87SJed Brown# Deletes PETSc libraries
2434a18a678SSatish Balaydeletelibs: chk_makej
244753a1a87SJed Brown	-${RM} -rf ${PETSC_LIB_DIR}/libpetsc*.*
2454a18a678SSatish Balaydeletemods: chk_makej
246753a1a87SJed Brown	-${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod
247753a1a87SJed Brown
248753a1a87SJed Brown# Cleans up build
24958080eacSSatish Balayallclean-legacy: deletelibs deletemods
25059d63732SSatish Balay	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean-legacy tree
25158080eacSSatish Balayallclean-cmake:
25258080eacSSatish Balay	-@cd ${PETSC_ARCH} && ${OMAKE} clean
25358080eacSSatish Balayallclean-gnumake:
25458080eacSSatish Balay	-@${OMAKE} -f gmakefile clean
25558080eacSSatish Balay
25658080eacSSatish Balayallclean:
25758080eacSSatish Balay	@if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \
25858080eacSSatish Balay	   ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-gnumake; \
25958080eacSSatish Balay	elif [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \
26058080eacSSatish Balay	   ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-cmake; \
26158080eacSSatish Balay	else \
26258080eacSSatish Balay	   ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-legacy; \
26358080eacSSatish Balay	fi
26459d63732SSatish Balay
26559d63732SSatish Balayclean:: allclean
26659d63732SSatish Balay
26759d63732SSatish Balaydistclean: chk_petscdir
268af0996ceSBarry Smith	@if [ -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ]; then \
269af0996ceSBarry Smith	  echo "*** Preserving ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py in ${PETSC_DIR} ***"; \
270af0996ceSBarry Smith          mv -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ${PETSC_DIR}/; fi
27159d63732SSatish Balay	@echo "*** Deleting all build files in ${PETSC_DIR}/${PETSC_ARCH} ***"
27259d63732SSatish Balay	-${RM} -rf ${PETSC_DIR}/${PETSC_ARCH}/
27359d63732SSatish Balay
27459d63732SSatish Balay
275753a1a87SJed Brown#
276753a1a87SJed Brownreconfigure:
277af0996ceSBarry Smith	@${PYTHON} ${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py
278753a1a87SJed Brown#
279753a1a87SJed Browninstall:
2800ee81e68SLisandro Dalcin	@${PYTHON} ./config/install.py -destDir=${DESTDIR}
28150a4861cSBarry Smith	${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} mpi4py-install petsc4py-install libmesh-install slepc-install
282753a1a87SJed Brown
283753a1a87SJed Brownnewall:
284753a1a87SJed Brown	-@cd src/sys;  @${PYTHON} ${PETSC_DIR}/config/builder.py
285753a1a87SJed Brown	-@cd src/vec;  @${PYTHON} ${PETSC_DIR}/config/builder.py
286753a1a87SJed Brown	-@cd src/mat;  @${PYTHON} ${PETSC_DIR}/config/builder.py
287753a1a87SJed Brown	-@cd src/dm;   @${PYTHON} ${PETSC_DIR}/config/builder.py
288753a1a87SJed Brown	-@cd src/ksp;  @${PYTHON} ${PETSC_DIR}/config/builder.py
289753a1a87SJed Brown	-@cd src/snes; @${PYTHON} ${PETSC_DIR}/config/builder.py
290753a1a87SJed Brown	-@cd src/ts;   @${PYTHON} ${PETSC_DIR}/config/builder.py
291753a1a87SJed Brown
292753a1a87SJed Brownstreams:
293bfc31b0fSJed Brown	cd src/benchmarks/streams; ${OMAKE} PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} streams
2945fabf859SBarry Smith
2955fabf859SBarry Smithstream:
296bfc31b0fSJed Brown	cd src/benchmarks/streams; ${OMAKE} PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} stream
297753a1a87SJed Brown# ------------------------------------------------------------------
298753a1a87SJed Brown#
299753a1a87SJed Brown# All remaining actions are intended for PETSc developers only.
300753a1a87SJed Brown# PETSc users should not generally need to use these commands.
301753a1a87SJed Brown#
302753a1a87SJed Brown#  See the users manual for how the tags files may be used from Emacs and Vi/Vim
303753a1a87SJed Brown#
304753a1a87SJed Brownalletags:
305*c3a89c15SBarry Smith	-@${PYTHON} lib/petsc/bin/maint/generateetags.py
306753a1a87SJed Brown	-@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON
307753a1a87SJed Brown
308762ef373SBarry Smith# obtain gtags from http://www.gnu.org/s/global/
309762ef373SBarry Smithallgtags:
310a4ae4b6dSToby Isaac	-@find ${PETSC_DIR}/include ${PETSC_DIR}/src ${PETSC_DIR}/bin -regex '\(.*makefile\|.*\.\(cc\|hh\|cpp\|C\|hpp\|c\|h\|cu\|m\)$$\)' | grep -v ftn-auto  | gtags -f -
311762ef373SBarry Smith
312753a1a87SJed Brownallfortranstubs:
3131b266c99SBarry Smith	-@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir
314*c3a89c15SBarry Smith	@${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py ${BFORT}  ${VERBOSE}
315*c3a89c15SBarry Smith	-@${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py -merge  ${VERBOSE}
316a318115bSBarry Smith	-@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir
317753a1a87SJed Browndeletefortranstubs:
318753a1a87SJed Brown	-@find . -type d -name ftn-auto | xargs rm -rf
319753a1a87SJed Browncmakegen:
320753a1a87SJed Brown	-@${PYTHON} config/cmakegen.py
321753a1a87SJed Brown#
322753a1a87SJed Brown# These are here for the target allci and allco, and etags
323753a1a87SJed Brown#
324753a1a87SJed Brown
325bcaeba4dSBarry SmithBMAKEFILES = conf/variables conf/rules conf/test
326*c3a89c15SBarry SmithSCRIPTS    = lib/petsc/bin/maint/builddist  lib/petsc/bin/maint/wwwman lib/petsc/bin/maint/xclude lib/petsc/bin/maint/bugReport.py lib/petsc/bin/maint/buildconfigtest lib/petsc/bin/maint/builddistlite \
327*c3a89c15SBarry Smith             lib/petsc/bin/maint/buildtest lib/petsc/bin/maint/checkBuilds.py lib/petsc/bin/maint/copylognightly lib/petsc/bin/maint/copylognightly.tao lib/petsc/bin/maint/countfiles lib/petsc/bin/maint/findbadfiles \
328*c3a89c15SBarry Smith             lib/petsc/bin/maint/fixinclude lib/petsc/bin/maint/getexlist lib/petsc/bin/maint/getpdflabels.py lib/petsc/bin/maint/helpindex.py lib/petsc/bin/maint/hosts.local lib/petsc/bin/maint/hosts.solaris  \
329*c3a89c15SBarry Smith             lib/petsc/bin/maint/lex.py  lib/petsc/bin/maint/mapnameslatex.py lib/petsc/bin/maint/startnightly lib/petsc/bin/maint/startnightly.tao lib/petsc/bin/maint/submitPatch.py \
330*c3a89c15SBarry Smith             lib/petsc/bin/maint/update-docs.py  lib/petsc/bin/maint/wwwindex.py lib/petsc/bin/maint/xcludebackup lib/petsc/bin/maint/xcludecblas lib/petsc/bin/maint/zap lib/petsc/bin/maint/zapall \
331753a1a87SJed Brown             config/PETSc/Configure.py config/PETSc/Options.py \
33206e08bc7SBarry Smith             config/PETSc/utilities/*.py
333753a1a87SJed Brown
334753a1a87SJed Brown
335753a1a87SJed Brown# Builds all the documentation - should be done every night
336f4da3331SVáclav Haplaalldoc: allcite allpdf alldoc1 alldoc2 alldoc3 docsetdate
337753a1a87SJed Brown
338f4da3331SVáclav Hapla# Build just citations
339f4da3331SVáclav Haplaallcite: chk_loc deletemanualpages
340*c3a89c15SBarry Smith	-${PYTHON} lib/petsc/bin/maint/countpetsccits.py
341753a1a87SJed Brown	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
342753a1a87SJed Brown	-@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap
343753a1a87SJed Brown	-@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap
344f4da3331SVáclav Hapla
345f4da3331SVáclav Hapla# Build just PDF manuals + prerequisites
346f4da3331SVáclav Haplaallpdf: chk_loc allcite
347753a1a87SJed Brown	-cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC}
348753a1a87SJed Brown	-cd src/docs/tex/manual; ${OMAKE} developers.pdf LOC=${LOC}
349f5b986e4SVáclav Hapla	-cd src/docs/tao_tex/manual; ${OMAKE} manual.pdf LOC=${LOC}
350f4da3331SVáclav Hapla
351f4da3331SVáclav Hapla# Build just manual pages + prerequisites
352f4da3331SVáclav Haplaallmanpages: chk_loc allcite
353753a1a87SJed Brown	-${OMAKE} ACTION=manualpages tree_basic LOC=${LOC}
354f4da3331SVáclav Hapla
355f4da3331SVáclav Hapla# Build just manual examples + prerequisites
356f4da3331SVáclav Haplaallmanexamples: chk_loc allmanpages
357753a1a87SJed Brown	-${OMAKE} ACTION=manexamples tree_basic LOC=${LOC}
358f4da3331SVáclav Hapla
359f4da3331SVáclav Hapla# Build everything that goes into 'doc' dir except html sources
360f4da3331SVáclav Haplaalldoc1: chk_loc chk_concepts_dir allcite allmanpages allmanexamples
36121fcc2ddSBarry Smith	-${OMAKE} manimplementations LOC=${LOC}
362*c3a89c15SBarry Smith	-${PYTHON} lib/petsc/bin/maint/wwwindex.py ${PETSC_DIR} ${LOC}
363753a1a87SJed Brown	-${OMAKE} manconcepts LOC=${LOC}
364753a1a87SJed Brown	-${OMAKE} ACTION=getexlist tree_basic LOC=${LOC}
365753a1a87SJed Brown	-${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC}
366*c3a89c15SBarry Smith	-${PYTHON} lib/petsc/bin/maint/helpindex.py ${PETSC_DIR} ${LOC}
367753a1a87SJed Brown
368753a1a87SJed Brown# Builds .html versions of the source
369753a1a87SJed Brown# html overwrites some stuff created by update-docs - hence this is done later.
370753a1a87SJed Brownalldoc2: chk_loc
3717070facaSSatish Balay	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC}
372*c3a89c15SBarry Smith	-${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC}
373753a1a87SJed Brown#
374753a1a87SJed Brown# Builds HTML versions of Matlab scripts
375753a1a87SJed Brownalldoc3: chk_loc
376753a1a87SJed Brown	if  [ "${MATLAB_COMMAND}" != "" ]; then\
377502b79f1SSatish Balay          export MATLABPATH=${MATLABPATH}:${PETSC_DIR}/share/petsc/matlab; \
378502b79f1SSatish Balay          cd ${PETSC_DIR}/share/petsc/matlab; ${MATLAB_COMMAND} -nodisplay -nodesktop -r "generatehtml;exit" ; \
379753a1a87SJed Brown        fi
380753a1a87SJed Brown
381d9dc08c3SBarry Smith#
382d9dc08c3SBarry Smith# Makes links for all manual pages in $LOC/docs/manualpages/all
383d9dc08c3SBarry Smithallman:
384d9dc08c3SBarry Smith	@cd ${LOC}/docs/manualpages; rm -rf all ; mkdir all ; find *  -type d -wholename all -prune -o -name index.html -prune  -o -type f -name \*.html -exec ln -s  -f ../{} all \;
385d9dc08c3SBarry Smith
386de86d973SSatish BalayDOCSETDATE_PRUNE_LIST=-o -type f -wholename share/petsc/saws/linearsolveroptions.html -prune -o -type f -wholename tutorials/HandsOnExercise.html -prune -o -type f -wholename tutorials/TAOHandsOnExercise.html -prune
387f304b780SSatish Balay
388753a1a87SJed Brown# modify all generated html files and add in version number, date, canonical URL info.
389ad5c76d5SBarry Smithdocsetdate: chk_petscdir
390753a1a87SJed Brown	@echo "Updating generated html files with petsc version, date, canonical URL info";\
391753a1a87SJed Brown        version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
392753a1a87SJed Brown        version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
393753a1a87SJed Brown        version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
394e4643290SSatish Balay        version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
395753a1a87SJed Brown        if  [ $${version_release} = 0 ]; then \
396cc5a9e26SSatish Balay          petscversion=petsc-master; \
397753a1a87SJed Brown          export petscversion; \
398753a1a87SJed Brown        elif [ $${version_release} = 1 ]; then \
399e4643290SSatish Balay          petscversion=petsc-$${version_major}.$${version_minor}.$${version_subminor}; \
400753a1a87SJed Brown          export petscversion; \
401753a1a87SJed Brown        else \
402753a1a87SJed Brown          echo "Unknown PETSC_VERSION_RELEASE: $${version_release}"; \
403753a1a87SJed Brown          exit; \
404753a1a87SJed Brown        fi; \
4059c5cad75SSatish Balay        datestr=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1`; \
406753a1a87SJed Brown        export datestr; \
4072c3da995SSatish Balay        gitver=`git describe --match "v*"`; \
4083408a366SSatish Balay        export gitver; \
409753a1a87SJed Brown        find * -type d -wholename src/docs/website -prune -o -type d -wholename src/benchmarks/results -prune -o \
410e6b20741SSatish Balay          -type d -wholename config/BuildSystem/docs/website -prune -o -type d -wholename include/web -prune -o \
411f304b780SSatish Balay          -type d -wholename 'arch-*' -prune -o -type d -wholename src/tops -prune -o -type d -wholename externalpackages -prune ${DOCSETDATE_PRUNE_LIST} -o \
412536d436eSSatish Balay          -type f -name \*.html \
4133408a366SSatish Balay          -exec perl -pi -e 's^(<body.*>)^$$1\n   <div id=\"version\" align=right><b>$$ENV{petscversion} $$ENV{datestr}</b></div>\n   <div id="bugreport" align=right><a href="mailto:petsc-maint\@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: $$ENV{petscversion} $$ENV{gitver} {} "><small>Report Typos and Errors</small></a></div>^i' {} \; \
414753a1a87SJed Brown          -exec perl -pi -e 's^(<head>)^$$1 <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/{}" />^i' {} \; ; \
415753a1a87SJed Brown        echo "Done fixing version number, date, canonical URL info"
416753a1a87SJed Brown
417753a1a87SJed Brownalldocclean: deletemanualpages allcleanhtml
418753a1a87SJed Brown
419753a1a87SJed Brown# Deletes man pages (HTML version)
420753a1a87SJed Browndeletemanualpages: chk_loc
421753a1a87SJed Brown	-@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \
422753a1a87SJed Brown          find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\
423753a1a87SJed Brown          ${RM} ${LOC}/docs/exampleconcepts ;\
424753a1a87SJed Brown          ${RM} ${LOC}/docs/manconcepts ;\
425753a1a87SJed Brown          ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\
426*c3a89c15SBarry Smith          ${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\
427753a1a87SJed Brown        fi
428753a1a87SJed Brown
429753a1a87SJed Brownallcleanhtml:
430753a1a87SJed Brown	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree
431753a1a87SJed Brown
432753a1a87SJed Brownchk_concepts_dir: chk_loc
433753a1a87SJed Brown	@if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \
434753a1a87SJed Brown	  echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi
435753a1a87SJed Brown
436753a1a87SJed Brown###########################################################
437753a1a87SJed Brown# targets to build distribution and update docs
438753a1a87SJed Brown###########################################################
439753a1a87SJed Brown
440753a1a87SJed Brown# Creates ${HOME}/petsc.tar.gz [and petsc-lite.tar.gz]
441753a1a87SJed Browndist:
442*c3a89c15SBarry Smith	${PETSC_DIR}/lib/petsc/bin/maint/builddist ${PETSC_DIR} master
443753a1a87SJed Brown
444753a1a87SJed Brown# This target works only if you can do 'ssh petsc@login.mcs.anl.gov'
445753a1a87SJed Brown# also copy the file over to ftp site.
446753a1a87SJed Brownweb-snapshot:
447cc5a9e26SSatish Balay	@if [ ! -f "${HOME}/petsc-master.tar.gz" ]; then \
448cc5a9e26SSatish Balay	    echo "~/petsc-master.tar.gz missing! cannot update petsc-master snapshot on mcs-web-site"; \
449753a1a87SJed Brown	  else \
450cc5a9e26SSatish Balay            echo "updating petsc-master snapshot on mcs-web-site"; \
451753a1a87SJed Brown	    tmpdir=`mktemp -d -t petsc-doc.XXXXXXXX`; \
452cc5a9e26SSatish Balay	    cd $${tmpdir}; tar -xzf ${HOME}/petsc-master.tar.gz; \
453cc5a9e26SSatish Balay	    /usr/bin/rsync  -e ssh -az --delete $${tmpdir}/petsc-master/ \
454cc5a9e26SSatish Balay              petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-master ;\
455cc5a9e26SSatish Balay	    /bin/cp -f /home/petsc/petsc-master.tar.gz /mcs/ftp/pub/petsc/petsc-master.tar.gz;\
456753a1a87SJed Brown	    ${RM} -rf $${tmpdir} ;\
457753a1a87SJed Brown	  fi
458753a1a87SJed Brown
459cc5a9e26SSatish Balay# build the tarfile - and then update petsc-master snapshot on mcs-web-site
460753a1a87SJed Brownupdate-web-snapshot: dist web-snapshot
461753a1a87SJed Brown
462753a1a87SJed Brown# This target updates website main pages
463753a1a87SJed Brownupdate-web:
464753a1a87SJed Brown	@cd ${PETSC_DIR}/src/docs; make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} bib2html; \
465753a1a87SJed Brown	/usr/bin/rsync -az -C --exclude=documentation/index.html \
466753a1a87SJed Brown          --exclude=documentation/installation.html --exclude=download/index.html \
467753a1a87SJed Brown	  ${PETSC_DIR}/src/docs/website/ petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc
468753a1a87SJed Brown	@cd ${PETSC_DIR}/docs; /usr/bin/rsync -az developers.pdf petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/developers/
46992df35d2SSatish Balay	@cd ${PETSC_DIR}/src/docs/tex; /usr/bin/rsync -az petscapp.bib petsc.bib petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/publications
470753a1a87SJed Brown
471753a1a87SJed Brown#
472753a1a87SJed Brown#  builds a single list of files for each PETSc library so they may all be built in parallel
473753a1a87SJed Brown#  without a recursive set of make calls
474753a1a87SJed Browncreatefastbuild:
4752d507118SSatish Balay	cd src/vec; ${RM} -f files; /bin/echo -n "SOURCEC = " > files; make tree ACTION=sourcelist BASE_DIR=${PETSC_DIR}/src/vec
476753a1a87SJed Brown
477753a1a87SJed Brown###########################################################
478753a1a87SJed Brown#
479753a1a87SJed Brown#  See script for details
480753a1a87SJed Brown#
481753a1a87SJed Browngcov:
482*c3a89c15SBarry Smith	-@${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -run_gcov
483753a1a87SJed Brown
484753a1a87SJed Brownmergegcov:
485*c3a89c15SBarry Smith	-@${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -merge_gcov ${LOC} *.tar.gz
486753a1a87SJed Brown
4879eed5432SKarl Rupp########################
488235fd6e6SBarry Smith#
4899eed5432SKarl Rupp# Create the include dependency graph (requires graphviz to be available)
4909eed5432SKarl Rupp#
4919eed5432SKarl Ruppincludegraph:
4929eed5432SKarl Rupp	-@${PETSC_DIR}/src/contrib/style/include-graph.sh includegraph.pdf
4939eed5432SKarl Rupp	-@echo Include dependency graph written to includegraph.pdf
494235fd6e6SBarry Smith
495753a1a87SJed Brown#
496753a1a87SJed Brown# -------------------------------------------------------------------------------
497753a1a87SJed Brown#
498753a1a87SJed Brown# Some macros to check if the fortran interface is up-to-date.
499753a1a87SJed Brown#
500753a1a87SJed Browncountfortranfunctions:
501753a1a87SJed Brown	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
502753a1a87SJed Brown	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
503753a1a87SJed Brown	sed "s/_$$//" | sort > /tmp/countfortranfunctions
504753a1a87SJed Brown
505753a1a87SJed Browncountcfunctions:
506068711b4SBarry Smith	-@grep PETSC_EXTERN ${PETSC_DIR}/include/*.h  | grep "(" | tr -s ' ' | \
507753a1a87SJed Brown	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
508068711b4SBarry Smith	tr 'A-Z' 'a-z' |  sort | uniq > /tmp/countcfunctions
509753a1a87SJed Brown
510753a1a87SJed Browndifffortranfunctions: countfortranfunctions countcfunctions
511753a1a87SJed Brown	-@echo -------------- Functions missing in the fortran interface ---------------------
512753a1a87SJed Brown	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
513753a1a87SJed Brown	-@echo ----------------- Functions missing in the C interface ------------------------
514753a1a87SJed Brown	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
515753a1a87SJed Brown	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
516753a1a87SJed Brown
517753a1a87SJed Browncheckbadfortranstubs:
518753a1a87SJed Brown	-@echo "========================================="
519753a1a87SJed Brown	-@echo "Functions with MPI_Comm as an Argument"
520753a1a87SJed Brown	-@echo "========================================="
521753a1a87SJed Brown	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
522753a1a87SJed Brown	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
523753a1a87SJed Brown	-@echo "========================================="
524753a1a87SJed Brown	-@echo "Functions with a String as an Argument"
525753a1a87SJed Brown	-@echo "========================================="
526753a1a87SJed Brown	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
527753a1a87SJed Brown	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
528753a1a87SJed Brown	-@echo "========================================="
529753a1a87SJed Brown	-@echo "Functions with Pointers to PETSc Objects as Argument"
530753a1a87SJed Brown	-@echo "========================================="
531753a1a87SJed Brown	-@cd ${PETSC_DIR}/src/fortran/auto; \
532753a1a87SJed Brown	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
533753a1a87SJed Brown	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
534753a1a87SJed Brown	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
535753a1a87SJed Brown	for OBJ in $$_p_OBJ; do \
536753a1a87SJed Brown	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
537753a1a87SJed Brown	cut -d'(' -f1 | cut -d' ' -f1,3; \
538753a1a87SJed Brown	done
539a3269974SBarry Smith
540a3269974SBarry Smithcheckpackagetests:
541a3269974SBarry Smith	-@echo "Missing package tests"
542a3269974SBarry Smith	-@cat config/examples/*.py > configexamples; pushd config/BuildSystem/config/packages/; packages=`ls *.py | sed "s/\\.py//g"`;popd; for i in $${packages}; do j=`echo $${i} | tr '[:upper:]' '[:lower:]'`; printf $${j} ; egrep "(with-$${j}|download-$${j})" configexamples | grep -v "=0" | wc -l ; done
543a3269974SBarry Smith	-@echo "Missing download package tests"
544a3269974SBarry Smith	-@cat config/examples/*.py > configexamples; pushd config/BuildSystem/config/packages/; packages=`grep -l "download " *.py  | sed "s/\\.py//g"`;popd; for i in $${packages}; do j=`echo $${i} | tr '[:upper:]' '[:lower:]'`; printf $${j} ; egrep "(download-$${j})" configexamples | grep -v "=0" | wc -l ; done
545a3269974SBarry Smith
546753a1a87SJed Brown#
547753a1a87SJed Brown# Automatically generates PETSc exercises in html from the tutorial examples.
548753a1a87SJed Brown#
5491b266c99SBarry Smith# The introduction for each section is obtained from docs/manualpages-cite/header_${MANSEC} may be edited
550753a1a87SJed Brown#  (used also in introductions to the manual pages)
551753a1a87SJed Brown#
5521b266c99SBarry Smith# DO NOT EDIT the *.htm files generated since they will be automatically replaced.
553753a1a87SJed Brown#
554753a1a87SJed Brown# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
555753a1a87SJed Brown#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
556753a1a87SJed Brown#
557753a1a87SJed Brownexercises:
558753a1a87SJed Brown	-@echo "========================================="
559753a1a87SJed Brown	-@echo "Generating HTML tutorial exercises"
560753a1a87SJed Brown	-@${RM} docs/pageform.txt
561753a1a87SJed Brown	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
562753a1a87SJed Brown	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
563753a1a87SJed Brown	-@echo "access_format=short"                        >> docs/pageform.txt
564753a1a87SJed Brown	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
565753a1a87SJed Brown	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
566753a1a87SJed Brown	-@echo "Generating HTML for individual directories"
567753a1a87SJed Brown	-@echo "========================================="
568753a1a87SJed Brown	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
569753a1a87SJed Brown	-@echo "Completed HTML for individual directories"
570753a1a87SJed Brown	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
571753a1a87SJed Brown	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
572753a1a87SJed Brown	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
573753a1a87SJed Brown	-@echo "========================================="
574753a1a87SJed Brown
575753a1a87SJed Brown.PHONY: info info_h all build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update \
576753a1a87SJed Brown        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \
577bcaeba4dSBarry Smith        allhtml allcleanhtml  allci allco allrcslabel countfortranfunctions \
578416ff897SSatish Balay        start_configure configure_petsc configure_clean matlabbin install
579753a1a87SJed Brown
580753a1a87SJed Brownpetscao : petscmat petscao.f90.h
581753a1a87SJed Brownpetscdm : petscksp petscdm.f90.h
582753a1a87SJed Brownpetscdraw : petsc petscdraw.f90.h
583753a1a87SJed Brownpetscis : petsc petscis.f90.h
584753a1a87SJed Brownpetscksp : petscpc  petscksp.f90.h
585753a1a87SJed Brownpetsclog : petsc petsclog.f90.h
586753a1a87SJed Brownpetscmat : petscvec petscmat.f90.h
587753a1a87SJed Brownpetscmg : petscksp petscmg.f90.h
588753a1a87SJed Brownpetscpc : petscmat petscpc.f90.h
589753a1a87SJed Brownpetscsnes : petscksp petscsnes.f90.h
590753a1a87SJed Brownpetscsys : petsc petscsys.f90.h
591753a1a87SJed Brownpetscts : petscsnes petscts.f90.h
592753a1a87SJed Brownpetsc : petsc.f90.h
593753a1a87SJed Brownpetscvec : petscis petscvec.f90.h
594753a1a87SJed Brownpetscviewer : petsc petscviewer.f90.h
595753a1a87SJed Brownpetscmesh : petsc petscmesh.f90.h
596753a1a87SJed Brownmodules : petscao petscdm petscdraw petscis petscksp petsclog petscmat petscmg petscpc petscsnes petscsys petscts petsc petscvec petscviewer petscmesh
597