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