xref: /petsc/makefile (revision 3a7fca6b988f1faea172e46abdf950477dbfaf76)
1# $Id: makefile,v 1.349 2001/06/19 18:27:16 balay Exp bsmith $
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
8LOCDIR = .
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       : chk_petsc_dir 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} ${PETSC_LIB_DIR}/*.a
106	-@chmod g+w  ${PETSC_LIB_DIR}/*.a
107	-@echo "Completed building libraries"
108	-@echo "========================================="
109#
110# Builds PETSc test examples for a given BOPT and architecture
111#
112testexamples: info chkopts
113	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
114	-@echo "Due to different numerical round-off on certain"
115	-@echo "machines some of the numbers may not match exactly."
116	-@echo "========================================="
117	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1  tree
118	-@echo "Completed compiling and running test examples"
119	-@echo "========================================="
120testfortran: info chkopts
121	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
122	-@echo "========================================="
123	-@echo "Due to different numerical round-off on certain"
124	-@echo "machines or the way Fortran formats numbers"
125	-@echo "some of the results may not match exactly."
126	-@echo "========================================="
127	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3  tree
128	-@echo "Completed compiling and running Fortran test examples"
129	-@echo "========================================="
130testexamples_uni: info chkopts
131	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
132	-@echo "Due to different numerical round-off on certain"
133	-@echo "machines some of the numbers may not match exactly."
134	-@echo "========================================="
135	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4  tree
136	-@echo "Completed compiling and running uniprocessor test examples"
137	-@echo "========================================="
138testfortran_uni: info chkopts
139	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
140	-@echo "Due to different numerical round-off on certain"
141	-@echo "machines some of the numbers may not match exactly."
142	-@echo "========================================="
143	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9  tree
144	-@echo "Completed compiling and running uniprocessor fortran test examples"
145	-@echo "========================================="
146
147# Ranlib on the libraries
148ranlib:
149	${RANLIB} ${PETSC_LIB_DIR}/*.a
150
151# Deletes PETSc libraries
152deletelibs: chkopts_basic
153	-${RM} -f ${PETSC_LIB_DIR}/*
154
155#
156#   Updates your PETSc version to the latest set of patches
157#
158update:
159	-@bin/petscupdate
160
161#
162# Check if PETSC_DIR variable specified is valid
163#
164chk_petsc_dir:
165	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
166	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
167	  echo "You need to use / to separate directories, not \\!"; \
168	  echo "Aborting build"; \
169	  false; fi
170
171# ------------------------------------------------------------------
172#
173# All remaining actions are intended for PETSc developers only.
174# PETSc users should not generally need to use these commands.
175#
176
177# To access the tags in EMACS, type M-x visit-tags-table and specify
178# the file petsc/TAGS.
179# 1) To move to where a PETSc function is defined, enter M-. and the
180#     function name.
181# 2) To search for a string and move to the first occurrence,
182#     use M-x tags-search and the string.
183#     To locate later occurrences, use M-,
184# Builds all etags files
185alletags:
186	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags
187	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_complete
188	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples
189	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples
190	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles
191# Builds the basic etags file.	This should be employed by most users.
192etags:
193	-${RM} ${TAGSDIR}/TAGS
194	-touch ${TAGSDIR}/TAGS
195	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree
196	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree
197	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree
198	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree
199	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree
200	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree
201	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree
202	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree
203	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree
204	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles
205	-chmod g+w TAGS
206# Builds complete etags list; only for PETSc developers.
207etags_complete:
208	-${RM} ${TAGSDIR}/TAGS_COMPLETE
209	-touch ${TAGSDIR}/TAGS_COMPLETE
210	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcec alltree
211	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcej alltree
212	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourceh alltree
213	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcef alltree
214	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesc alltree
215	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesf alltree
216	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesch alltree
217	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesfh alltree
218	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_makefile alltree
219	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE etags_bmakefiles
220	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_docs alltree
221	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_scripts alltree
222	-chmod g+w TAGS_COMPLETE
223# Builds the etags file that excludes the examples directories
224etags_noexamples:
225	-${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES
226	-touch ${TAGSDIR}/TAGS_NO_EXAMPLES
227	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree
228	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree
229	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree
230	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree
231	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree
232	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles
233	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree
234	-chmod g+w TAGS_NO_EXAMPLES
235# Builds the etags file for makefiles
236etags_makefiles:
237	-${RM} ${TAGSDIR}/TAGS_MAKEFILES
238	-touch ${TAGSDIR}/TAGS_MAKEFILES
239	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree
240	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles
241	-chmod g+w TAGS_MAKEFILES
242# Builds the etags file for examples
243etags_examples:
244	-${RM} ${TAGSDIR}/TAGS_EXAMPLES
245	-touch ${TAGSDIR}/TAGS_EXAMPLES
246	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree
247	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree
248	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree
249	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
250	-chmod g+w TAGS_EXAMPLES
251etags_fexamples:
252	-${RM} ${TAGSDIR}/TAGS_FEXAMPLES
253	-touch ${TAGSDIR}/TAGS_FEXAMPLES
254	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree
255	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
256	-chmod g+w TAGS_FEXAMPLES
257#
258# These are here for the target allci and allco, and etags
259#
260
261BMAKEFILES = bmake/common* bmake/*/base bmake/*/base_variables bmake/*/base.site \
262	     bmake/*/petscconf.h bmake/*/petscfix.h bmake/win32/makefile.dos bmake/config/*.in \
263             bmake/*/buildtest
264DOCS	   = bmake/readme bmake/petscconf.defs
265SCRIPTS    = maint/addlinks maint/builddist maint/buildlinks maint/wwwman \
266	     maint/xclude maint/crontab  \
267	     maint/autoftp include/foldinclude/generateincludes
268
269updatewebdocs:
270	-chmod -R ug+w /mcs/tmp/petsc-tmp
271	-chgrp -R petsc /mcs/tmp/petsc-tmp
272	-/bin/rm -rf /mcs/tmp/petscdocs
273	-/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs
274	-maint/update-docs.py /mcs/tmp/petscdocs
275	-find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \;
276	-/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs
277	-/bin/rm -rf /mcs/tmp/petscdocs
278
279# Builds all the documentation - should be done every night
280alldoc: allmanualpages
281	cd docs/tex/manual; ${OMAKE} manual.dvi manual.ps manual.html splitmanual.html
282
283# Deletes man pages (HTML version)
284deletemanualpages:
285	${RM} -f ${LOC}/docs/manualpages/*/*.html \
286                 ${LOC}/docs/manualpages/manualpages.cit
287
288# Builds all versions of the man pages
289allmanualpages: deletemanualpages
290	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
291	-${OMAKE} ACTION=manualpages tree_basic  LOC=${LOC}
292	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
293	-${OMAKE} ACTION=manexamples tree  LOC=${LOC}
294	-${OMAKE} manconcepts  LOC=${LOC}
295	-${OMAKE} ACTION=getexlist tree LOC=${LOC}
296	-${OMAKE} ACTION=exampleconcepts tree LOC=${LOC}
297	-maint/helpindex.py ${PETSC_DIR} ${LOC}
298	-@chmod g+w ${LOC}/docs/manualpages/*/*.html
299
300# Builds .html versions of the source
301allhtml:
302	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} tree LOC=${LOC}
303
304allcleanhtml:
305	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} tree
306
307# Builds Fortran stub files
308allfortranstubs:
309	-@include/foldinclude/generateincludes
310	-@${RM} -f src/fortran/auto/*.c
311	-${OMAKE} ACTION=fortranstubs tree_basic
312	-@cd src/fortran/auto; ${OMAKE} fixfortran
313	chmod g+w src/fortran/auto/*.c
314
315allci:
316	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
317
318allco:
319	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
320
321# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
322allrcslabel:
323	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
324#
325#   The commands below are for generating ADIC versions of the code;
326# they are not currently used.
327#
328alladicignore:
329	-@${RM} ${INSTALL_LIB_DIR}/adicignore
330	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
331
332alladic:
333	-@echo "Beginning to compile ADIC source code in all directories"
334	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
335	-@echo "========================================="
336	-@cd include ; \
337           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
338	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
339	-@cd src/inline ; \
340            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
341	-@cd src/blaslapack ; \
342            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
343
344alladiclib:
345	-@echo "Beginning to compile ADIC libraries in all directories"
346	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
347	-@echo "-----------------------------------------"
348	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
349	-@echo "-----------------------------------------"
350	-@echo "Using configuration flags:"
351	-@grep "define " bmake/${PETSC_ARCH}/petscconf.h
352	-@echo "-----------------------------------------"
353	-@echo "Using include paths: ${PETSC_INCLUDE}"
354	-@echo "-----------------------------------------"
355	-@echo "Using PETSc directory: ${PETSC_DIR}"
356	-@echo "Using PETSc arch: ${PETSC_ARCH}"
357	-@echo "========================================="
358	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.a
359	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
360	-@cd src/blaslapack ; \
361            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
362	-@cd src/adic/src ; \
363            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
364
365# -------------------------------------------------------------------------------
366#
367# Some macros to check if the fortran interface is up-to-date.
368#
369countfortranfunctions:
370	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
371	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
372	sed "s/_$$//" | sort > /tmp/countfortranfunctions
373
374countcfunctions:
375	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
376	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
377	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
378
379difffortranfunctions: countfortranfunctions countcfunctions
380	-@echo -------------- Functions missing in the fortran interface ---------------------
381	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
382	-@echo ----------------- Functions missing in the C interface ------------------------
383	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
384	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
385
386checkbadfortranstubs:
387	-@echo "========================================="
388	-@echo "Functions with MPI_Comm as an Argument"
389	-@echo "========================================="
390	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
391	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
392	-@echo "========================================="
393	-@echo "Functions with a String as an Argument"
394	-@echo "========================================="
395	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
396	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
397	-@echo "========================================="
398	-@echo "Functions with Pointers to PETSc Objects as Argument"
399	-@echo "========================================="
400	-@cd ${PETSC_DIR}/src/fortran/auto; \
401	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
402	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
403	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
404	for OBJ in $$_p_OBJ; do \
405	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
406	cut -d'(' -f1 | cut -d' ' -f1,3; \
407	done
408# Builds noise routines (not yet publically available)
409# Note:	 libfast cannot run on .F files on certain machines, so we
410# use lib and check for errors here.
411noise: info chklib_dir
412	-@echo "Beginning to compile noise routines"
413	-@echo "========================================="
414	-@cd src/snes/interface/noise; \
415	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib > trashz 2>&1; \
416	  grep -v clog trashz | grep -v "information sections" | \
417	  egrep -i '(Error|warning|Can)' >> /dev/null;\
418	  if [ "$$?" != 1 ]; then \
419	  cat trashz ; fi; ${RM} trashz
420	${RANLIB} ${INSTALL_LIB_DIR}/libpetscsnes.a
421	-@chmod g+w  ${INSTALL_LIB_DIR}/libpetscsnes.a
422	-@echo "Completed compiling noise routines"
423	-@echo "========================================="
424
425#
426# Automatically generates PETSc exercises in html from the tutorial examples.
427#
428# The introduction for each section is obtained from docs/manualpages/bop.${MANSEC} is under RCS and may be edited
429#  (used also in introductions to the manual pages)
430# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
431# The list of exercises is from TUTORIALS in each directory's makefile
432#
433# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
434# The pagemaker rule is in the file bmake/common (at the bottom)
435#
436# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
437#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
438#
439exercises:
440	-@echo "========================================="
441	-@echo "Generating HTML tutorial exercises"
442	-@${RM} docs/pageform.txt
443	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
444	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
445	-@echo "access_format=short"                        >> docs/pageform.txt
446	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
447	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
448	-@echo "Generating HTML for individual directories"
449	-@echo "========================================="
450	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
451	-@echo "Completed HTML for individual directories"
452	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
453	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
454	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
455	-@echo "========================================="
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472