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