xref: /petsc/makefile (revision a2596bdbc30ea25b67c8aa9d27518270ab3efaa7)
1# $Id: makefile,v 1.187 1997/09/18 01:45:15 bsmith Exp balay $
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# Builds the etags file for examples
372etags_examples:
373	$(RM) TAGS_EXAMPLES
374	etags -f TAGS_EXAMPLES $(TAGS_EXAMPLE_FILES)
375	chmod g+w TAGS_EXAMPLES
376
377#
378# ctags builds the tags file required for VI.
379# To use the tags file do the following:
380# 1. within vi invole the command - :set tags=/home/bsmith/petsc/tags
381#    or add  the command to your ~/.exrc file - set tags=/home/bsmith/petsc/tags
382# 2. now to go to a tag do - :tag TAGNAME for eg - :tag MatCreate
383#
384ctags:
385	$(RM) tags
386	ctags -w -f tags $(TAGS_INCLUDE_FILES)
387	ctags -w -a -f tags $(TAGS_SRC_FILES)
388	ctags -w -a -f tags $(TAGS_EXAMPLE_FILES)
389	ctags -w -a -f tags $(TAGS_MAKEFILE_FILES)
390	ctags -w -a -f tags $(TAGS_BMAKE_FILES)
391	chmod g+w tags
392
393# ------------------------------------------------------------------
394#
395# All remaining actions are intended for PETSc developers only.
396# PETSc users should not generally need to use these commands.
397#
398
399# Builds all versions of the man pages
400allmanpages: allwwwpages alllatexpages
401allwwwpages: deletewwwpages
402	-make ACTION=wwwpages_buildcite tree
403	-cd src/fortran/custom; make wwwpages_buildcite
404	-cd src/fortran/custom; make wwwpages
405	-make ACTION=wwwpages tree
406	-maint/wwwman
407	-maint/examplesindex.tcl -www
408	-maint/htmlkeywords.tcl
409	-@chmod g+w docs/www/man*/*
410
411#This is similar to allwwwpages except -www -> -wwwhome
412#The wwwmanpages built this way can pe placed at PETSc Home Page
413allwwwhomepages: deletewwwpages
414	-make ACTION=wwwpages_buildcite tree
415	-cd src/fortran/custom; make wwwpages_buildcite
416	-cd src/fortran/custom; make wwwpages
417	-make ACTION=wwwpages tree
418	-maint/wwwman
419	-maint/examplesindex.tcl -wwwhome
420	-maint/htmlkeywords.tcl -wwwhome
421	-@chmod g+w docs/www/man*/*
422
423alllatexpages: deletelatexpages
424	-make ACTION=latexpages tree
425	-cd src/fortran/custom; make latexpages
426	-@chmod g+w docs/tex/rsum/*
427
428# Builds Fortran stub files
429allfortranstubs:
430	-@include/finclude/generateincludes
431	-@$(RM) -f src/fortran/auto/*.c
432	-make ACTION=fortranstubs tree
433	chmod g+w src/fortran/auto/*.c
434
435allci:
436	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) ci
437	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=ci  tree
438
439allco:
440	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) co
441	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=co  tree
442
443#
444#   The commands below are for generating ADIC versions of the code;
445# they are not currently used.
446#
447CFLAGS   =  $(CPPFLAGS) $(CONF)
448alladicignore:
449	-@$(RM) $(PDIR)/adicignore
450	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adicignore  tree
451
452alladic:
453	-@echo "Beginning to compile ADIC source code in all directories"
454	-@echo "Using ADIC compiler: $(ADIC_CC) $(CFLAGS)"
455	-@echo "========================================="
456	-@cd include ; \
457           $(ADIC_CC) -s -f 1 $(CFLAGS) petsc.h
458	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
459	-@cd src/inline ; \
460            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
461	-@cd src/adic/blas ; \
462            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
463	-@cd src/adic/lapack ; \
464            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
465
466alladiclib:
467	-@echo "Beginning to compile ADIC libraries in all directories"
468	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
469	-@echo "-----------------------------------------"
470	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
471	-@echo "-----------------------------------------"
472	-@echo "Using configuration flags: $(CONF)"
473	-@echo "-----------------------------------------"
474	-@echo "Using include paths: $(PETSC_INCLUDE)"
475	-@echo "-----------------------------------------"
476	-@echo "Using PETSc directory: $(PETSC_DIR)"
477	-@echo "Using PETSc arch: $(PETSC_ARCH)"
478	-@echo "========================================="
479	-@$(RM) -f  $(PDIR)/*adic.a
480	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
481	-@cd src/adic/blas ; \
482            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adiclib
483	-@cd src/adic/lapack ; \
484            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
485	-@cd src/adic/src ; \
486            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib
487
488# -------------------------------------------------------------------------------
489#
490# Some macros to check if the fortran interface is up-to-date.
491#
492countfortranfunctions:
493	-@cd $(PETSC_DIR)/src/fortran; egrep '^void' custom/*.c auto/*.c | \
494	cut -d'(' -f1 | tr -s '' ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
495	sed "s/_$$//" | sort > /tmp/countfortranfunctions
496
497countcfunctions:
498	-@ grep extern $(PETSC_DIR)/include/*.h *.h | grep "(" | tr -s '' ' ' | \
499	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '' '\012' |  \
500	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
501
502difffortranfunctions: countfortranfunctions countcfunctions
503	-@echo -------------- Functions missing in the fortran interface ---------------------
504	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
505	-@echo ----------------- Functions missing in the C interface ------------------------
506	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
507	-@$(RM)  /tmp/countcfunctions /tmp/countfortranfunctions
508
509checkbadfortranstubs:
510	-@echo "========================================="
511	-@echo "Functions with MPI_Comm as an Argument"
512	-@echo "========================================="
513	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
514	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
515	-@echo "========================================="
516	-@echo "Functions with a String as an Argument"
517	-@echo "========================================="
518	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
519	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
520	-@echo "========================================="
521	-@echo "Functions with Pointers to PETSc Objects as Argument"
522	-@echo "========================================="
523	-@cd $(PETSC_DIR)/src/fortran/auto; \
524	_p_OBJ=`grep _p_ $(PETSC_DIR)/include/*.h | tr -s '' ' ' | \
525	cut -d' ' -f 3 | tr -s '' '\012' | grep -v '{' | cut -d'*' -f1 | \
526	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
527	for OBJ in $$_p_OBJ; do \
528	grep "$$OBJ \*" *.c | tr -s '' ' ' | tr -s ':' ' ' | \
529	cut -d'(' -f1 | cut -d' ' -f1,3; \
530	done
531