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