xref: /petsc/makefile (revision 66341c5d82590c1abea31a9b2b364ca66f0f507e)
1*66341c5dSSatish Balay# $Id: makefile,v 1.180 1997/08/19 15:46:31 bsmith Exp balay $
211b6ed10SLois Curfman McInnes#
3cfd69a58SBarry Smith# This is the makefile for installing PETSc. See the file
4cfd69a58SBarry Smith# Installation for directions on installing PETSc.
5cfd69a58SBarry Smith# See also bmake/common for additional commands.
611b6ed10SLois Curfman McInnes#
711b6ed10SLois Curfman McInnes
8ab94cc7aSSatish BalayCFLAGS	 =
961523587SBarry SmithSOURCEC	 =
1061523587SBarry SmithSOURCEF	 =
115eea60f9SBarry SmithDOCS	 = Changes Machines Readme maint/addlinks \
1243a90d84SBarry Smith	   maint/builddist FAQ Installation BugReporting\
13deb7fc1cSBarry Smith	   maint/buildlinks maint/wwwman maint/xclude maint/crontab\
14630a6785SBarry Smith	   bmake/common bmake/*/base* maint/autoftp docs/www/sec/* \
15630a6785SBarry Smith           include/finclude/generateincludes bin/petscviewinfo.text \
16630a6785SBarry Smith           bin/petscoptsinfo.text
1761523587SBarry SmithOBJSC	 =
1861523587SBarry SmithOBJSF	 =
1961523587SBarry SmithLIBBASE	 = libpetscvec
20b16a3bb1SBarry SmithDIRS	 = src include docs
2161523587SBarry Smith
224e627d3aSBarry Smithinclude $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base
2361523587SBarry Smith
2411b6ed10SLois Curfman McInnes# Builds PETSc libraries for a given BOPT and architecture
257857610eSBarry Smithall: chkpetsc_dir
26511caf8eSSatish Balay	-$(RM) -f $(PDIR)/*
270b3634f8SBarry Smith	-@echo "Beginning to compile libraries in all directories"
281d91fb6eSBarry Smith	-@echo On `date` on `hostname`
2930fdcc7aSBarry Smith	-@echo Machine characteristics: `uname -a`
3047794344SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
3147794344SBarry Smith	-@echo "-----------------------------------------"
32b14e8f29SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
3347794344SBarry Smith	-@echo "-----------------------------------------"
34b14e8f29SBarry Smith	-@echo "Using configuration flags: $(CONF)"
3547794344SBarry Smith	-@echo "-----------------------------------------"
36b14e8f29SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
3747794344SBarry Smith	-@echo "-----------------------------------------"
38c2c9bc36SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
39c2c9bc36SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
4047794344SBarry Smith	-@echo "========================================="
41e35bd481SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
42f3848965SBarry Smith	   ACTION=libfast  tree
43f88f42abSSatish Balay	-@cd $(PETSC_DIR)/src/sys/src ; \
44f88f42abSSatish Balay	$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) rs6000_time
454e04c1a0SBarry Smith	$(RANLIB) $(PDIR)/*.a
460be1b381SSatish Balay	-@chmod g+w  $(PDIR)/*.a
470b3634f8SBarry Smith	-@echo "Completed building libraries"
4847794344SBarry Smith	-@echo "========================================="
490b3634f8SBarry Smith
500b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture
51a9369724SSatish Balaytestexamples: chkopts
520b3634f8SBarry Smith	-@echo "Beginning to compile and run test examples"
531d91fb6eSBarry Smith	-@echo On `date` on `hostname`
5447794344SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
5547794344SBarry Smith	-@echo "-----------------------------------------"
56b14e8f29SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
5747794344SBarry Smith	-@echo "-----------------------------------------"
58b14e8f29SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
5947794344SBarry Smith	-@echo "-----------------------------------------"
60c2c9bc36SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
61c2c9bc36SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
62c2c9bc36SBarry Smith	-@echo "------------------------------------------"
639c69534bSBarry Smith	-@echo "Using linker: $(CLINKER)"
649c69534bSBarry Smith	-@echo "Using libraries: $(PETSC_LIB)"
650b3634f8SBarry Smith	-@echo "------------------------------------------"
66eb817c50SBarry Smith	-@echo "Due to different numerical round-off on certain"
67eb817c50SBarry Smith	-@echo "machines some of the numbers may not match exactly."
6847794344SBarry Smith	-@echo "========================================="
690b3634f8SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
700b3634f8SBarry Smith	   ACTION=testexamples_1  tree
710b3634f8SBarry Smith	-@echo "Completed compiling and running test examples"
7247794344SBarry Smith	-@echo "========================================="
730b3634f8SBarry Smith
740b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture
75a9369724SSatish Balaytestexamples_uni: chkopts
768475343bSBarry Smith	-@echo "Beginning to compile and run uniprocessor test examples"
771d91fb6eSBarry Smith	-@echo On `date` on `hostname`
7847794344SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
798475343bSBarry Smith	-@echo "Using linker: $(CLINKER)"
8047794344SBarry Smith	-@echo "------------------------------------------"
81b14e8f29SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
8247794344SBarry Smith	-@echo "------------------------------------------"
83b14e8f29SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
8447794344SBarry Smith	-@echo "------------------------------------------"
85d6db1478SLois Curfman McInnes	-@echo "Using PETSc directory: $(PETSC_DIR)"
86d6db1478SLois Curfman McInnes	-@echo "Using PETSc arch: $(PETSC_ARCH)"
87d6db1478SLois Curfman McInnes	-@echo "------------------------------------------"
88d6db1478SLois Curfman McInnes	-@echo "Using linker: $(CLINKER)"
898475343bSBarry Smith	-@echo "Using libraries: $(PETSC_LIB)"
908475343bSBarry Smith	-@echo "------------------------------------------"
918475343bSBarry Smith	-@echo "Due to different numerical round-off on certain"
928475343bSBarry Smith	-@echo "machines some of the numbers may not match exactly."
9347794344SBarry Smith	-@echo "========================================="
948475343bSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
958475343bSBarry Smith	   ACTION=testexamples_4  tree
968475343bSBarry Smith	-@echo "Completed compiling and running uniprocessor test examples"
9747794344SBarry Smith	-@echo "========================================="
988475343bSBarry Smith
9935ca7349SBarry Smith#
10011b6ed10SLois Curfman McInnes# Builds PETSc Fortran interface libary
10111b6ed10SLois Curfman McInnes# Note:	 libfast cannot run on .F files on certain machines, so we
10235ca7349SBarry Smith# use lib and check for errors here.
10383f0b094SBarry Smithfortran: chkpetsc_dir
104727c161cSBarry Smith	-$(RM) -f $(PDIR)/libpetscfortran.*
1050b3634f8SBarry Smith	-@echo "Beginning to compile Fortran interface library"
1061d91fb6eSBarry Smith	-@echo On `date` on `hostname`
10726de76a5SSatish Balay	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
10847794344SBarry Smith	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
10947794344SBarry Smith	-@echo "------------------------------------------"
110fc939babSLois Curfman McInnes	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
11147794344SBarry Smith	-@echo "------------------------------------------"
112fc939babSLois Curfman McInnes	-@echo "Using configuration flags: $(CONF)"
11347794344SBarry Smith	-@echo "------------------------------------------"
114fc939babSLois Curfman McInnes	-@echo "Using include paths: $(PETSC_INCLUDE)"
11547794344SBarry Smith	-@echo "------------------------------------------"
116d6db1478SLois Curfman McInnes	-@echo "Using PETSc directory: $(PETSC_DIR)"
117d6db1478SLois Curfman McInnes	-@echo "Using PETSc arch: $(PETSC_ARCH)"
11847794344SBarry Smith	-@echo "========================================="
119b16a3bb1SBarry Smith	-@cd src/fortran/custom; \
12035ca7349SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
12135ca7349SBarry Smith	  grep -v clog trashz | grep -v "information sections" | \
12235ca7349SBarry Smith	  egrep -i '(Error|warning|Can)' >> /dev/null;\
12335ca7349SBarry Smith	  if [ "$$?" != 1 ]; then \
12435ca7349SBarry Smith	  cat trashz ; fi; $(RM) trashz
125b16a3bb1SBarry Smith	-@cd src/fortran/auto; \
12635ca7349SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
12783f0b094SBarry Smith	$(RANLIB) $(PDIR)/libpetscfortran.a
1280be1b381SSatish Balay	-@chmod g+w  $(PDIR)/*.a
1290b3634f8SBarry Smith	-@echo "Completed compiling Fortran interface library"
13047794344SBarry Smith	-@echo "========================================="
13183f0b094SBarry Smith
132727c161cSBarry Smith# Builds PETSc test examples for a given BOPT and architecture
133a9369724SSatish Balaytestfortran: chkopts
134727c161cSBarry Smith	-@echo "Beginning to compile and run Fortran test examples"
1351d91fb6eSBarry Smith	-@echo On `date` on `hostname`
136727c161cSBarry Smith	-@echo "Using compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
137727c161cSBarry Smith	-@echo "Using linker: $(FLINKER)"
138727c161cSBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
13947794344SBarry Smith	-@echo "------------------------------------------"
140727c161cSBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
141727c161cSBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
142727c161cSBarry Smith	-@echo "------------------------------------------"
143727c161cSBarry Smith	-@echo "Using linker: $(FLINKER)"
144727c161cSBarry Smith	-@echo "Using libraries: $(PETSC_FORTRAN_LIB) $(PETSC_LIB)"
14547794344SBarry Smith	-@echo "========================================="
146e4ef9893SBarry Smith	-@echo "Due to different numerical round-off on certain"
147e4ef9893SBarry Smith	-@echo "machines or the way Fortran formats numbers"
148e4ef9893SBarry Smith	-@echo "some of the results may not match exactly."
149e4ef9893SBarry Smith	-@echo "========================================="
150e4ef9893SBarry Smith	-@echo "On some machines you may get messages of the form"
151e4ef9893SBarry Smith	-@echo "PetscScalarAddressToFortran:C and Fortran arrays are"
152e4ef9893SBarry Smith	-@echo "not commonly aligned or are too far apart to be indexed"
153e4ef9893SBarry Smith	-@echo "by an integer. Locations: C xxxc Fortran xxxf"
154e4ef9893SBarry Smith	-@echo "Locations/sizeof(Scalar): C yyc Fortran yyf"
155e4ef9893SBarry Smith	-@echo "This indicates that you may not be able to use the"
156e4ef9893SBarry Smith	-@echo "PETSc routines VecGetArray() and MatGetArray() from Fortran"
157e4ef9893SBarry Smith	-@echo "========================================="
158727c161cSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
159727c161cSBarry Smith	   ACTION=testexamples_3  tree
160727c161cSBarry Smith	-@echo "Completed compiling and running Fortran test examples"
16147794344SBarry Smith	-@echo "========================================="
162b1f85764SBarry Smith#
163b1f85764SBarry Smith# Builds PETSc Fortran90 interface libary
164b1f85764SBarry Smith# Note:	 libfast cannot run on .F files on certain machines, so we
165b1f85764SBarry Smith# use lib and check for errors here.
166b1f85764SBarry Smith# Note: F90 interface currently only supported in NAG F90 compiler
167d7f8d646SSatish Balayfortran90: chkpetsc_dir fortran
168b1f85764SBarry Smith	-@echo "Beginning to compile Fortran90 interface library"
1691d91fb6eSBarry Smith	-@echo On `date` on `hostname`
170b1f85764SBarry Smith	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
171b1f85764SBarry Smith	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
172b1f85764SBarry Smith	-@echo "------------------------------------------"
173b1f85764SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
174b1f85764SBarry Smith	-@echo "------------------------------------------"
175b1f85764SBarry Smith	-@echo "Using configuration flags: $(CONF)"
176b1f85764SBarry Smith	-@echo "------------------------------------------"
177b1f85764SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
178b1f85764SBarry Smith	-@echo "------------------------------------------"
179b1f85764SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
180b1f85764SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
181b1f85764SBarry Smith	-@echo "========================================="
182b1f85764SBarry Smith	-@cd src/fortran/f90; \
183b1f85764SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
184b1f85764SBarry Smith	  grep -v clog trashz | grep -v "information sections" | \
185b1f85764SBarry Smith	  egrep -i '(Error|warning|Can)' >> /dev/null;\
186b1f85764SBarry Smith	  if [ "$$?" != 1 ]; then \
187b1f85764SBarry Smith	  cat trashz ; fi; $(RM) trashz
188b1f85764SBarry Smith	$(RANLIB) $(PDIR)/libpetscfortran.a
1890be1b381SSatish Balay	-@chmod g+w  $(PDIR)/*.a
190b1f85764SBarry Smith	-@echo "Completed compiling Fortran90 interface library"
191b1f85764SBarry Smith	-@echo "========================================="
192b1f85764SBarry Smith
193ad96cc0dSLois Curfman McInnes# Builds noise routines (not yet publically available)
194ad96cc0dSLois Curfman McInnes# Note:	 libfast cannot run on .F files on certain machines, so we
195ad96cc0dSLois Curfman McInnes# use lib and check for errors here.
196ad96cc0dSLois Curfman McInnesnoise: chkpetsc_dir
197ad96cc0dSLois Curfman McInnes	-@echo "Beginning to compile noise routines"
198ad96cc0dSLois Curfman McInnes	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
199ad96cc0dSLois Curfman McInnes	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
200ad96cc0dSLois Curfman McInnes	-@echo "------------------------------------------"
201ad96cc0dSLois Curfman McInnes	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
202ad96cc0dSLois Curfman McInnes	-@echo "------------------------------------------"
203ad96cc0dSLois Curfman McInnes	-@echo "Using configuration flags: $(CONF)"
204ad96cc0dSLois Curfman McInnes	-@echo "------------------------------------------"
205ad96cc0dSLois Curfman McInnes	-@echo "Using include paths: $(PETSC_INCLUDE)"
206ad96cc0dSLois Curfman McInnes	-@echo "------------------------------------------"
207ad96cc0dSLois Curfman McInnes	-@echo "Using PETSc directory: $(PETSC_DIR)"
208ad96cc0dSLois Curfman McInnes	-@echo "Using PETSc arch: $(PETSC_ARCH)"
209ad96cc0dSLois Curfman McInnes	-@echo "========================================="
210ad96cc0dSLois Curfman McInnes	-@cd src/snes/interface/noise; \
211ad96cc0dSLois Curfman McInnes	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
212ad96cc0dSLois Curfman McInnes	  grep -v clog trashz | grep -v "information sections" | \
213ad96cc0dSLois Curfman McInnes	  egrep -i '(Error|warning|Can)' >> /dev/null;\
214ad96cc0dSLois Curfman McInnes	  if [ "$$?" != 1 ]; then \
215ad96cc0dSLois Curfman McInnes	  cat trashz ; fi; $(RM) trashz
216ad96cc0dSLois Curfman McInnes	$(RANLIB) $(PDIR)/libpetscsnes.a
217ad96cc0dSLois Curfman McInnes	-@chmod g+w  $(PDIR)/libpetscsnes.a
218ad96cc0dSLois Curfman McInnes	-@echo "Completed compiling noise routines"
219ad96cc0dSLois Curfman McInnes	-@echo "========================================="
220ad96cc0dSLois Curfman McInnes
221*66341c5dSSatish Balaypetscblas: chkpetsc_dir
222*66341c5dSSatish Balay	-$(RM) -f $(PDIR)/libpetscblas.*
223*66341c5dSSatish Balay	-@echo "Beginning to compile CBLAS and CLAPACK"
224*66341c5dSSatish Balay	-@echo On `date` on `hostname`
225*66341c5dSSatish Balay	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
226*66341c5dSSatish Balay	-@echo "------------------------------------------"
227*66341c5dSSatish Balay	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
228*66341c5dSSatish Balay	-@echo "------------------------------------------"
229*66341c5dSSatish Balay	-@echo "Using configuration flags: $(CONF)"
230*66341c5dSSatish Balay	-@echo "------------------------------------------"
231*66341c5dSSatish Balay	-@echo "Using include paths: $(PETSC_INCLUDE)"
232*66341c5dSSatish Balay	-@echo "------------------------------------------"
233*66341c5dSSatish Balay	-@echo "Using PETSc directory: $(PETSC_DIR)"
234*66341c5dSSatish Balay	-@echo "Using PETSc arch: $(PETSC_ARCH)"
235*66341c5dSSatish Balay	-@echo "========================================="
236*66341c5dSSatish Balay	-@cd src/adic/blas; \
237*66341c5dSSatish Balay	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
238*66341c5dSSatish Balay	-@cd src/adic/lapack; \
239*66341c5dSSatish Balay	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=libfast tree
240*66341c5dSSatish Balay	$(RANLIB) $(PDIR)/libpetscblas.a
241*66341c5dSSatish Balay	-@chmod g+w  $(PDIR)/*.a
242*66341c5dSSatish Balay	-@echo "Completed compiling CBLAS and CLAPACK"
243*66341c5dSSatish Balay	-@echo "========================================="
244*66341c5dSSatish Balay
245ad96cc0dSLois Curfman McInnes
2468c37ef55SBarry Smithranlib:
2474e04c1a0SBarry Smith	$(RANLIB) $(PDIR)/*.a
24861523587SBarry Smith
24911b6ed10SLois Curfman McInnes# Deletes PETSc libraries
25061523587SBarry Smithdeletelibs:
2514e04c1a0SBarry Smith	-$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/*
252d44968ceSBarry Smith
25311b6ed10SLois Curfman McInnes# Deletes man pages (HTML version)
254b346654fSBarry Smithdeletewwwpages:
255dea827f2SLois Curfman McInnes	$(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit \
256dea827f2SLois Curfman McInnes	         $(PETSC_DIR)/docs/www/man*.html
257b346654fSBarry Smith
25811b6ed10SLois Curfman McInnes# Deletes man pages (LaTeX version)
259b346654fSBarry Smithdeletelatexpages:
2607857610eSBarry Smith	$(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex
26120563c6bSBarry Smith
2627acb7333SLois Curfman McInnes# To access the tags in emacs, type M-x visit-tags-table and specify
2637acb7333SLois Curfman McInnes# the file petsc/TAGS.	Then, to move to where a PETSc function is
2647acb7333SLois Curfman McInnes# defined, enter M-. and the function name.  To search for a string
2657acb7333SLois Curfman McInnes# and move to the first occurrence, use M-x tags-search and the string.
2667acb7333SLois Curfman McInnes# To locate later occurrences, use M-,
2677acb7333SLois Curfman McInnes
268b38bb785SSatish BalayTAGS_INCLUDE_FILES  = include/*.h include/pinclude/*.h include/FINCLUDE/*.h
269b38bb785SSatish BalayTAGS_BMAKE_FILES    = bmake/common bmake/*/base*
270b38bb785SSatish BalayTAGS_EXAMPLE_FILES  = src/*/examples/*/*.[c,h,F,f] src/*/examples/*/*/*.[c,h,F,f] \
271b38bb785SSatish Balay                      src/benchmarks/*.c src/contrib/*/examples/*/*.[c,h,F,f]
272b38bb785SSatish BalayTAGS_DOC_FILES      = docs/tex/manual/routin.tex docs/tex/manual/manual.tex \
273b38bb785SSatish Balay                      docs/tex/manual/manual_tex.tex docs/tex/manual/intro.tex \
274b38bb785SSatish Balay                      docs/tex/manual/part1.tex docs/tex/manual/part2.tex
2754431cf12SSatish BalayTAGS_SRC_FILES      = src/*/*.[c,h] src/*/interface/*.[c,h] src/*/src/*.[c,h] \
276b38bb785SSatish Balay                      src/*/utils/*.[c,h] \
277b38bb785SSatish Balay                      src/*/impls/*.[c,h] src/*/impls/*/*.[c,h] src/*/impls/*/*/*.[c,h] \
278b334301eSBarry Smith                      src/gvec/impls/*/*/*/*/*.[c,h] src/contrib/*/*.[c,h] \
279b334301eSBarry Smith                      src/contrib/*/src/*.[c,h] src/fortran/custom/*.[c,h,F]
280b38bb785SSatish BalayTAGS_MAKEFILE_FILES = include/makefile include/*/makefile \
281b38bb785SSatish Balay                      makefile \
282b38bb785SSatish Balay                      src/makefile src/*/makefile src/*/src/makefile \
283b38bb785SSatish Balay                      src/*/interface/makefile \
284b38bb785SSatish Balay                      src/*/utils/makefile \
285b38bb785SSatish Balay                      src/*/impls/makefile src/*/impls/*/makefile src/*/impls/*/*/makefile \
286b38bb785SSatish Balay                      src/*/examples/makefile src/*/examples/*/makefile src/*/examples/*/*/makefile \
287b38bb785SSatish Balay                      src/gvec/impls/*/*/*/*/makefile src/gvec/impls/*/*/*/makefile \
288b38bb785SSatish Balay                      src/fortran/*/makefile \
289b38bb785SSatish Balay                      src/contrib/*/makefile src/contrib/*/src/makefile \
290b38bb785SSatish Balay                      src/contrib/*/examples/makefile src/contrib/*/examples/*/makefile \
291b38bb785SSatish Balay                      docs/makefile
292b38bb785SSatish Balay
29311b6ed10SLois Curfman McInnes# Builds all etags files
29411b6ed10SLois Curfman McInnesalletags:
2959ae7ee0fSLois Curfman McInnes	-make etags_complete
29611b6ed10SLois Curfman McInnes	-make etags
29711b6ed10SLois Curfman McInnes	-make etags_noexamples
29811b6ed10SLois Curfman McInnes	-make etags_makefiles
29911b6ed10SLois Curfman McInnes
30011b6ed10SLois Curfman McInnes# Builds the basic etags file.	This should be employed by most users.
30120563c6bSBarry Smithetags:
302edd2f0e1SBarry Smith	$(RM) TAGS
303b38bb785SSatish Balay	etags -f TAGS $(TAGS_INCLUDE_FILES)
304b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_SRC_FILES)
305b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_EXAMPLE_FILES)
306b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_MAKEFILE_FILES)
307b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_BMAKE_FILES)
30828988994SBarry Smith	chmod g+w TAGS
309bfce26a3SBarry Smith
31029cdf679SBarry Smith# Builds complete etags list; only for PETSc developers.
31129cdf679SBarry Smithetags_complete:
31229cdf679SBarry Smith	$(RM) TAGS_COMPLETE
3139ca56a1bSSatish Balay	etags -f TAGS_COMPLETE $(TAGS_SRC_FILES)
3149ca56a1bSSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_INCLUDE_FILES)
315b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_EXAMPLE_FILES)
316b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_MAKEFILE_FILES)
317b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_BMAKE_FILES)
318b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_DOC_FILES)
31929cdf679SBarry Smith	chmod g+w TAGS_COMPLETE
32029cdf679SBarry Smith
32111b6ed10SLois Curfman McInnes# Builds the etags file that excludes the examples directories
322bfce26a3SBarry Smithetags_noexamples:
323bfce26a3SBarry Smith	$(RM) TAGS_NO_EXAMPLES
3249ca56a1bSSatish Balay	etags -f TAGS_NO_EXAMPLES $(TAGS_SRC_FILES)
3259ca56a1bSSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_INCLUDE_FILES)
326b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_MAKEFILE_FILES)
327b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_BMAKE_FILES)
328b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_DOC_FILES)
329bfce26a3SBarry Smith	chmod g+w TAGS_NO_EXAMPLES
330b16a3bb1SBarry Smith
33111b6ed10SLois Curfman McInnes# Builds the etags file for makefiles
332b16a3bb1SBarry Smithetags_makefiles:
333b16a3bb1SBarry Smith	$(RM) TAGS_MAKEFILES
334b38bb785SSatish Balay	etags -f TAGS_MAKEFILES $(TAGS_MAKEFILE_FILES)
335b38bb785SSatish Balay	etags -a -f TAGS_MAKEFILES $(TAGS_BMAKE_FILES)
336b16a3bb1SBarry Smith	chmod g+w TAGS_MAKEFILES
33711b6ed10SLois Curfman McInnes
338b38bb785SSatish Balay#
339b38bb785SSatish Balay# ctags builds the tags file required for VI.
340b38bb785SSatish Balay# To use the tags file do the following:
341b38bb785SSatish Balay# 1. within vi invole the command - :set tags=/home/bsmith/petsc/tags
342b38bb785SSatish Balay#    or add  the command to your ~/.exrc file - set tags=/home/bsmith/petsc/tags
343b38bb785SSatish Balay# 2. now to go to a tag do - :tag TAGNAME for eg - :tag MatCreate
344b38bb785SSatish Balay#
345b38bb785SSatish Balayctags:
346b38bb785SSatish Balay	$(RM) tags
347b8319b70SSatish Balay	ctags -w -f tags $(TAGS_INCLUDE_FILES)
348b8319b70SSatish Balay	ctags -w -a -f tags $(TAGS_SRC_FILES)
349b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_EXAMPLE_FILES)
350b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_MAKEFILE_FILES)
351b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_BMAKE_FILES)
352b38bb785SSatish Balay	chmod g+w tags
353b38bb785SSatish Balay
35411b6ed10SLois Curfman McInnes# ------------------------------------------------------------------
35511b6ed10SLois Curfman McInnes#
35611b6ed10SLois Curfman McInnes# All remaining actions are intended for PETSc developers only.
35711b6ed10SLois Curfman McInnes# PETSc users should not generally need to use these commands.
35811b6ed10SLois Curfman McInnes#
35911b6ed10SLois Curfman McInnes
36011b6ed10SLois Curfman McInnes# Builds all versions of the man pages
361956e605aSBarry Smithallmanpages: allwwwpages alllatexpages
362dea827f2SLois Curfman McInnesallwwwpages: deletewwwpages
363299192b9SLois Curfman McInnes	-make ACTION=wwwpages_buildcite tree
364c3e30b67SBarry Smith	-cd src/fortran/custom; make wwwpages_buildcite
365c3e30b67SBarry Smith	-cd src/fortran/custom; make wwwpages
366dea827f2SLois Curfman McInnes	-make ACTION=wwwpages tree
367dea827f2SLois Curfman McInnes	-maint/wwwman
3689921e35aSSatish Balay	-maint/examplesindex.tcl -www
369f8cfbf3fSSatish Balay	-maint/htmlkeywords.tcl
37051c61065SBarry Smith	-@chmod g+w docs/www/man*/*
371e01137a2SSatish Balay
372e01137a2SSatish Balay#This is similar to allwwwpages except -www -> -wwwhome
373e01137a2SSatish Balay#The wwwmanpages built this way can pe placed at PETSc Home Page
374e01137a2SSatish Balayallwwwhomepages: deletewwwpages
375e01137a2SSatish Balay	-make ACTION=wwwpages_buildcite tree
376e01137a2SSatish Balay	-cd src/fortran/custom; make wwwpages_buildcite
377e01137a2SSatish Balay	-cd src/fortran/custom; make wwwpages
378e01137a2SSatish Balay	-make ACTION=wwwpages tree
379e01137a2SSatish Balay	-maint/wwwman
380e01137a2SSatish Balay	-maint/examplesindex.tcl -wwwhome
38184047b72SSatish Balay	-maint/htmlkeywords.tcl -wwwhome
382e01137a2SSatish Balay	-@chmod g+w docs/www/man*/*
383e01137a2SSatish Balay
384416022c9SBarry Smithalllatexpages: deletelatexpages
385416022c9SBarry Smith	-make ACTION=latexpages tree
386c3e30b67SBarry Smith	-cd src/fortran/custom; make latexpages
38751c61065SBarry Smith	-@chmod g+w docs/tex/rsum/*
388416022c9SBarry Smith
38911b6ed10SLois Curfman McInnes# Builds Fortran stub files
39011b6ed10SLois Curfman McInnesallfortranstubs:
39135aab85fSBarry Smith	-@include/finclude/generateincludes
3920a0eb2c5SBarry Smith	-@$(RM) -f src/fortran/auto/*.c
39311b6ed10SLois Curfman McInnes	-make ACTION=fortranstubs tree
3940a0eb2c5SBarry Smith	chmod g+w src/fortran/auto/*.c
395f6ff2982SSatish Balay
396d55938c2SBarry Smithallci:
397d55938c2SBarry Smith	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) ci
398b951964fSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=ci  tree
399b951964fSBarry Smith
400d55938c2SBarry Smithallco:
401d55938c2SBarry Smith	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) co
402d55938c2SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=co  tree
403d55938c2SBarry Smith
404b334301eSBarry Smith#
405b334301eSBarry Smith#   The commands below are for generating ADIC versions of the code;
406b334301eSBarry Smith# they are not currently used.
407b334301eSBarry Smith#
408b334301eSBarry SmithCFLAGS   =  $(CPPFLAGS) $(CONF)
4095eea60f9SBarry Smithalladicignore:
4105eea60f9SBarry Smith	-@$(RM) $(PDIR)/adicignore
4115eea60f9SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adicignore  tree
4125eea60f9SBarry Smith
4135eea60f9SBarry Smithalladic:
414d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC source code in all directories"
415d18b0ea7SBarry Smith	-@echo "Using ADIC compiler: $(ADIC_CC) $(CFLAGS)"
416d18b0ea7SBarry Smith	-@echo "========================================="
41747794344SBarry Smith	-@cd include ; \
418f218b1c0SBarry Smith           $(ADIC_CC) -s -f 1 $(CFLAGS) petsc.h
419ba8edd79SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
42047794344SBarry Smith	-@cd src/inline ; \
42147794344SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
4227e351921SBarry Smith	-@cd src/adic/blas ; \
4237e351921SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
4247e351921SBarry Smith	-@cd src/adic/lapack ; \
425e1063516SSatish Balay            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
4266e81b665SBarry Smith
42747794344SBarry Smithalladiclib:
428d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC libraries in all directories"
429d18b0ea7SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
430d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
431d18b0ea7SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
432d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
433d18b0ea7SBarry Smith	-@echo "Using configuration flags: $(CONF)"
434d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
435d18b0ea7SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
436d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
437d18b0ea7SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
438d18b0ea7SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
439d18b0ea7SBarry Smith	-@echo "========================================="
440f218b1c0SBarry Smith	-@$(RM) -f  $(PDIR)/*adic.a
44147794344SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
4427e351921SBarry Smith	-@cd src/adic/blas ; \
4437e351921SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adiclib
4447e351921SBarry Smith	-@cd src/adic/lapack ; \
445e1063516SSatish Balay            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
4467e351921SBarry Smith	-@cd src/adic/src ; \
447cb3b3f49SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib
4485eea60f9SBarry Smith
4499e417c50SSatish Balay# -------------------------------------------------------------------------------
4509e417c50SSatish Balay#
4519e417c50SSatish Balay# Some macros to check if the fortran interface is up-to-date.
4529e417c50SSatish Balay#
4539e417c50SSatish Balaycountfortranfunctions:
4549e417c50SSatish Balay	-@cd $(PETSC_DIR)/src/fortran; egrep '^void' custom/*.c auto/*.c | \
4559e417c50SSatish Balay	cut -d'(' -f1 | tr -s '' ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
4569e417c50SSatish Balay	sed "s/_$$//" | sort > /tmp/countfortranfunctions
457b334301eSBarry Smith
4589e417c50SSatish Balaycountcfunctions:
4599e417c50SSatish Balay	-@ grep extern $(PETSC_DIR)/include/*.h *.h | grep "(" | tr -s '' ' ' | \
4609e417c50SSatish Balay	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '' '\012' |  \
4619e417c50SSatish Balay	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
4629e417c50SSatish Balay
4639e417c50SSatish Balaydifffortranfunctions: countfortranfunctions countcfunctions
4649e417c50SSatish Balay	-@echo -------------- Functions missing in the fortran interface ---------------------
4659e417c50SSatish Balay	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
4669e417c50SSatish Balay	-@echo ----------------- Functions missing in the C interface ------------------------
4679e417c50SSatish Balay	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
4689e417c50SSatish Balay	-@$(RM)  /tmp/countcfunctions /tmp/countfortranfunctions
469b334301eSBarry Smith
4703f4c9a3aSSatish Balaycheckbadfortranstubs:
4713f4c9a3aSSatish Balay	-@echo "========================================="
4723f4c9a3aSSatish Balay	-@echo "Functions with MPI_Comm as an Argument"
4733f4c9a3aSSatish Balay	-@echo "========================================="
4743f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
4753f4c9a3aSSatish Balay	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
4763f4c9a3aSSatish Balay	-@echo "========================================="
4773f4c9a3aSSatish Balay	-@echo "Functions with a String as an Argument"
4783f4c9a3aSSatish Balay	-@echo "========================================="
4793f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
4803f4c9a3aSSatish Balay	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
4813f4c9a3aSSatish Balay	-@echo "========================================="
4823f4c9a3aSSatish Balay	-@echo "Functions with Pointers to PETSc Objects as Argument"
4833f4c9a3aSSatish Balay	-@echo "========================================="
4843f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; \
4853f4c9a3aSSatish Balay	_p_OBJ=`grep _p_ $(PETSC_DIR)/include/*.h | tr -s '' ' ' | \
4863f4c9a3aSSatish Balay	cut -d' ' -f 3 | tr -s '' '\012' | grep -v '{' | cut -d'*' -f1 | \
4873f4c9a3aSSatish Balay	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
4883f4c9a3aSSatish Balay	for OBJ in $$_p_OBJ; do \
4893f4c9a3aSSatish Balay	grep "$$OBJ \*" *.c | tr -s '' ' ' | tr -s ':' ' ' | \
4903f4c9a3aSSatish Balay	cut -d'(' -f1 | cut -d' ' -f1,3; \
4913f4c9a3aSSatish Balay	done
492