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