xref: /petsc/makefile (revision 4918a6b021011cda46c843241eab8b339e25250e)
1# $Id: makefile,v 1.348 2001/06/19 18:18:12 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
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}! Aborting build"; \
167	  false; fi
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 ${LOC}/docs/manualpages/*/*.html \
284                 ${LOC}/docs/manualpages/manualpages.cit
285
286# Builds all versions of the man pages
287allmanualpages: deletemanualpages
288	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
289	-${OMAKE} ACTION=manualpages tree_basic  LOC=${LOC}
290	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
291	-${OMAKE} ACTION=manexamples tree  LOC=${LOC}
292	-${OMAKE} manconcepts  LOC=${LOC}
293	-${OMAKE} ACTION=getexlist tree LOC=${LOC}
294	-${OMAKE} ACTION=exampleconcepts tree LOC=${LOC}
295	-maint/helpindex.py ${PETSC_DIR} ${LOC}
296	-@chmod g+w ${LOC}/docs/manualpages/*/*.html
297
298# Builds .html versions of the source
299allhtml:
300	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} tree LOC=${LOC}
301
302allcleanhtml:
303	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} tree
304
305# Builds Fortran stub files
306allfortranstubs:
307	-@include/foldinclude/generateincludes
308	-@${RM} -f src/fortran/auto/*.c
309	-${OMAKE} ACTION=fortranstubs tree_basic
310	-@cd src/fortran/auto; ${OMAKE} fixfortran
311	chmod g+w src/fortran/auto/*.c
312
313allci:
314	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
315
316allco:
317	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
318
319# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
320allrcslabel:
321	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
322#
323#   The commands below are for generating ADIC versions of the code;
324# they are not currently used.
325#
326alladicignore:
327	-@${RM} ${INSTALL_LIB_DIR}/adicignore
328	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
329
330alladic:
331	-@echo "Beginning to compile ADIC source code in all directories"
332	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
333	-@echo "========================================="
334	-@cd include ; \
335           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
336	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
337	-@cd src/inline ; \
338            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
339	-@cd src/blaslapack ; \
340            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
341
342alladiclib:
343	-@echo "Beginning to compile ADIC libraries in all directories"
344	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
345	-@echo "-----------------------------------------"
346	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
347	-@echo "-----------------------------------------"
348	-@echo "Using configuration flags:"
349	-@grep "define " bmake/${PETSC_ARCH}/petscconf.h
350	-@echo "-----------------------------------------"
351	-@echo "Using include paths: ${PETSC_INCLUDE}"
352	-@echo "-----------------------------------------"
353	-@echo "Using PETSc directory: ${PETSC_DIR}"
354	-@echo "Using PETSc arch: ${PETSC_ARCH}"
355	-@echo "========================================="
356	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.a
357	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
358	-@cd src/blaslapack ; \
359            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
360	-@cd src/adic/src ; \
361            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
362
363# -------------------------------------------------------------------------------
364#
365# Some macros to check if the fortran interface is up-to-date.
366#
367countfortranfunctions:
368	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
369	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
370	sed "s/_$$//" | sort > /tmp/countfortranfunctions
371
372countcfunctions:
373	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
374	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
375	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
376
377difffortranfunctions: countfortranfunctions countcfunctions
378	-@echo -------------- Functions missing in the fortran interface ---------------------
379	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
380	-@echo ----------------- Functions missing in the C interface ------------------------
381	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
382	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
383
384checkbadfortranstubs:
385	-@echo "========================================="
386	-@echo "Functions with MPI_Comm as an Argument"
387	-@echo "========================================="
388	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
389	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
390	-@echo "========================================="
391	-@echo "Functions with a String as an Argument"
392	-@echo "========================================="
393	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
394	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
395	-@echo "========================================="
396	-@echo "Functions with Pointers to PETSc Objects as Argument"
397	-@echo "========================================="
398	-@cd ${PETSC_DIR}/src/fortran/auto; \
399	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
400	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
401	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
402	for OBJ in $$_p_OBJ; do \
403	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
404	cut -d'(' -f1 | cut -d' ' -f1,3; \
405	done
406# Builds noise routines (not yet publically available)
407# Note:	 libfast cannot run on .F files on certain machines, so we
408# use lib and check for errors here.
409noise: info chklib_dir
410	-@echo "Beginning to compile noise routines"
411	-@echo "========================================="
412	-@cd src/snes/interface/noise; \
413	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib > trashz 2>&1; \
414	  grep -v clog trashz | grep -v "information sections" | \
415	  egrep -i '(Error|warning|Can)' >> /dev/null;\
416	  if [ "$$?" != 1 ]; then \
417	  cat trashz ; fi; ${RM} trashz
418	${RANLIB} ${INSTALL_LIB_DIR}/libpetscsnes.a
419	-@chmod g+w  ${INSTALL_LIB_DIR}/libpetscsnes.a
420	-@echo "Completed compiling noise routines"
421	-@echo "========================================="
422
423#
424# Automatically generates PETSc exercises in html from the tutorial examples.
425#
426# The introduction for each section is obtained from docs/manualpages/bop.${MANSEC} is under RCS and may be edited
427#  (used also in introductions to the manual pages)
428# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
429# The list of exercises is from TUTORIALS in each directory's makefile
430#
431# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
432# The pagemaker rule is in the file bmake/common (at the bottom)
433#
434# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
435#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
436#
437exercises:
438	-@echo "========================================="
439	-@echo "Generating HTML tutorial exercises"
440	-@${RM} docs/pageform.txt
441	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
442	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
443	-@echo "access_format=short"                        >> docs/pageform.txt
444	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
445	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
446	-@echo "Generating HTML for individual directories"
447	-@echo "========================================="
448	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
449	-@echo "Completed HTML for individual directories"
450	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
451	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
452	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
453	-@echo "========================================="
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470