xref: /petsc/makefile (revision 02ab625ae79bc45e9e37e89987ac6457cedaa9da)
1# $Id: makefile,v 1.186 1997/09/17 04:31:45 bsmith Exp bsmith $
2#
3# This is the makefile for installing PETSc. See the file
4# Installation for directions on installing PETSc.
5# See also bmake/common for additional commands.
6#
7
8CFLAGS	 =
9SOURCEC	 =
10SOURCEF	 =
11DOCS	 = Changes Machines Readme maint/addlinks \
12	   maint/builddist FAQ Installation BugReporting\
13	   maint/buildlinks maint/wwwman maint/xclude maint/crontab\
14	   bmake/common bmake/*/base* maint/autoftp docs/www/sec/* \
15           include/finclude/generateincludes bin/petscviewinfo.text \
16           bin/petscoptsinfo.text
17OBJSC	 =
18OBJSF	 =
19LIBBASE	 = libpetscvec
20DIRS	 = src include docs
21
22include $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base
23
24# Builds PETSc libraries for a given BOPT and architecture
25all: chkpetsc_dir
26	-$(RM) -f $(PDIR)/*
27	-@echo "Beginning to compile libraries in all directories"
28	-@echo On `date` on `hostname`
29	-@echo Machine characteristics: `uname -a`
30	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
31	-@if [ "$(CCV)" != "unknown" ] ; then \
32	  echo "Compiler version:" ; \
33          $(CCV) ; fi
34	-@echo "-----------------------------------------"
35	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
36	-@echo "-----------------------------------------"
37	-@echo "Using configuration flags: $(CONF)"
38	-@echo "-----------------------------------------"
39	-@echo "Using include paths: $(PETSC_INCLUDE)"
40	-@echo "-----------------------------------------"
41	-@echo "Using PETSc directory: $(PETSC_DIR)"
42	-@echo "Using PETSc arch: $(PETSC_ARCH)"
43	-@echo "========================================="
44	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
45	   ACTION=libfast  tree
46	-@cd $(PETSC_DIR)/src/sys/src ; \
47	$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) rs6000_time
48	$(RANLIB) $(PDIR)/*.a
49	-@chmod g+w  $(PDIR)/*.a
50	-@echo "Completed building libraries"
51	-@echo "========================================="
52
53# Builds PETSc test examples for a given BOPT and architecture
54testexamples: chkopts
55	-@echo "Beginning to compile and run test examples"
56	-@echo On `date` on `hostname`
57	-@echo Machine characteristics: `uname -a`
58	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
59	-@echo "-----------------------------------------"
60	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
61	-@echo "-----------------------------------------"
62	-@echo "Using include paths: $(PETSC_INCLUDE)"
63	-@echo "-----------------------------------------"
64	-@echo "Using PETSc directory: $(PETSC_DIR)"
65	-@echo "Using PETSc arch: $(PETSC_ARCH)"
66	-@echo "------------------------------------------"
67	-@echo "Using linker: $(CLINKER)"
68	-@echo "Using libraries: $(PETSC_LIB)"
69	-@echo "------------------------------------------"
70	-@echo "Due to different numerical round-off on certain"
71	-@echo "machines some of the numbers may not match exactly."
72	-@echo "========================================="
73	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
74	   ACTION=testexamples_1  tree
75	-@echo "Completed compiling and running test examples"
76	-@echo "========================================="
77
78# Builds PETSc test examples for a given BOPT and architecture
79testexamples_uni: chkopts
80	-@echo "Beginning to compile and run uniprocessor test examples"
81	-@echo On `date` on `hostname`
82	-@echo Machine characteristics: `uname -a`
83	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
84	-@echo "Using linker: $(CLINKER)"
85	-@echo "------------------------------------------"
86	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
87	-@echo "------------------------------------------"
88	-@echo "Using include paths: $(PETSC_INCLUDE)"
89	-@echo "------------------------------------------"
90	-@echo "Using PETSc directory: $(PETSC_DIR)"
91	-@echo "Using PETSc arch: $(PETSC_ARCH)"
92	-@echo "------------------------------------------"
93	-@echo "Using linker: $(CLINKER)"
94	-@echo "Using libraries: $(PETSC_LIB)"
95	-@echo "------------------------------------------"
96	-@echo "Due to different numerical round-off on certain"
97	-@echo "machines some of the numbers may not match exactly."
98	-@echo "========================================="
99	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
100	   ACTION=testexamples_4  tree
101	-@echo "Completed compiling and running uniprocessor test examples"
102	-@echo "========================================="
103
104#
105# Builds PETSc Fortran interface libary
106# Note:	 libfast cannot run on .F files on certain machines, so we
107# use lib and check for errors here.
108fortran: chkpetsc_dir
109	-$(RM) -f $(PDIR)/libpetscfortran.*
110	-@echo "Beginning to compile Fortran interface library"
111	-@echo On `date` on `hostname`
112	-@echo Machine characteristics: `uname -a`
113	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
114	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
115	-@echo "------------------------------------------"
116	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
117	-@echo "------------------------------------------"
118	-@echo "Using configuration flags: $(CONF)"
119	-@echo "------------------------------------------"
120	-@echo "Using include paths: $(PETSC_INCLUDE)"
121	-@echo "------------------------------------------"
122	-@echo "Using PETSc directory: $(PETSC_DIR)"
123	-@echo "Using PETSc arch: $(PETSC_ARCH)"
124	-@echo "========================================="
125	-@cd src/fortran/custom; \
126	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
127	  grep -v clog trashz | grep -v "information sections" | \
128	  egrep -i '(Error|warning|Can)' >> /dev/null;\
129	  if [ "$$?" != 1 ]; then \
130	  cat trashz ; fi; $(RM) trashz
131	-@cd src/fortran/auto; \
132	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
133	$(RANLIB) $(PDIR)/libpetscfortran.a
134	-@chmod g+w  $(PDIR)/*.a
135	-@echo "Completed compiling Fortran interface library"
136	-@echo "========================================="
137
138#
139# Builds PETSc Fortran kernels; some numerical kernels have
140# a Fortran version that may give better performance on certain
141# machines. It always gives better performance for complex numbers.
142fortrankernels: chkpetsc_dir
143	-$(RM) -f $(PDIR)/libpetsckernels.*
144	-@echo "Beginning to compile Fortran kernels library"
145	-@echo On `date` on `hostname`
146	-@echo Machine characteristics: `uname -a`
147	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
148	-@echo "------------------------------------------"
149	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
150	-@echo "------------------------------------------"
151	-@echo "Using configuration flags: $(CONF)"
152	-@echo "------------------------------------------"
153	-@echo "Using PETSc directory: $(PETSC_DIR)"
154	-@echo "Using PETSc arch: $(PETSC_ARCH)"
155	-@echo "========================================="
156	-@cd src/fortran/kernels; \
157	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib
158	-@chmod g+w  $(PDIR)/*.a
159	-@echo "Completed compiling Fortran kernels library"
160	-@echo "========================================="
161
162# Builds PETSc test examples for a given BOPT and architecture
163testfortran: chkopts
164	-@echo "Beginning to compile and run Fortran test examples"
165	-@echo On `date` on `hostname`
166	-@echo Machine characteristics: `uname -a`
167	-@echo "Using compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
168	-@echo "Using linker: $(FLINKER)"
169	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
170	-@echo "------------------------------------------"
171	-@echo "Using PETSc directory: $(PETSC_DIR)"
172	-@echo "Using PETSc arch: $(PETSC_ARCH)"
173	-@echo "------------------------------------------"
174	-@echo "Using linker: $(FLINKER)"
175	-@echo "Using libraries: $(PETSC_FORTRAN_LIB) $(PETSC_LIB)"
176	-@echo "========================================="
177	-@echo "Due to different numerical round-off on certain"
178	-@echo "machines or the way Fortran formats numbers"
179	-@echo "some of the results may not match exactly."
180	-@echo "========================================="
181	-@echo "On some machines you may get messages of the form"
182	-@echo "PetscScalarAddressToFortran:C and Fortran arrays are"
183	-@echo "not commonly aligned or are too far apart to be indexed"
184	-@echo "by an integer. Locations: C xxxc Fortran xxxf"
185	-@echo "Locations/sizeof(Scalar): C yyc Fortran yyf"
186	-@echo "This indicates that you may not be able to use the"
187	-@echo "PETSc routines VecGetArray() and MatGetArray() from Fortran"
188	-@echo "========================================="
189	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
190	   ACTION=testexamples_3  tree
191	-@echo "Completed compiling and running Fortran test examples"
192	-@echo "========================================="
193#
194# Builds PETSc Fortran90 interface libary
195# Note:	 libfast cannot run on .F files on certain machines, so we
196# use lib and check for errors here.
197# Note: F90 interface currently only supported in NAG F90 compiler
198fortran90: chkpetsc_dir fortran
199	-@echo "Beginning to compile Fortran90 interface library"
200	-@echo On `date` on `hostname`
201	-@echo Machine characteristics: `uname -a`
202	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
203	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
204	-@echo "------------------------------------------"
205	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
206	-@echo "------------------------------------------"
207	-@echo "Using configuration flags: $(CONF)"
208	-@echo "------------------------------------------"
209	-@echo "Using include paths: $(PETSC_INCLUDE)"
210	-@echo "------------------------------------------"
211	-@echo "Using PETSc directory: $(PETSC_DIR)"
212	-@echo "Using PETSc arch: $(PETSC_ARCH)"
213	-@echo "========================================="
214	-@cd src/fortran/f90; \
215	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
216	  grep -v clog trashz | grep -v "information sections" | \
217	  egrep -i '(Error|warning|Can)' >> /dev/null;\
218	  if [ "$$?" != 1 ]; then \
219	  cat trashz ; fi; $(RM) trashz
220	$(RANLIB) $(PDIR)/libpetscfortran.a
221	-@chmod g+w  $(PDIR)/*.a
222	-@echo "Completed compiling Fortran90 interface library"
223	-@echo "========================================="
224
225# Builds noise routines (not yet publically available)
226# Note:	 libfast cannot run on .F files on certain machines, so we
227# use lib and check for errors here.
228noise: chkpetsc_dir
229	-@echo "Beginning to compile noise routines"
230	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
231	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
232	-@echo "------------------------------------------"
233	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
234	-@echo "------------------------------------------"
235	-@echo "Using configuration flags: $(CONF)"
236	-@echo "------------------------------------------"
237	-@echo "Using include paths: $(PETSC_INCLUDE)"
238	-@echo "------------------------------------------"
239	-@echo "Using PETSc directory: $(PETSC_DIR)"
240	-@echo "Using PETSc arch: $(PETSC_ARCH)"
241	-@echo "========================================="
242	-@cd src/snes/interface/noise; \
243	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
244	  grep -v clog trashz | grep -v "information sections" | \
245	  egrep -i '(Error|warning|Can)' >> /dev/null;\
246	  if [ "$$?" != 1 ]; then \
247	  cat trashz ; fi; $(RM) trashz
248	$(RANLIB) $(PDIR)/libpetscsnes.a
249	-@chmod g+w  $(PDIR)/libpetscsnes.a
250	-@echo "Completed compiling noise routines"
251	-@echo "========================================="
252
253petscblas: chkpetsc_dir
254	-$(RM) -f $(PDIR)/libpetscblas.*
255	-@echo "Beginning to compile C version of BLAS and LAPACK"
256	-@echo On `date` on `hostname`
257	-@echo Machine characteristics: `uname -a`
258	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
259	-@echo "------------------------------------------"
260	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
261	-@echo "------------------------------------------"
262	-@echo "Using configuration flags: $(CONF)"
263	-@echo "------------------------------------------"
264	-@echo "Using include paths: $(PETSC_INCLUDE)"
265	-@echo "------------------------------------------"
266	-@echo "Using PETSc directory: $(PETSC_DIR)"
267	-@echo "Using PETSc arch: $(PETSC_ARCH)"
268	-@echo "========================================="
269	-@cd src/adic/blas; \
270	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
271	-@cd src/adic/lapack; \
272	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=libfast tree
273	$(RANLIB) $(PDIR)/libpetscblas.a
274	-@chmod g+w  $(PDIR)/*.a
275	-@echo "Completed compiling C version of BLAS and LAPACK"
276	-@echo "========================================="
277
278
279ranlib:
280	$(RANLIB) $(PDIR)/*.a
281
282# Deletes PETSc libraries
283deletelibs:
284	-$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/*
285
286# Deletes man pages (HTML version)
287deletewwwpages:
288	$(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit \
289	         $(PETSC_DIR)/docs/www/man*.html
290
291# Deletes man pages (LaTeX version)
292deletelatexpages:
293	$(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex
294
295# To access the tags in emacs, type M-x visit-tags-table and specify
296# the file petsc/TAGS.	Then, to move to where a PETSc function is
297# defined, enter M-. and the function name.  To search for a string
298# and move to the first occurrence, use M-x tags-search and the string.
299# To locate later occurrences, use M-,
300
301TAGS_INCLUDE_FILES  = include/*.h include/pinclude/*.h include/FINCLUDE/*.h
302TAGS_BMAKE_FILES    = bmake/common bmake/*/base*
303TAGS_EXAMPLE_FILES  = src/*/examples/*/*.[c,h,F,f] src/*/examples/*/*/*.[c,h,F,f] \
304                      src/benchmarks/*.c src/contrib/*/examples/*/*.[c,h,F,f]
305TAGS_DOC_FILES      = docs/tex/manual/routin.tex docs/tex/manual/manual.tex \
306                      docs/tex/manual/manual_tex.tex docs/tex/manual/intro.tex \
307                      docs/tex/manual/part1.tex docs/tex/manual/part2.tex
308TAGS_SRC_FILES      = src/*/*.[c,h] src/*/interface/*.[c,h] src/*/src/*.[c,h] \
309                      src/*/utils/*.[c,h] \
310                      src/*/impls/*.[c,h] src/*/impls/*/*.[c,h] src/*/impls/*/*/*.[c,h] \
311                      src/gvec/impls/*/*/*/*/*.[c,h] src/contrib/*/*.[c,h] \
312                      src/contrib/*/src/*.[c,h] src/fortran/custom/*.[c,h,F]
313TAGS_MAKEFILE_FILES = include/makefile include/*/makefile \
314                      makefile \
315                      src/makefile src/*/makefile src/*/src/makefile \
316                      src/*/interface/makefile \
317                      src/*/utils/makefile \
318                      src/*/impls/makefile src/*/impls/*/makefile src/*/impls/*/*/makefile \
319                      src/*/examples/makefile src/*/examples/*/makefile src/*/examples/*/*/makefile \
320                      src/gvec/impls/*/*/*/*/makefile src/gvec/impls/*/*/*/makefile \
321                      src/fortran/*/makefile \
322                      src/contrib/*/makefile src/contrib/*/src/makefile \
323                      src/contrib/*/examples/makefile src/contrib/*/examples/*/makefile \
324                      docs/makefile
325
326# Builds all etags files
327alletags:
328	-make etags_complete
329	-make etags
330	-make etags_noexamples
331	-make etags_makefiles
332
333# Builds the basic etags file.	This should be employed by most users.
334etags:
335	$(RM) TAGS
336	etags -f TAGS $(TAGS_INCLUDE_FILES)
337	etags -a -f TAGS $(TAGS_SRC_FILES)
338	etags -a -f TAGS $(TAGS_EXAMPLE_FILES)
339	etags -a -f TAGS $(TAGS_MAKEFILE_FILES)
340	etags -a -f TAGS $(TAGS_BMAKE_FILES)
341	chmod g+w TAGS
342
343# Builds complete etags list; only for PETSc developers.
344etags_complete:
345	$(RM) TAGS_COMPLETE
346	etags -f TAGS_COMPLETE $(TAGS_SRC_FILES)
347	etags -a -f TAGS_COMPLETE $(TAGS_INCLUDE_FILES)
348	etags -a -f TAGS_COMPLETE $(TAGS_EXAMPLE_FILES)
349	etags -a -f TAGS_COMPLETE $(TAGS_MAKEFILE_FILES)
350	etags -a -f TAGS_COMPLETE $(TAGS_BMAKE_FILES)
351	etags -a -f TAGS_COMPLETE $(TAGS_DOC_FILES)
352	chmod g+w TAGS_COMPLETE
353
354# Builds the etags file that excludes the examples directories
355etags_noexamples:
356	$(RM) TAGS_NO_EXAMPLES
357	etags -f TAGS_NO_EXAMPLES $(TAGS_SRC_FILES)
358	etags -a -f TAGS_NO_EXAMPLES $(TAGS_INCLUDE_FILES)
359	etags -a -f TAGS_NO_EXAMPLES $(TAGS_MAKEFILE_FILES)
360	etags -a -f TAGS_NO_EXAMPLES $(TAGS_BMAKE_FILES)
361	etags -a -f TAGS_NO_EXAMPLES $(TAGS_DOC_FILES)
362	chmod g+w TAGS_NO_EXAMPLES
363
364# Builds the etags file for makefiles
365etags_makefiles:
366	$(RM) TAGS_MAKEFILES
367	etags -f TAGS_MAKEFILES $(TAGS_MAKEFILE_FILES)
368	etags -a -f TAGS_MAKEFILES $(TAGS_BMAKE_FILES)
369	chmod g+w TAGS_MAKEFILES
370
371#
372# ctags builds the tags file required for VI.
373# To use the tags file do the following:
374# 1. within vi invole the command - :set tags=/home/bsmith/petsc/tags
375#    or add  the command to your ~/.exrc file - set tags=/home/bsmith/petsc/tags
376# 2. now to go to a tag do - :tag TAGNAME for eg - :tag MatCreate
377#
378ctags:
379	$(RM) tags
380	ctags -w -f tags $(TAGS_INCLUDE_FILES)
381	ctags -w -a -f tags $(TAGS_SRC_FILES)
382	ctags -w -a -f tags $(TAGS_EXAMPLE_FILES)
383	ctags -w -a -f tags $(TAGS_MAKEFILE_FILES)
384	ctags -w -a -f tags $(TAGS_BMAKE_FILES)
385	chmod g+w tags
386
387# ------------------------------------------------------------------
388#
389# All remaining actions are intended for PETSc developers only.
390# PETSc users should not generally need to use these commands.
391#
392
393# Builds all versions of the man pages
394allmanpages: allwwwpages alllatexpages
395allwwwpages: deletewwwpages
396	-make ACTION=wwwpages_buildcite tree
397	-cd src/fortran/custom; make wwwpages_buildcite
398	-cd src/fortran/custom; make wwwpages
399	-make ACTION=wwwpages tree
400	-maint/wwwman
401	-maint/examplesindex.tcl -www
402	-maint/htmlkeywords.tcl
403	-@chmod g+w docs/www/man*/*
404
405#This is similar to allwwwpages except -www -> -wwwhome
406#The wwwmanpages built this way can pe placed at PETSc Home Page
407allwwwhomepages: deletewwwpages
408	-make ACTION=wwwpages_buildcite tree
409	-cd src/fortran/custom; make wwwpages_buildcite
410	-cd src/fortran/custom; make wwwpages
411	-make ACTION=wwwpages tree
412	-maint/wwwman
413	-maint/examplesindex.tcl -wwwhome
414	-maint/htmlkeywords.tcl -wwwhome
415	-@chmod g+w docs/www/man*/*
416
417alllatexpages: deletelatexpages
418	-make ACTION=latexpages tree
419	-cd src/fortran/custom; make latexpages
420	-@chmod g+w docs/tex/rsum/*
421
422# Builds Fortran stub files
423allfortranstubs:
424	-@include/finclude/generateincludes
425	-@$(RM) -f src/fortran/auto/*.c
426	-make ACTION=fortranstubs tree
427	chmod g+w src/fortran/auto/*.c
428
429allci:
430	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) ci
431	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=ci  tree
432
433allco:
434	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) co
435	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=co  tree
436
437#
438#   The commands below are for generating ADIC versions of the code;
439# they are not currently used.
440#
441CFLAGS   =  $(CPPFLAGS) $(CONF)
442alladicignore:
443	-@$(RM) $(PDIR)/adicignore
444	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adicignore  tree
445
446alladic:
447	-@echo "Beginning to compile ADIC source code in all directories"
448	-@echo "Using ADIC compiler: $(ADIC_CC) $(CFLAGS)"
449	-@echo "========================================="
450	-@cd include ; \
451           $(ADIC_CC) -s -f 1 $(CFLAGS) petsc.h
452	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
453	-@cd src/inline ; \
454            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
455	-@cd src/adic/blas ; \
456            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
457	-@cd src/adic/lapack ; \
458            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
459
460alladiclib:
461	-@echo "Beginning to compile ADIC libraries in all directories"
462	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
463	-@echo "-----------------------------------------"
464	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
465	-@echo "-----------------------------------------"
466	-@echo "Using configuration flags: $(CONF)"
467	-@echo "-----------------------------------------"
468	-@echo "Using include paths: $(PETSC_INCLUDE)"
469	-@echo "-----------------------------------------"
470	-@echo "Using PETSc directory: $(PETSC_DIR)"
471	-@echo "Using PETSc arch: $(PETSC_ARCH)"
472	-@echo "========================================="
473	-@$(RM) -f  $(PDIR)/*adic.a
474	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
475	-@cd src/adic/blas ; \
476            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adiclib
477	-@cd src/adic/lapack ; \
478            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
479	-@cd src/adic/src ; \
480            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib
481
482# -------------------------------------------------------------------------------
483#
484# Some macros to check if the fortran interface is up-to-date.
485#
486countfortranfunctions:
487	-@cd $(PETSC_DIR)/src/fortran; egrep '^void' custom/*.c auto/*.c | \
488	cut -d'(' -f1 | tr -s '' ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
489	sed "s/_$$//" | sort > /tmp/countfortranfunctions
490
491countcfunctions:
492	-@ grep extern $(PETSC_DIR)/include/*.h *.h | grep "(" | tr -s '' ' ' | \
493	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '' '\012' |  \
494	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
495
496difffortranfunctions: countfortranfunctions countcfunctions
497	-@echo -------------- Functions missing in the fortran interface ---------------------
498	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
499	-@echo ----------------- Functions missing in the C interface ------------------------
500	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
501	-@$(RM)  /tmp/countcfunctions /tmp/countfortranfunctions
502
503checkbadfortranstubs:
504	-@echo "========================================="
505	-@echo "Functions with MPI_Comm as an Argument"
506	-@echo "========================================="
507	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
508	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
509	-@echo "========================================="
510	-@echo "Functions with a String as an Argument"
511	-@echo "========================================="
512	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
513	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
514	-@echo "========================================="
515	-@echo "Functions with Pointers to PETSc Objects as Argument"
516	-@echo "========================================="
517	-@cd $(PETSC_DIR)/src/fortran/auto; \
518	_p_OBJ=`grep _p_ $(PETSC_DIR)/include/*.h | tr -s '' ' ' | \
519	cut -d' ' -f 3 | tr -s '' '\012' | grep -v '{' | cut -d'*' -f1 | \
520	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
521	for OBJ in $$_p_OBJ; do \
522	grep "$$OBJ \*" *.c | tr -s '' ' ' | tr -s ':' ' ' | \
523	cut -d'(' -f1 | cut -d' ' -f1,3; \
524	done
525