xref: /petsc/makefile (revision d11f3a422a39dc38ef6ea8ba2e6022ac69be8c2b)
1#
2# This is the makefile for compiling PETSc. See
3# http://www.mcs.anl.gov/petsc/petsc-as/documentation/installation.html for directions on installing PETSc.
4# See also bmake/common for additional commands.
5#
6ALL: all
7LOCDIR = .
8DIRS   = src include
9
10include ${PETSC_DIR}/bmake/common/base
11include ${PETSC_DIR}/bmake/common/test
12
13#
14# Basic targets to build PETSc libraries.
15# all: builds the c, fortran, and f90 libraries
16all:
17	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  chkpetsc_dir
18	-@${OMAKE} all_build 2>&1 | tee make_log_${PETSC_ARCH}
19	-@egrep -i "( error | error:)" make_log_${PETSC_ARCH} > /dev/null; if [ "$$?" = "0" ]; then \
20           echo "********************************************************************"; \
21           echo "  Error during compile, check make_log_${PETSC_ARCH}"; \
22           echo "  Send it and configure.log to petsc-maint@mcs.anl.gov";\
23           echo "********************************************************************"; \
24           exit 1; fi
25
26all_build: chk_petsc_dir chklib_dir info info_h deletelibs  build shared python
27#
28# Prints information about the system and version of PETSc being compiled
29#
30info:
31	-@echo "=========================================="
32	-@echo " "
33	-@echo "See docs/faq.html and docs/bugreporting.html"
34	-@echo "for help with installation problems. Please send EVERYTHING"
35	-@echo "printed out below when reporting problems"
36	-@echo " "
37	-@echo "To subscribe to the PETSc users mailing list, send mail to "
38	-@echo "majordomo@mcs.anl.gov with the message: "
39	-@echo "subscribe petsc-announce"
40	-@echo " "
41	-@echo "=========================================="
42	-@echo On `date` on `hostname`
43	-@echo Machine characteristics: `uname -a`
44	-@echo "config/configure.py run at " ${CONFIGURE_RUN_TIME}
45	-@echo "config/configure.py options " ${CONFIGURE_OPTIONS}
46	-@echo "-----------------------------------------"
47	-@echo "Using PETSc directory: ${PETSC_DIR}"
48	-@echo "Using PETSc arch: ${PETSC_ARCH}"
49	-@echo "-----------------------------------------"
50	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
51	-@echo "-----------------------------------------"
52	-@echo "Using configuration flags:"
53	-@grep "\#define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
54	-@echo "-----------------------------------------"
55	-@echo "Using include paths: ${PETSC_INCLUDE}"
56	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
57	-@echo "------------------------------------------"
58	-@echo "Using C/C++ compiler: ${CC} ${COPTFLAGS} ${CPPFLAGS}"
59	-@echo "C/C++ Compiler version: " `${CCV}`
60	-@if [ "${FC}" != "" ]; then \
61	   echo "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FPPFLAGS}";\
62	   echo "Fortran Compiler version: " `${FCV}`;\
63         fi
64	-@echo "-----------------------------------------"
65	-@echo "Using C/C++ linker: ${CC_LINKER}"
66	-@if [ "${FC}" != "" ]; then \
67	   echo "Using Fortran linker: ${FC_LINKER}";\
68         fi
69	-@echo "-----------------------------------------"
70	-@echo "Using libraries: ${PETSC_LIB}"
71	-@echo "------------------------------------------"
72	-@echo "Using mpirun: ${MPIRUN}"
73	-@echo "=========================================="
74#
75#
76MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
77info_h:
78	-@$(RM) -f MINFO ${MINFO}
79	-@echo  "static const char *petscmachineinfo = \"  " >> MINFO
80	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
81	-@echo  "config/configure.py run at " ${CONFIGURE_RUN_TIME} >> MINFO
82	-@echo  "config/configure.py options " ${CONFIGURE_OPTIONS} >> MINFO
83	-@echo  Machine characteristics: `uname -a` "" >> MINFO
84	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
85	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
86	-@echo  "-----------------------------------------\"; " >> MINFO
87	-@echo  "static const char *petsccompilerinfo = \"  " >> MINFO
88	-@echo  "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO
89	-@echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1 ; true
90	-@echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; true
91	-@echo  "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO
92	-@echo  "Fortran Compiler version:" >> MINFO ; ${FCV} >> MINFO 2>&1 ; true
93	-@echo  "-----------------------------------------\"; " >> MINFO
94	-@echo  "static const char *petsccompilerflagsinfo = \"  " >> MINFO
95	-@echo  "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO
96	-@echo  "-----------------------------------------" >> MINFO
97	-@echo  "Using configuration flags:" >> MINFO
98	-@echo  "-----------------------------------------" >> MINFO
99	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
100	-@echo  "------------------------------------------\"; " >> MINFO
101	-@echo  "static const char *petsclinkerinfo = \"  " >> MINFO
102	-@echo  "Using C linker: ${CLINKER}" >> MINFO
103	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
104	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> MINFO
105	-@cat MINFO | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> MINFO_
106	-@cat MINFO_ | ${SED} -e 's/\
107//g'  > /dev/null; foobar=$$?; \
108          if [ "$$foobar" = "0" ]; then \
109	    cat MINFO_ | ${SED} -e 's/\
110//g' > ${MINFO}; \
111          else cat MINFO | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> ${MINFO}; \
112          fi
113	-@$(RM) MINFO MINFO_
114
115#
116# Builds the PETSc libraries
117# This target also builds fortran77 and f90 interface
118# files and compiles .F files
119#
120build:
121	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
122	-@echo "========================================="
123	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
124	-@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}
125	-@echo "Completed building libraries"
126	-@echo "========================================="
127#
128# Builds the Python wrappers
129python:
130	-@if [ -d "${PETSC_DIR}/lib/${PETSC_ARCH}/PETSc" ]; then \
131	  echo "COMPILING PYTHON WRAPPERS"; \
132	  echo "========================================="; \
133	  PYTHONPATH=${PETSC_DIR}/python:${PETSC_DIR}/python/BuildSystem ./make.py --with-petsc-arch=${PETSC_ARCH} --with-petsc-shared=0; \
134	  echo "Completed building Python wrappers"; \
135	  echo "========================================="; \
136	fi
137#
138# Builds PETSc test examples for a given architecture
139#
140test:
141	-@echo "Running test examples to verify correct installation"
142	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex19
143	@if [ "${FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex5f; fi;
144	-@echo "Completed test examples"
145
146testexamples: info
147	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
148	-@echo "Due to different numerical round-off on certain"
149	-@echo "machines some of the numbers may not match exactly."
150	-@echo "========================================="
151	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C  tree
152	-@echo "Completed compiling and running test examples"
153	-@echo "========================================="
154testfortran: info
155	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
156	-@echo "========================================="
157	-@echo "Due to different numerical round-off on certain"
158	-@echo "machines or the way Fortran formats numbers"
159	-@echo "some of the results may not match exactly."
160	-@echo "========================================="
161	-@if [ "${FC}" != "" ]; then \
162            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran tree; \
163            echo "Completed compiling and running Fortran test examples"; \
164          else \
165            echo "Error: No FORTRAN compiler available"; \
166          fi
167	-@echo "========================================="
168testexamples_uni: info
169	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
170	-@echo "Due to different numerical round-off on certain"
171	-@echo "machines some of the numbers may not match exactly."
172	-@echo "========================================="
173	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C_X11_MPIUni  tree
174	-@echo "Completed compiling and running uniprocessor test examples"
175	-@echo "========================================="
176testfortran_uni: info
177	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
178	-@echo "Due to different numerical round-off on certain"
179	-@echo "machines some of the numbers may not match exactly."
180	-@echo "========================================="
181	-@if [ "${FC}" != "" ]; then \
182            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni  tree; \
183            echo "Completed compiling and running uniprocessor fortran test examples"; \
184          else \
185            echo "Error: No FORTRAN compiler available"; \
186          fi
187	-@
188	-@echo "========================================="
189
190# Ranlib on the libraries
191ranlib:
192	${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}
193
194# Deletes PETSc libraries
195deletelibs:
196	-${RM} -fr ${PETSC_LIB_DIR}/*
197
198# Cleans up build
199allclean: deletelibs
200	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
201
202
203#
204# Check if PETSC_DIR variable specified is valid
205#
206chk_petsc_dir:
207	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
208	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
209	  echo "You need to use / to separate directories, not \\!"; \
210	  echo "Aborting build"; \
211	  false; fi
212#
213#
214install:
215	-@if [ "${INSTALL_DIR}" = "${PETSC_DIR}" ]; then \
216	  echo "Install directory is current directory; nothing needs to be done";\
217        else \
218	  echo Installing PETSc at ${INSTALL_DIR};\
219          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
220	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
221          fi;\
222          if [ ! -d ${INSTALL_DIR} ]; then \
223	    ${MKDIR} ${INSTALL_DIR} ; \
224          fi;\
225          cp -fr include ${INSTALL_DIR};\
226          if [ ! -d ${INSTALL_DIR}/bmake ]; then \
227	    ${MKDIR} ${INSTALL_DIR}/bmake ; \
228          fi;\
229          cp -f bmake/adic* bmake/variables ${INSTALL_DIR}/bmake ; \
230          cp -fr bmake/common ${INSTALL_DIR}/bmake;\
231          cp -fr bmake/${PETSC_ARCH} ${INSTALL_DIR}/bmake;\
232          cp -fr bin ${INSTALL_DIR};\
233          if [ ! -d ${INSTALL_DIR}/lib ]; then \
234	    ${MKDIR} ${INSTALL_DIR}/lib ; \
235          fi;\
236          for i in lib/lib*; do \
237            if [ ! -d ${INSTALL_DIR}/$${i} ]; then \
238              ${MKDIR} ${INSTALL_DIR}/$${i};\
239            fi; \
240            if [ -d $${i}/${PETSC_ARCH} ]; then \
241              cp -fr $${i}/${PETSC_ARCH} ${INSTALL_DIR}/$${i};\
242              ${RANLIB}  ${INSTALL_DIR}/$${i}/*.a > /dev/null 2>&1 ;\
243              ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${INSTALL_DIR} shared; \
244            fi;\
245          done;\
246          echo "sh/bash: PETSC_DIR="${INSTALL_DIR}"; export PETSC_DIR";\
247          echo "csh/tcsh: setenv PETSC_DIR "${INSTALL_DIR} ;\
248          echo "Then do make test to verify correct install";\
249        fi;
250
251install_src:
252	-@if [ "${INSTALL_DIR}" = "${PETSC_DIR}" ]; then \
253	  echo "You did not set a directory to install to";\
254        else \
255	  echo Installing PETSc source at ${INSTALL_DIR};\
256          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
257	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
258          fi;\
259          if [ ! -d ${INSTALL_DIR} ]; then \
260	    ${MKDIR} ${INSTALL_DIR} ; \
261          fi;\
262          cp -fr src ${INSTALL_DIR};\
263        fi;
264
265install_docs:
266	-@if [ "${INSTALL_DIR}" = "${PETSC_DIR}" ]; then \
267	  echo "You did not set a directory to install to";\
268        else \
269	  echo Installing PETSc documentation at ${INSTALL_DIR};\
270          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
271	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
272          fi;\
273          if [ ! -d ${INSTALL_DIR} ]; then \
274	    ${MKDIR} ${INSTALL_DIR} ; \
275          fi;\
276          cp -fr docs ${INSTALL_DIR};\
277          ${RM} -fr docs/tex;\
278        fi;
279# ------------------------------------------------------------------
280#
281# All remaining actions are intended for PETSc developers only.
282# PETSc users should not generally need to use these commands.
283#
284
285# To access the tags in EMACS, type M-x visit-tags-table and specify
286# the file petsc/TAGS.
287# 1) To move to where a PETSc function is defined, enter M-. and the
288#     function name.
289# 2) To search for a string and move to the first occurrence,
290#     use M-x tags-search and the string.
291#     To locate later occurrences, use M-,
292# Builds all etags files
293alletags:
294	-@maint/generateetags.py
295	-@find python -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON
296
297allfortranstubs:
298	-@maint/generatefortranstubs.py ${BFORT}
299#
300# These are here for the target allci and allco, and etags
301#
302
303BMAKEFILES = bmake/common/base bmake/common/test bmake/adic.init bmake/adicmf.init
304DOCS	   = bmake/readme
305SCRIPTS    = maint/builddist  maint/wwwman maint/xclude maint/bugReport.py maint/buildconfigtest maint/builddistlite \
306             maint/buildtest maint/checkBuilds.py maint/copylognightly maint/copylognightly.tao maint/countfiles maint/findbadfiles \
307             maint/fixinclude maint/getexlist maint/getpdflabels.py maint/helpindex.py maint/hosts.local maint/hosts.solaris  \
308             maint/lex.py  maint/mapnameslatex.py maint/startnightly maint/startnightly.tao maint/submitPatch.py \
309             maint/update-docs.py  maint/wwwindex.py maint/xcludebackup maint/xcludecblas maint/zap maint/zapall \
310             python/PETSc/Configure.py python/PETSc/Options.py \
311             python/PETSc/packages/*.py python/PETSc/utilities/*.py
312
313chk_loc:
314	@if [ ${LOC}foo = foo ] ; then \
315	  echo "*********************** ERROR ************************" ; \
316	  echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \
317	  echo "******************************************************";  false; fi
318	@${MKDIR} ${LOC}/docs/manualpages
319
320# Builds all the documentation - should be done every night
321alldoc: alldoc1 alldoc2
322
323# Build everything that goes into 'doc' dir except html sources
324alldoc1: chk_loc deletemanualpages chk_concepts_dir
325	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
326	-@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap
327	-@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap
328	cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC}
329	-${OMAKE} ACTION=manualpages tree_basic LOC=${LOC}
330	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
331	-${OMAKE} ACTION=manexamples tree_basic LOC=${LOC}
332	-${OMAKE} manconcepts LOC=${LOC}
333	-${OMAKE} ACTION=getexlist tree_basic LOC=${LOC}
334	-${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC}
335	-maint/helpindex.py ${PETSC_DIR} ${LOC}
336	-grep -h Polymorphic include/*.h | grep -v '#define ' | sed "s?PetscPolymorphic[a-zA-Z]*(??g" | cut -f1 -d"{" > tmppoly
337	-maint/processpoly.py ${PETSC_DIR} ${LOC}
338
339# Builds .html versions of the source
340# html overwrites some stuff created by update-docs - hence this is done later.
341alldoc2: chk_loc
342	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC}
343	-maint/update-docs.py ${PETSC_DIR} ${LOC}
344
345alldocclean: deletemanualpages allcleanhtml
346
347# Deletes man pages (HTML version)
348deletemanualpages: chk_loc
349	-@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \
350          find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\
351          ${RM} ${LOC}/docs/exampleconcepts ;\
352          ${RM} ${LOC}/docs/manconcepts ;\
353          ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\
354          maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\
355        fi
356
357allcleanhtml:
358	-${RM} include/adic/*.h.html
359	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree
360
361chk_concepts_dir: chk_loc
362	@if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \
363	  echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi
364#
365#  makes .lines files for all source code
366#
367allgcov:
368	-@${RM} -rf /tmp/gcov
369	-@mkdir /tmp/gcov
370	-${OMAKE} ACTION=gcov PETSC_DIR=${PETSC_DIR} tree
371
372# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
373allrcslabel:
374	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
375#
376#   The commands below are for generating ADIC versions of the code;
377# they are not currently used.
378#
379alladicignore:
380	-@${RM} ${INSTALL_LIB_DIR}/adicignore
381	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
382
383alladic:
384	-@echo "Beginning to compile ADIC source code in all directories"
385	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
386	-@echo "========================================="
387	-@cd include ; \
388           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
389	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
390	-@cd src/inline ; \
391            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} adic
392
393alladiclib:
394	-@echo "Beginning to compile ADIC libraries in all directories"
395	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
396	-@echo "-----------------------------------------"
397	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
398	-@echo "-----------------------------------------"
399	-@echo "Using configuration flags:"
400	-@grep "define " bmake/${INLUDE_ARCH}/petscconf.h
401	-@echo "-----------------------------------------"
402	-@echo "Using include paths: ${PETSC_INCLUDE}"
403	-@echo "-----------------------------------------"
404	-@echo "Using PETSc directory: ${PETSC_DIR}"
405	-@echo "Using PETSc arch: ${PETSC_ARCH}"
406	-@echo "========================================="
407	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.${AR_LIB_SUFFIX}
408	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
409	-@cd src/adic/src ; \
410            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} lib
411
412# -------------------------------------------------------------------------------
413#
414# Some macros to check if the fortran interface is up-to-date.
415#
416countfortranfunctions:
417	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
418	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
419	sed "s/_$$//" | sort > /tmp/countfortranfunctions
420
421countcfunctions:
422	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
423	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
424	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
425
426difffortranfunctions: countfortranfunctions countcfunctions
427	-@echo -------------- Functions missing in the fortran interface ---------------------
428	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
429	-@echo ----------------- Functions missing in the C interface ------------------------
430	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
431	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
432
433checkbadfortranstubs:
434	-@echo "========================================="
435	-@echo "Functions with MPI_Comm as an Argument"
436	-@echo "========================================="
437	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
438	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
439	-@echo "========================================="
440	-@echo "Functions with a String as an Argument"
441	-@echo "========================================="
442	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
443	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
444	-@echo "========================================="
445	-@echo "Functions with Pointers to PETSc Objects as Argument"
446	-@echo "========================================="
447	-@cd ${PETSC_DIR}/src/fortran/auto; \
448	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
449	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
450	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
451	for OBJ in $$_p_OBJ; do \
452	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
453	cut -d'(' -f1 | cut -d' ' -f1,3; \
454	done
455#
456# Automatically generates PETSc exercises in html from the tutorial examples.
457#
458# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited
459#  (used also in introductions to the manual pages)
460# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
461# The list of exercises is from TUTORIALS in each directory's makefile
462#
463# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
464# The pagemaker rule is in the file bmake/common (at the bottom)
465#
466# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
467#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
468#
469exercises:
470	-@echo "========================================="
471	-@echo "Generating HTML tutorial exercises"
472	-@${RM} docs/pageform.txt
473	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
474	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
475	-@echo "access_format=short"                        >> docs/pageform.txt
476	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
477	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
478	-@echo "Generating HTML for individual directories"
479	-@echo "========================================="
480	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
481	-@echo "Completed HTML for individual directories"
482	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
483	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
484	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
485	-@echo "========================================="
486
487# Make a tarball of all the Python code
488#   This is currently used to release to the Teragrid
489petscPython.tgz:
490	@tar cvzf $@ --exclude SCCS --exclude BitKeeper --dereference python/
491	-@scp $@ tg-login2.uc.teragrid.org:./
492
493.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
494        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \
495        allhtml allcleanhtml  allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
496        start_configure configure_petsc configure_clean python
497
498