xref: /petsc/makefile (revision a7a1495cff6e7d7f13bcb4a602de4e22c1c115f6)
1# $Id: makefile,v 1.302 2000/02/22 14:38:21 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
12
13#
14# Basic targets to build PETSc libraries.
15# all     : builds the c, fortran, and f90 libraries
16all       : info info_h chkpetsc_dir deletelibs build_c build_fortran shared
17#
18# Prints information about the system and version of PETSc being compiled
19#
20info:
21	-@echo "=========================================="
22	-@echo " "
23	-@echo "See docs/troubleshooting.html and docs/bugreporting.html"
24	-@echo "for help with installation problems. Please send EVERYTHING"
25	-@echo "printed out below when reporting problems"
26	-@echo " "
27	-@echo "To subscribe to the PETSc users mailing list, send mail to "
28	-@echo "majordomo@mcs.anl.gov with the message: "
29	-@echo "subscribe petsc-users"
30	-@echo " "
31	-@echo "=========================================="
32	-@echo On `date` on `hostname`
33	-@echo Machine characteristics: `uname -a`
34	-@echo "-----------------------------------------"
35	-@echo "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS}"
36	-@if [ -n "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
37	  echo "C Compiler version:" ; ${C_CCV} ; fi
38	-@if [ -n "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
39	  echo "C++ Compiler version:" ; ${CXX_CCV} ; fi
40	-@echo "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}"
41	-@if [ -n "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
42	  echo "Fortran Compiler version:" ; ${C_FCV} ; fi
43	-@echo "-----------------------------------------"
44	-@grep PETSC_VERSION_NUMBER include/petscversion.h | sed "s/........//"
45	-@echo "-----------------------------------------"
46	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
47	-@echo "-----------------------------------------"
48	-@echo "Using configuration flags:"
49	-@grep "define " bmake/${PETSC_ARCH}/petscconf.h
50	-@echo "-----------------------------------------"
51	-@echo "Using include paths: ${PETSC_INCLUDE}"
52	-@echo "-----------------------------------------"
53	-@echo "Using PETSc directory: ${PETSC_DIR}"
54	-@echo "Using PETSc arch: ${PETSC_ARCH}"
55	-@echo "------------------------------------------"
56	-@echo "Using C linker: ${CLINKER}"
57	-@echo "Using Fortran linker: ${FLINKER}"
58	-@echo "Using libraries: ${PETSC_LIB}"
59	-@echo "=========================================="
60#
61#
62MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
63info_h:
64	-@$(RM) -f MINFO ${MINFO}
65	-@echo  "static char *petscmachineinfo = \"  " >> MINFO
66	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
67	-@echo  Machine characteristics: `uname -a` "" >> MINFO
68	-@echo  "-----------------------------------------" >> MINFO
69	-@echo  "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO
70	-@if [  "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
71	  echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1; fi
72	-@if [  "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
73	  echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; fi
74	-@echo  "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO
75	-@if [  "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
76	  echo  "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; fi
77	-@echo  "-----------------------------------------" >> MINFO
78	-@echo  "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO
79	-@echo  "-----------------------------------------" >> MINFO
80	-@echo  "Using configuration flags:" >> MINFO
81	-@echo  "-----------------------------------------" >> MINFO
82	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
83	-@echo  "-----------------------------------------" >> MINFO
84	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
85	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
86	-@echo  "------------------------------------------" >> MINFO
87	-@echo  "Using C linker: ${CLINKER}" >> MINFO
88	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
89	-@cat MINFO | sed -e 's/$$/  \\n\\/' > ${MINFO}
90	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> ${MINFO}
91	-@chmod g+w ${MINFO}
92	-@$(RM) MINFO
93#
94# Builds the PETSc libraries
95# This target also builds fortran77 and f90 interface
96# files. (except compiling *.F files)
97#
98build_c:
99	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
100	-@echo "========================================="
101	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=libfast tree
102	-@cd ${PETSC_DIR}/src/sys/src/time ; \
103	${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} rs6000_asmtime
104	${RANLIB} ${PDIR}/*.a
105	-@chmod g+w  ${PDIR}/*.a
106	-@echo "Completed building libraries"
107	-@echo "========================================="
108
109#
110# Builds PETSc Fortran source
111# Note:	 libfast cannot run on .F files on certain machines, so we
112# use libf to compile the fortran source files.
113#
114build_fortran:
115	-@echo "BEGINNING TO COMPILE FORTRAN SOURCE"
116	-@echo "========================================="
117	-@cd src/fortran/custom; \
118	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} libf clean
119	-@cd src/fortran/kernels; \
120	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} libf clean
121	${RANLIB} ${PDIR}/libpetscfortran.a
122	${RANLIB} ${PDIR}/libpetsc.a
123	-@chmod g+w  ${PDIR}/*.a
124	-@echo "Completed compiling Fortran source"
125	-@echo "========================================="
126
127petscblas: info chkpetsc_dir
128	-${RM} -f ${PDIR}/libpetscblas.*
129	-@echo "BEGINNING TO COMPILE C VERSION OF BLAS AND LAPACK"
130	-@echo "========================================="
131	-@cd src/blaslapack; \
132	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=libfast tree
133	${RANLIB} ${PDIR}/libpetscblas.a
134	-@chmod g+w  ${PDIR}/*.a
135	-@echo "Completed compiling C version of BLAS and LAPACK"
136	-@echo "========================================="
137
138
139# Builds PETSc test examples for a given BOPT and architecture
140testexamples: info chkopts
141	-@echo "BEGINNING TO COMPILE AND RUN TEST 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} \
146	   ACTION=testexamples_1  tree
147	-@echo "Completed compiling and running test examples"
148	-@echo "========================================="
149
150# Builds PETSc test examples for a given BOPT and architecture
151testfortran: info chkopts
152	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
153	-@echo "========================================="
154	-@echo "Due to different numerical round-off on certain"
155	-@echo "machines or the way Fortran formats numbers"
156	-@echo "some of the results may not match exactly."
157	-@echo "========================================="
158	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} \
159	   ACTION=testexamples_3  tree
160	-@echo "Completed compiling and running Fortran test examples"
161	-@echo "========================================="
162
163# Builds PETSc test examples for a given BOPT and architecture
164testexamples_uni: info chkopts
165	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
166	-@echo "Due to different numerical round-off on certain"
167	-@echo "machines some of the numbers may not match exactly."
168	-@echo "========================================="
169	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} \
170	   ACTION=testexamples_4  tree
171	-@echo "Completed compiling and running uniprocessor test examples"
172	-@echo "========================================="
173testfortran_uni: info chkopts
174	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
175	-@echo "Due to different numerical round-off on certain"
176	-@echo "machines some of the numbers may not match exactly."
177	-@echo "========================================="
178	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} \
179	   ACTION=testexamples_9  tree
180	-@echo "Completed compiling and running uniprocessor fortran test examples"
181	-@echo "========================================="
182matlabcodes:
183	-@echo "BEGINNING TO COMPILE MATLAB INTERFACE"
184	-@cd src/sys/src/viewer/impls/socket/matlab; ${OMAKE} BOPT=g matlabcodes  PETSC_ARCH=${PETSC_ARCH}
185
186# Ranlib on the libraries
187ranlib:
188	${RANLIB} ${PDIR}/*.a
189
190# Deletes PETSc libraries
191deletelibs: chkopts_basic
192	-${RM} -f ${PDIR}/*
193
194
195# ------------------------------------------------------------------
196#
197# All remaining actions are intended for PETSc developers only.
198# PETSc users should not generally need to use these commands.
199#
200
201# To access the tags in EMACS, type M-x visit-tags-table and specify
202# the file petsc/TAGS.
203# 1) To move to where a PETSc function is defined, enter M-. and the
204#     function name.
205# 2) To search for a string and move to the first occurrence,
206#     use M-x tags-search and the string.
207#     To locate later occurrences, use M-,
208# Builds all etags files
209alletags:
210	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags
211	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_complete
212	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples
213	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples
214	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles
215# Builds the basic etags file.	This should be employed by most users.
216etags:
217	-${RM} ${TAGSDIR}/TAGS
218	-touch ${TAGSDIR}/TAGS
219	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree
220	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree
221	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree
222	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree
223	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree
224	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree
225	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree
226	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree
227	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles
228	-chmod g+w TAGS
229# Builds complete etags list; only for PETSc developers.
230etags_complete:
231	-${RM} ${TAGSDIR}/TAGS_COMPLETE
232	-touch ${TAGSDIR}/TAGS_COMPLETE
233	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcec alltree
234	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourceh alltree
235	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcef alltree
236	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesc alltree
237	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesf alltree
238	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesch alltree
239	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesfh alltree
240	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_makefile alltree
241	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE etags_bmakefiles
242	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_docs alltree
243	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_scripts alltree
244	-chmod g+w TAGS_COMPLETE
245# Builds the etags file that excludes the examples directories
246etags_noexamples:
247	-${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES
248	-touch ${TAGSDIR}/TAGS_NO_EXAMPLES
249	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree
250	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree
251	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree
252	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree
253	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles
254	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree
255	-chmod g+w TAGS_NO_EXAMPLES
256# Builds the etags file for makefiles
257etags_makefiles:
258	-${RM} ${TAGSDIR}/TAGS_MAKEFILES
259	-touch ${TAGSDIR}/TAGS_MAKEFILES
260	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree
261	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles
262	-chmod g+w TAGS_MAKEFILES
263# Builds the etags file for examples
264etags_examples:
265	-${RM} ${TAGSDIR}/TAGS_EXAMPLES
266	-touch ${TAGSDIR}/TAGS_EXAMPLES
267	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree
268	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree
269	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree
270	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
271	-chmod g+w TAGS_EXAMPLES
272etags_fexamples:
273	-${RM} ${TAGSDIR}/TAGS_FEXAMPLES
274	-touch ${TAGSDIR}/TAGS_FEXAMPLES
275	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree
276	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
277	-chmod g+w TAGS_FEXAMPLES
278#
279# These are here for the target allci and allco, and etags
280#
281
282BMAKEFILES = bmake/common* bmake/*/base bmake/*/base_variables bmake/*/base.site \
283	     bmake/*/petscconf.h bmake/*/petscfix.h bmake/win32/makefile.dos bin/config/base*.in \
284             bmake/*/buildtest
285DOCS	   = bmake/readme bmake/petscconf.defs
286SCRIPTS    = maint/addlinks maint/builddist maint/buildlinks maint/wwwman \
287	     maint/xclude maint/crontab  \
288	     maint/autoftp include/foldinclude/generateincludes
289
290# Builds all the documentation - should be done every night
291alldoc: allmanpages
292	cd docs/tex/manual; ${OMAKE} manual.dvi manual.ps manual.html splitmanual.html
293
294# Deletes man pages (HTML version)
295deletemanualpages:
296	${RM} -f ${PETSC_DIR}/docs/manualpages/*/*.html \
297                 ${PETSC_DIR}/docs/manualpages/manualpages.cit
298
299# Deletes man pages (LaTeX version)
300deletelatexpages:
301	${RM} -f ${PETSC_DIR}/docs/tex/rsum/*sum*.tex
302
303# Builds all versions of the man pages
304allmanpages: allmanualpages alllatexpages
305allmanualpages: deletemanualpages
306	-${OMAKE} ACTION=manualpages_buildcite ttree
307	-${OMAKE} ACTION=manualpages ttree
308	-maint/wwwindex.py ${PETSC_DIR}
309	-maint/examplesindex.tcl
310	-maint/htmlkeywords.tcl
311	-@chmod g+w docs/manualpages/*/*.html
312
313alllatexpages: deletelatexpages
314	-${OMAKE} ACTION=latexpages ttree
315	-@chmod g+w docs/tex/rsum/*
316
317# Builds Fortran stub files
318allfortranstubs:
319	-@include/foldinclude/generateincludes
320	-@${RM} -f src/fortran/auto/*.c
321	-${OMAKE} ACTION=fortranstubs ttree
322	-@cd src/fortran/auto; ${OMAKE} -f makefile fixfortran
323	chmod g+w src/fortran/auto/*.c
324
325allci:
326	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
327
328allco:
329	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
330
331#
332#   The commands below are for generating ADIC versions of the code;
333# they are not currently used.
334#
335alladicignore:
336	-@${RM} ${PDIR}/adicignore
337	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
338
339alladic:
340	-@echo "Beginning to compile ADIC source code in all directories"
341	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
342	-@echo "========================================="
343	-@cd include ; \
344           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
345	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
346	-@cd src/inline ; \
347            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
348	-@cd src/blaslapack ; \
349            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
350
351alladiclib:
352	-@echo "Beginning to compile ADIC libraries in all directories"
353	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
354	-@echo "-----------------------------------------"
355	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
356	-@echo "-----------------------------------------"
357	-@echo "Using configuration flags:"
358	-@grep "define " bmake/${PETSC_ARCH}/petscconf.h
359	-@echo "-----------------------------------------"
360	-@echo "Using include paths: ${PETSC_INCLUDE}"
361	-@echo "-----------------------------------------"
362	-@echo "Using PETSc directory: ${PETSC_DIR}"
363	-@echo "Using PETSc arch: ${PETSC_ARCH}"
364	-@echo "========================================="
365	-@${RM} -f  ${PDIR}/*adic.a
366	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
367	-@cd src/blaslapack ; \
368            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
369	-@cd src/adic/src ; \
370            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
371
372# -------------------------------------------------------------------------------
373#
374# Some macros to check if the fortran interface is up-to-date.
375#
376countfortranfunctions:
377	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
378	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
379	sed "s/_$$//" | sort > /tmp/countfortranfunctions
380
381countcfunctions:
382	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
383	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
384	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
385
386difffortranfunctions: countfortranfunctions countcfunctions
387	-@echo -------------- Functions missing in the fortran interface ---------------------
388	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
389	-@echo ----------------- Functions missing in the C interface ------------------------
390	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
391	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
392
393checkbadfortranstubs:
394	-@echo "========================================="
395	-@echo "Functions with MPI_Comm as an Argument"
396	-@echo "========================================="
397	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
398	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
399	-@echo "========================================="
400	-@echo "Functions with a String as an Argument"
401	-@echo "========================================="
402	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
403	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
404	-@echo "========================================="
405	-@echo "Functions with Pointers to PETSc Objects as Argument"
406	-@echo "========================================="
407	-@cd ${PETSC_DIR}/src/fortran/auto; \
408	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
409	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
410	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
411	for OBJ in $$_p_OBJ; do \
412	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
413	cut -d'(' -f1 | cut -d' ' -f1,3; \
414	done
415# Builds noise routines (not yet publically available)
416# Note:	 libfast cannot run on .F files on certain machines, so we
417# use lib and check for errors here.
418noise: info chkpetsc_dir
419	-@echo "Beginning to compile noise routines"
420	-@echo "========================================="
421	-@cd src/snes/interface/noise; \
422	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib > trashz 2>&1; \
423	  grep -v clog trashz | grep -v "information sections" | \
424	  egrep -i '(Error|warning|Can)' >> /dev/null;\
425	  if [ "$$?" != 1 ]; then \
426	  cat trashz ; fi; ${RM} trashz
427	${RANLIB} ${PDIR}/libpetscsnes.a
428	-@chmod g+w  ${PDIR}/libpetscsnes.a
429	-@echo "Completed compiling noise routines"
430	-@echo "========================================="
431
432