xref: /petsc/makefile (revision 1111b64dd641ff9b0189bccba1c2a1ee10f9b8d6)
1# $Id: makefile,v 1.336 2001/03/06 17:31:48 bsmith Exp balay $
2#
3# This is the makefile for installing PETSc. See the file
4# docs/installation.html for directions on installing PETSc.
5# See also bmake/common for additional commands.
6#
7ALL: all
8
9DIRS	   = src include docs
10
11include ${PETSC_DIR}/bmake/${PETSC_ARCH}/base
12include ${PETSC_DIR}/bmake/common_test
13
14#
15# Basic targets to build PETSc libraries.
16# all     : builds the c, fortran, and f90 libraries
17all       : info info_h chklib_dir deletelibs build shared
18#
19# Prints information about the system and version of PETSc being compiled
20#
21info:
22	-@echo "=========================================="
23	-@echo " "
24	-@echo "See docs/troubleshooting.html and docs/bugreporting.html"
25	-@echo "for help with installation problems. Please send EVERYTHING"
26	-@echo "printed out below when reporting problems"
27	-@echo " "
28	-@echo "To subscribe to the PETSc users mailing list, send mail to "
29	-@echo "majordomo@mcs.anl.gov with the message: "
30	-@echo "subscribe petsc-users"
31	-@echo " "
32	-@echo "=========================================="
33	-@echo On `date` on `hostname`
34	-@echo Machine characteristics: `uname -a`
35	-@echo "-----------------------------------------"
36	-@echo "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS}"
37	-@if [ -n "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
38	  echo "C Compiler version:" ; ${C_CCV} ; fi
39	-@if [ -n "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
40	  echo "C++ Compiler version:" ; ${CXX_CCV} ; fi
41	-@echo "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}"
42	-@if [ -n "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
43	  echo "Fortran Compiler version:" ; ${C_FCV} ; fi
44	-@echo "-----------------------------------------"
45	-@grep PETSC_VERSION_NUMBER ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
46	-@echo "-----------------------------------------"
47	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
48	-@echo "-----------------------------------------"
49	-@echo "Using configuration flags:"
50	-@grep "define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
51	-@echo "-----------------------------------------"
52	-@echo "Using include paths: ${PETSC_INCLUDE}"
53	-@echo "-----------------------------------------"
54	-@echo "Using PETSc directory: ${PETSC_DIR}"
55	-@echo "Using PETSc arch: ${PETSC_ARCH}"
56	-@echo "------------------------------------------"
57	-@echo "Using C linker: ${CLINKER}"
58	-@echo "Using Fortran linker: ${FLINKER}"
59	-@echo "Using libraries: ${PETSC_LIB}"
60	-@echo "=========================================="
61#
62#
63MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
64info_h:
65	-@$(RM) -f MINFO ${MINFO}
66	-@echo  "static char *petscmachineinfo = \"  " >> MINFO
67	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
68	-@echo  Machine characteristics: `uname -a` "" >> MINFO
69	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
70	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
71	-@echo  "-----------------------------------------\"; " >> MINFO
72	-@echo  "static char *petsccompilerinfo = \"  " >> MINFO
73	-@echo  "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO
74	-@if [  "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
75	  echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1; fi
76	-@if [  "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
77	  echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; fi
78	-@echo  "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO
79	-@if [  "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
80	  echo  "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; fi
81	-@echo  "-----------------------------------------\"; " >> MINFO
82	-@echo  "static char *petsccompilerflagsinfo = \"  " >> MINFO
83	-@echo  "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO
84	-@echo  "-----------------------------------------" >> MINFO
85	-@echo  "Using configuration flags:" >> MINFO
86	-@echo  "-----------------------------------------" >> MINFO
87	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
88	-@echo  "------------------------------------------\"; " >> MINFO
89	-@echo  "static char *petsclinkerinfo = \"  " >> MINFO
90	-@echo  "Using C linker: ${CLINKER}" >> MINFO
91	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
92	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> MINFO
93	-@cat MINFO | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> ${MINFO}
94	-@chmod g+w ${MINFO}
95	-@$(RM) MINFO
96#
97# Builds the PETSc libraries
98# This target also builds fortran77 and f90 interface
99# files and compiles .F files
100#
101build:
102	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
103	-@echo "========================================="
104	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
105	${RANLIB} ${LDIR}/*.a
106	-@chmod g+w  ${LDIR}/*.a
107	-@echo "Completed building libraries"
108	-@echo "========================================="
109#
110#
111#
112petscblas: info chklib_dir
113	-${RM} -f ${LDIR}/libpetscblas.*
114	-@echo "BEGINNING TO COMPILE C VERSION OF BLAS AND LAPACK"
115	-@echo "========================================="
116	-@cd src/blaslapack/c; \
117	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
118	${RANLIB} ${LDIR}/libpetscblas.a
119	-@chmod g+w  ${LDIR}/*.a
120	-@echo "Completed compiling C version of BLAS and LAPACK"
121	-@echo "========================================="
122#
123# Builds PETSc test examples for a given BOPT and architecture
124#
125testexamples: info chkopts
126	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
127	-@echo "Due to different numerical round-off on certain"
128	-@echo "machines some of the numbers may not match exactly."
129	-@echo "========================================="
130	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1  tree
131	-@echo "Completed compiling and running test examples"
132	-@echo "========================================="
133testfortran: info chkopts
134	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
135	-@echo "========================================="
136	-@echo "Due to different numerical round-off on certain"
137	-@echo "machines or the way Fortran formats numbers"
138	-@echo "some of the results may not match exactly."
139	-@echo "========================================="
140	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3  tree
141	-@echo "Completed compiling and running Fortran test examples"
142	-@echo "========================================="
143testexamples_uni: info chkopts
144	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
145	-@echo "Due to different numerical round-off on certain"
146	-@echo "machines some of the numbers may not match exactly."
147	-@echo "========================================="
148	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4  tree
149	-@echo "Completed compiling and running uniprocessor test examples"
150	-@echo "========================================="
151testfortran_uni: info chkopts
152	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
153	-@echo "Due to different numerical round-off on certain"
154	-@echo "machines some of the numbers may not match exactly."
155	-@echo "========================================="
156	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9  tree
157	-@echo "Completed compiling and running uniprocessor fortran test examples"
158	-@echo "========================================="
159
160# Ranlib on the libraries
161ranlib:
162	${RANLIB} ${LDIR}/*.a
163
164# Deletes PETSc libraries
165deletelibs: chkopts_basic
166	-${RM} -f ${LDIR}/*
167
168
169# ------------------------------------------------------------------
170#
171# All remaining actions are intended for PETSc developers only.
172# PETSc users should not generally need to use these commands.
173#
174
175# To access the tags in EMACS, type M-x visit-tags-table and specify
176# the file petsc/TAGS.
177# 1) To move to where a PETSc function is defined, enter M-. and the
178#     function name.
179# 2) To search for a string and move to the first occurrence,
180#     use M-x tags-search and the string.
181#     To locate later occurrences, use M-,
182# Builds all etags files
183alletags:
184	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags
185	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_complete
186	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples
187	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples
188	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles
189# Builds the basic etags file.	This should be employed by most users.
190etags:
191	-${RM} ${TAGSDIR}/TAGS
192	-touch ${TAGSDIR}/TAGS
193	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree
194	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree
195	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree
196	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree
197	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree
198	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree
199	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree
200	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree
201	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree
202	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles
203	-chmod g+w TAGS
204# Builds complete etags list; only for PETSc developers.
205etags_complete:
206	-${RM} ${TAGSDIR}/TAGS_COMPLETE
207	-touch ${TAGSDIR}/TAGS_COMPLETE
208	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcec alltree
209	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcej alltree
210	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourceh alltree
211	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcef alltree
212	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesc alltree
213	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesf alltree
214	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesch alltree
215	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesfh alltree
216	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_makefile alltree
217	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE etags_bmakefiles
218	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_docs alltree
219	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_scripts alltree
220	-chmod g+w TAGS_COMPLETE
221# Builds the etags file that excludes the examples directories
222etags_noexamples:
223	-${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES
224	-touch ${TAGSDIR}/TAGS_NO_EXAMPLES
225	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree
226	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree
227	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree
228	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree
229	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree
230	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles
231	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree
232	-chmod g+w TAGS_NO_EXAMPLES
233# Builds the etags file for makefiles
234etags_makefiles:
235	-${RM} ${TAGSDIR}/TAGS_MAKEFILES
236	-touch ${TAGSDIR}/TAGS_MAKEFILES
237	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree
238	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles
239	-chmod g+w TAGS_MAKEFILES
240# Builds the etags file for examples
241etags_examples:
242	-${RM} ${TAGSDIR}/TAGS_EXAMPLES
243	-touch ${TAGSDIR}/TAGS_EXAMPLES
244	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree
245	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree
246	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree
247	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
248	-chmod g+w TAGS_EXAMPLES
249etags_fexamples:
250	-${RM} ${TAGSDIR}/TAGS_FEXAMPLES
251	-touch ${TAGSDIR}/TAGS_FEXAMPLES
252	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree
253	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
254	-chmod g+w TAGS_FEXAMPLES
255#
256# These are here for the target allci and allco, and etags
257#
258
259BMAKEFILES = bmake/common* bmake/*/base bmake/*/base_variables bmake/*/base.site \
260	     bmake/*/petscconf.h bmake/*/petscfix.h bmake/win32/makefile.dos bmake/config/*.in \
261             bmake/*/buildtest
262DOCS	   = bmake/readme bmake/petscconf.defs
263SCRIPTS    = maint/addlinks maint/builddist maint/buildlinks maint/wwwman \
264	     maint/xclude maint/crontab  \
265	     maint/autoftp include/foldinclude/generateincludes
266
267updatewebdocs:
268	-chmod -R ug+w /mcs/tmp/petsc-tmp
269	-chgrp -R petsc /mcs/tmp/petsc-tmp
270	-/bin/rm -rf /mcs/tmp/petscdocs
271	-/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs
272	-maint/update-docs.py /mcs/tmp/petscdocs
273	-find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \;
274	-/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs
275	-/bin/rm -rf /mcs/tmp/petscdocs
276
277# Builds all the documentation - should be done every night
278alldoc: allmanualpages
279	cd docs/tex/manual; ${OMAKE} manual.dvi manual.ps manual.html splitmanual.html
280
281# Deletes man pages (HTML version)
282deletemanualpages:
283	${RM} -f ${PETSC_DIR}/docs/manualpages/*/*.html \
284                 ${PETSC_DIR}/docs/manualpages/manualpages.cit
285
286# Builds all versions of the man pages
287allmanualpages: deletemanualpages
288	-${OMAKE} ACTION=manualpages_buildcite tree_basic
289	-${OMAKE} ACTION=manualpages tree_basic
290	-maint/wwwindex.py ${PETSC_DIR}
291	-${OMAKE} ACTION=manexamples tree
292	-${OMAKE} manconcepts
293	-${OMAKE} ACTION=exampleconcepts tree
294	-maint/helpindex.py
295	-@chmod g+w docs/manualpages/*/*.html
296
297# Builds Fortran stub files
298allfortranstubs:
299	-@include/foldinclude/generateincludes
300	-@${RM} -f src/fortran/auto/*.c
301	-${OMAKE} ACTION=fortranstubs tree_basic
302	-@cd src/fortran/auto; ${OMAKE} fixfortran
303	chmod g+w src/fortran/auto/*.c
304
305allci:
306	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
307
308allco:
309	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
310
311# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
312allrcslabel:
313	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
314#
315#   The commands below are for generating ADIC versions of the code;
316# they are not currently used.
317#
318alladicignore:
319	-@${RM} ${LDIR}/adicignore
320	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
321
322alladic:
323	-@echo "Beginning to compile ADIC source code in all directories"
324	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
325	-@echo "========================================="
326	-@cd include ; \
327           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
328	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
329	-@cd src/inline ; \
330            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
331	-@cd src/blaslapack ; \
332            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
333
334alladiclib:
335	-@echo "Beginning to compile ADIC libraries in all directories"
336	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
337	-@echo "-----------------------------------------"
338	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
339	-@echo "-----------------------------------------"
340	-@echo "Using configuration flags:"
341	-@grep "define " bmake/${PETSC_ARCH}/petscconf.h
342	-@echo "-----------------------------------------"
343	-@echo "Using include paths: ${PETSC_INCLUDE}"
344	-@echo "-----------------------------------------"
345	-@echo "Using PETSc directory: ${PETSC_DIR}"
346	-@echo "Using PETSc arch: ${PETSC_ARCH}"
347	-@echo "========================================="
348	-@${RM} -f  ${LDIR}/*adic.a
349	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
350	-@cd src/blaslapack ; \
351            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
352	-@cd src/adic/src ; \
353            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
354
355# -------------------------------------------------------------------------------
356#
357# Some macros to check if the fortran interface is up-to-date.
358#
359countfortranfunctions:
360	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
361	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
362	sed "s/_$$//" | sort > /tmp/countfortranfunctions
363
364countcfunctions:
365	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
366	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
367	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
368
369difffortranfunctions: countfortranfunctions countcfunctions
370	-@echo -------------- Functions missing in the fortran interface ---------------------
371	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
372	-@echo ----------------- Functions missing in the C interface ------------------------
373	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
374	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
375
376checkbadfortranstubs:
377	-@echo "========================================="
378	-@echo "Functions with MPI_Comm as an Argument"
379	-@echo "========================================="
380	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
381	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
382	-@echo "========================================="
383	-@echo "Functions with a String as an Argument"
384	-@echo "========================================="
385	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
386	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
387	-@echo "========================================="
388	-@echo "Functions with Pointers to PETSc Objects as Argument"
389	-@echo "========================================="
390	-@cd ${PETSC_DIR}/src/fortran/auto; \
391	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
392	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
393	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
394	for OBJ in $$_p_OBJ; do \
395	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
396	cut -d'(' -f1 | cut -d' ' -f1,3; \
397	done
398# Builds noise routines (not yet publically available)
399# Note:	 libfast cannot run on .F files on certain machines, so we
400# use lib and check for errors here.
401noise: info chklib_dir
402	-@echo "Beginning to compile noise routines"
403	-@echo "========================================="
404	-@cd src/snes/interface/noise; \
405	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib > trashz 2>&1; \
406	  grep -v clog trashz | grep -v "information sections" | \
407	  egrep -i '(Error|warning|Can)' >> /dev/null;\
408	  if [ "$$?" != 1 ]; then \
409	  cat trashz ; fi; ${RM} trashz
410	${RANLIB} ${LDIR}/libpetscsnes.a
411	-@chmod g+w  ${LDIR}/libpetscsnes.a
412	-@echo "Completed compiling noise routines"
413	-@echo "========================================="
414
415#
416# Automatically generates PETSc exercises in html from the tutorial examples.
417#
418# The introduction for each section is obtained from docs/manualpages/bop.${MANSEC} is under RCS and may be edited
419#  (used also in introductions to the manual pages)
420# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
421# The list of exercises is from TUTORIALS in each directory's makefile
422#
423# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
424# The pagemaker rule is in the file bmake/common (at the bottom)
425#
426# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
427#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
428#
429exercises:
430	-@echo "========================================="
431	-@echo "Generating HTML tutorial exercises"
432	-@rm -f docs/pageform.txt
433	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
434	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
435	-@echo "access_format=short"                        >> docs/pageform.txt
436	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
437	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
438	-@echo "Generating HTML for individual directories"
439	-@echo "========================================="
440	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
441	-@echo "Completed HTML for individual directories"
442	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
443	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
444	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
445	-@echo "========================================="
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462