xref: /petsc/makefile (revision 754f00cdc735961eb1ce1f1da9f8325ee7cc4432)
1*754f00cdSSatish Balay# $Id: makefile,v 1.211 1998/03/12 23:12:05 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	 =
11ca161407SBarry SmithDOCS	 = maint/addlinks maint/builddist \
12deb7fc1cSBarry Smith	   maint/buildlinks maint/wwwman maint/xclude maint/crontab\
13981c4779SBarry Smith	   bmake/common bmake/*/base* maint/autoftp docs/manualpages/sec/* \
14630a6785SBarry Smith           include/finclude/generateincludes bin/petscviewinfo.text \
15630a6785SBarry Smith           bin/petscoptsinfo.text
1661523587SBarry SmithOBJSC	 =
1761523587SBarry SmithOBJSF	 =
1861523587SBarry SmithLIBBASE	 = libpetscvec
19b16a3bb1SBarry SmithDIRS	 = src include docs
2061523587SBarry Smith
214e627d3aSBarry Smithinclude $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base
2261523587SBarry Smith
231a4ded38SSatish BalayALL: all
241a4ded38SSatish Balay
25efd74e9bSBarry Smith#
26efd74e9bSBarry Smith#  Prints information about the system and PETSc being compiled
27efd74e9bSBarry Smith#
28efd74e9bSBarry Smithinfo:
29efd74e9bSBarry Smith	-@echo "=========================================="
301d91fb6eSBarry Smith	-@echo On `date` on `hostname`
3130fdcc7aSBarry Smith	-@echo Machine characteristics: `uname -a`
32efd74e9bSBarry Smith	-@echo "-----------------------------------------"
33efd74e9bSBarry Smith	-@echo "Using C compiler: $(CC) $(COPTFLAGS)"
34614fe6ffSWilliam Gropp	-@if [ -n "$(CCV)" -a "$(CCV)" != "unknown" ] ; then \
35d20fc7d1SSatish Balay	  echo "Compiler version:" `$(CCV)` ; fi
36efd74e9bSBarry Smith	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
3747794344SBarry Smith	-@echo "-----------------------------------------"
3823f40d59SSatish Balay	-@grep PETSC_VERSION_NUMBER include/petsc.h | sed "s/........//"
39f265ae5cSBarry Smith	-@echo "-----------------------------------------"
40b14e8f29SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
4147794344SBarry Smith	-@echo "-----------------------------------------"
42b14e8f29SBarry Smith	-@echo "Using configuration flags: $(CONF)"
4347794344SBarry Smith	-@echo "-----------------------------------------"
44b14e8f29SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
4547794344SBarry Smith	-@echo "-----------------------------------------"
46c2c9bc36SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
47c2c9bc36SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
48efd74e9bSBarry Smith	-@echo "------------------------------------------"
49efd74e9bSBarry Smith	-@echo "Using C linker: $(CLINKER)"
50efd74e9bSBarry Smith	-@echo "Using libraries: $(PETSC_LIB)"
51efd74e9bSBarry Smith	-@echo "Using Fortran linker: $(FLINKER)"
523c7f52eaSSatish Balay	-@echo "Using Fortran libraries: $(PETSC_FORTRAN_LIB)"
53efd74e9bSBarry Smith	-@echo "=========================================="
54efd74e9bSBarry Smith
55efd74e9bSBarry Smith# Builds PETSc libraries for a given BOPT and architecture
5660262a0eSSatish Balayall: info chkpetsc_dir deletelibs build_kernels build_c build_shared build_fortran
572257ac6fSSatish Balay
5860262a0eSSatish Balaybuild_c:
59efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
6047794344SBarry Smith	-@echo "========================================="
61e35bd481SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
62f3848965SBarry Smith	   ACTION=libfast  tree
63f88f42abSSatish Balay	-@cd $(PETSC_DIR)/src/sys/src ; \
64f88f42abSSatish Balay	$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) rs6000_time
654e04c1a0SBarry Smith	$(RANLIB) $(PDIR)/*.a
6685232361SSatish Balay	-@chmod g+w  $(PDIR)/*.a
670b3634f8SBarry Smith	-@echo "Completed building libraries"
6847794344SBarry Smith	-@echo "========================================="
690b3634f8SBarry Smith
700b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture
71efd74e9bSBarry Smithtestexamples: info chkopts
72efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
73eb817c50SBarry Smith	-@echo "Due to different numerical round-off on certain"
74eb817c50SBarry Smith	-@echo "machines some of the numbers may not match exactly."
7547794344SBarry Smith	-@echo "========================================="
760b3634f8SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
770b3634f8SBarry Smith	   ACTION=testexamples_1  tree
780b3634f8SBarry Smith	-@echo "Completed compiling and running test examples"
7947794344SBarry Smith	-@echo "========================================="
800b3634f8SBarry Smith
810b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture
82efd74e9bSBarry Smithtestexamples_uni: info chkopts
83efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
848475343bSBarry Smith	-@echo "Due to different numerical round-off on certain"
858475343bSBarry Smith	-@echo "machines some of the numbers may not match exactly."
8647794344SBarry Smith	-@echo "========================================="
878475343bSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
888475343bSBarry Smith	   ACTION=testexamples_4  tree
898475343bSBarry Smith	-@echo "Completed compiling and running uniprocessor test examples"
9047794344SBarry Smith	-@echo "========================================="
918475343bSBarry Smith
9235ca7349SBarry Smith#
9311b6ed10SLois Curfman McInnes# Builds PETSc Fortran interface libary
9411b6ed10SLois Curfman McInnes# Note:	 libfast cannot run on .F files on certain machines, so we
9535ca7349SBarry Smith# use lib and check for errors here.
9660262a0eSSatish Balayfortran: info chkpetsc_dir build_fortran
9760262a0eSSatish Balay
9860262a0eSSatish Balaybuild_fortran:
99efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE FORTRAN INTERFACE LIBRARY"
10047794344SBarry Smith	-@echo "========================================="
101efd74e9bSBarry Smith	-$(RM) -f $(PDIR)/libpetscfortran.*
10260262a0eSSatish Balay	-@cd src/fortran/auto; \
10360262a0eSSatish Balay	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
104b16a3bb1SBarry Smith	-@cd src/fortran/custom; \
10535ca7349SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
10635ca7349SBarry Smith	  grep -v clog trashz | grep -v "information sections" | \
10735ca7349SBarry Smith	  egrep -i '(Error|warning|Can)' >> /dev/null;\
10835ca7349SBarry Smith	  if [ "$$?" != 1 ]; then \
10935ca7349SBarry Smith	  cat trashz ; fi; $(RM) trashz
11083f0b094SBarry Smith	$(RANLIB) $(PDIR)/libpetscfortran.a
11185232361SSatish Balay	-@chmod g+w  $(PDIR)/*.a
1120b3634f8SBarry Smith	-@echo "Completed compiling Fortran interface library"
11347794344SBarry Smith	-@echo "========================================="
11483f0b094SBarry Smith
115971c2310SBarry Smith#
116971c2310SBarry Smith# Builds PETSc Fortran kernels; some numerical kernels have
117971c2310SBarry Smith# a Fortran version that may give better performance on certain
1188c34ac02SLois Curfman McInnes# machines. These always provide better performance for complex numbers.
119efd74e9bSBarry Smithfortrankernels: info chkpetsc_dir
120971c2310SBarry Smith	-$(RM) -f $(PDIR)/libpetsckernels.*
121efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE FORTRAN KERNELS LIBRARY"
122971c2310SBarry Smith	-@echo "========================================="
123971c2310SBarry Smith	-@cd src/fortran/kernels; \
124971c2310SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib
12585232361SSatish Balay	-@chmod g+w  $(PDIR)/*.a
126971c2310SBarry Smith	-@echo "Completed compiling Fortran kernels library"
127971c2310SBarry Smith	-@echo "========================================="
128971c2310SBarry Smith
129727c161cSBarry Smith# Builds PETSc test examples for a given BOPT and architecture
130efd74e9bSBarry Smithtestfortran: info chkopts
131efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
13247794344SBarry Smith	-@echo "========================================="
133e4ef9893SBarry Smith	-@echo "Due to different numerical round-off on certain"
134e4ef9893SBarry Smith	-@echo "machines or the way Fortran formats numbers"
135e4ef9893SBarry Smith	-@echo "some of the results may not match exactly."
136e4ef9893SBarry Smith	-@echo "========================================="
137e4ef9893SBarry Smith	-@echo "On some machines you may get messages of the form"
138e4ef9893SBarry Smith	-@echo "PetscScalarAddressToFortran:C and Fortran arrays are"
139e4ef9893SBarry Smith	-@echo "not commonly aligned or are too far apart to be indexed"
140e4ef9893SBarry Smith	-@echo "by an integer. Locations: C xxxc Fortran xxxf"
141e4ef9893SBarry Smith	-@echo "Locations/sizeof(Scalar): C yyc Fortran yyf"
142e4ef9893SBarry Smith	-@echo "This indicates that you may not be able to use the"
143e4ef9893SBarry Smith	-@echo "PETSc routines VecGetArray() and MatGetArray() from Fortran"
144e4ef9893SBarry Smith	-@echo "========================================="
145727c161cSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
146727c161cSBarry Smith	   ACTION=testexamples_3  tree
147727c161cSBarry Smith	-@echo "Completed compiling and running Fortran test examples"
14847794344SBarry Smith	-@echo "========================================="
149b1f85764SBarry Smith#
150b1f85764SBarry Smith# Builds PETSc Fortran90 interface libary
151b1f85764SBarry Smith# Note:	 libfast cannot run on .F files on certain machines, so we
152b1f85764SBarry Smith# use lib and check for errors here.
153b1f85764SBarry Smith# Note: F90 interface currently only supported in NAG F90 compiler
154efd74e9bSBarry Smithfortran90: info chkpetsc_dir fortran
155efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE FORTRAN90 INTERFACE LIBRARY"
156b1f85764SBarry Smith	-@echo "========================================="
157b1f85764SBarry Smith	-@cd src/fortran/f90; \
158b1f85764SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
159b1f85764SBarry Smith	  grep -v clog trashz | grep -v "information sections" | \
160b1f85764SBarry Smith	  egrep -i '(Error|warning|Can)' >> /dev/null;\
161b1f85764SBarry Smith	  if [ "$$?" != 1 ]; then \
162b1f85764SBarry Smith	  cat trashz ; fi; $(RM) trashz
163b1f85764SBarry Smith	$(RANLIB) $(PDIR)/libpetscfortran.a
16485232361SSatish Balay	-@chmod g+w  $(PDIR)/*.a
165b1f85764SBarry Smith	-@echo "Completed compiling Fortran90 interface library"
166b1f85764SBarry Smith	-@echo "========================================="
167b1f85764SBarry Smith
168ad96cc0dSLois Curfman McInnes# Builds noise routines (not yet publically available)
169ad96cc0dSLois Curfman McInnes# Note:	 libfast cannot run on .F files on certain machines, so we
170ad96cc0dSLois Curfman McInnes# use lib and check for errors here.
171efd74e9bSBarry Smithnoise: info chkpetsc_dir
172ad96cc0dSLois Curfman McInnes	-@echo "Beginning to compile noise routines"
173ad96cc0dSLois Curfman McInnes	-@echo "========================================="
174ad96cc0dSLois Curfman McInnes	-@cd src/snes/interface/noise; \
175ad96cc0dSLois Curfman McInnes	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
176ad96cc0dSLois Curfman McInnes	  grep -v clog trashz | grep -v "information sections" | \
177ad96cc0dSLois Curfman McInnes	  egrep -i '(Error|warning|Can)' >> /dev/null;\
178ad96cc0dSLois Curfman McInnes	  if [ "$$?" != 1 ]; then \
179ad96cc0dSLois Curfman McInnes	  cat trashz ; fi; $(RM) trashz
180ad96cc0dSLois Curfman McInnes	$(RANLIB) $(PDIR)/libpetscsnes.a
18185232361SSatish Balay	-@chmod g+w  $(PDIR)/libpetscsnes.a
182ad96cc0dSLois Curfman McInnes	-@echo "Completed compiling noise routines"
183ad96cc0dSLois Curfman McInnes	-@echo "========================================="
184ad96cc0dSLois Curfman McInnes
185efd74e9bSBarry Smithpetscblas: info chkpetsc_dir
18666341c5dSSatish Balay	-$(RM) -f $(PDIR)/libpetscblas.*
187efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE C VERSION OF BLAS AND LAPACK"
18866341c5dSSatish Balay	-@echo "========================================="
18966341c5dSSatish Balay	-@cd src/adic/blas; \
19066341c5dSSatish Balay	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
19166341c5dSSatish Balay	-@cd src/adic/lapack; \
19266341c5dSSatish Balay	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=libfast tree
19366341c5dSSatish Balay	$(RANLIB) $(PDIR)/libpetscblas.a
19485232361SSatish Balay	-@chmod g+w  $(PDIR)/*.a
195229e8d5cSBarry Smith	-@echo "Completed compiling C version of BLAS and LAPACK"
19666341c5dSSatish Balay	-@echo "========================================="
1971a4ded38SSatish Balay
1981a4ded38SSatish Balay# If USE_DYNAMIC_LIBRARIES flag is set, build shared libs
1992257ac6fSSatish Balaybuild_shared:
2002257ac6fSSatish Balay	-@shared_var=`echo "$(PETSCFLAGS)" | sed 's/-DUSE_DYNAMIC_LIBRARIES//g'`; \
2012257ac6fSSatish Balay	if [ "$(PETSCFLAGS)" != "$$shared_var" ] ; then \
2022257ac6fSSatish Balay	$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) shared; fi
20366341c5dSSatish Balay
204f3eacedaSSatish Balay# If fortrankernels are used, build them.
205f3eacedaSSatish Balaybuild_kernels:
2062257ac6fSSatish Balay	-@kernel_var=`echo "$(PETSCFLAGS)" | sed 's/-DUSE_FORTRAN_KERNELS//g'`; \
2072257ac6fSSatish Balay	if [ "$(PETSCFLAGS)" != "$$kernel_var" ] ; then \
208f3eacedaSSatish Balay	$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) fortrankernels; fi
209ad96cc0dSLois Curfman McInnes
210f3eacedaSSatish Balay# Ranlib on the libraries
2118c37ef55SBarry Smithranlib:
2124e04c1a0SBarry Smith	$(RANLIB) $(PDIR)/*.a
21361523587SBarry Smith
21411b6ed10SLois Curfman McInnes# Deletes PETSc libraries
215f3eacedaSSatish Balaydeletelibs: chkopts_basic
216f3eacedaSSatish Balay	-$(RM) -f $(PDIR)/*
217d44968ceSBarry Smith
21811b6ed10SLois Curfman McInnes# Deletes man pages (HTML version)
219981c4779SBarry Smithdeletemanualpages:
220981c4779SBarry Smith	$(RM) -f $(PETSC_DIR)/docs/manualpages/man*/* $(PETSC_DIR)/docs/manualpages/www.cit \
221981c4779SBarry Smith	         $(PETSC_DIR)/docs/manualpages/man*.html
222b346654fSBarry Smith
22311b6ed10SLois Curfman McInnes# Deletes man pages (LaTeX version)
224b346654fSBarry Smithdeletelatexpages:
2257857610eSBarry Smith	$(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex
22620563c6bSBarry Smith
22765783a8cSBarry Smith# To access the tags in EMACS, type M-x visit-tags-table and specify
22865783a8cSBarry Smith# the file petsc/TAGS.
22965783a8cSBarry Smith# 1) To move to where a PETSc function is defined, enter M-. and the
23065783a8cSBarry Smith#     function name.
23165783a8cSBarry Smith# 2) To search for a string and move to the first occurrence,
23265783a8cSBarry Smith#     use M-x tags-search and the string.
2337acb7333SLois Curfman McInnes#     To locate later occurrences, use M-,
2347acb7333SLois Curfman McInnes
235b38bb785SSatish BalayTAGS_INCLUDE_FILES  = include/*.h include/pinclude/*.h include/FINCLUDE/*.h
236b38bb785SSatish BalayTAGS_BMAKE_FILES    = bmake/common bmake/*/base*
237b38bb785SSatish BalayTAGS_EXAMPLE_FILES  = src/*/examples/*/*.[c,h,F,f] src/*/examples/*/*/*.[c,h,F,f] \
238*754f00cdSSatish Balay                      src/benchmarks/*.c src/contrib/*/examples/*/*.[c,h,F,f]\
239*754f00cdSSatish Balay		      src/fortran/f90/tests
240b38bb785SSatish BalayTAGS_DOC_FILES      = docs/tex/manual/routin.tex docs/tex/manual/manual.tex \
241b38bb785SSatish Balay                      docs/tex/manual/manual_tex.tex docs/tex/manual/intro.tex \
242b38bb785SSatish Balay                      docs/tex/manual/part1.tex docs/tex/manual/part2.tex
2434431cf12SSatish BalayTAGS_SRC_FILES      = src/*/*.[c,h] src/*/interface/*.[c,h] src/*/src/*.[c,h] \
244b38bb785SSatish Balay                      src/*/utils/*.[c,h] \
245b38bb785SSatish Balay                      src/*/impls/*.[c,h] src/*/impls/*/*.[c,h] src/*/impls/*/*/*.[c,h] \
246b334301eSBarry Smith                      src/gvec/impls/*/*/*/*/*.[c,h] src/contrib/*/*.[c,h] \
247e38488c2SSatish Balay                      src/contrib/*/src/*.[c,h] src/fortran/custom/*.[c,h,F] \
248e38488c2SSatish Balay		      src/fortran/f90/*.[c,h,F] src/fortran/kernels/*.[c,h,F]
249b38bb785SSatish BalayTAGS_MAKEFILE_FILES = include/makefile include/*/makefile \
250b38bb785SSatish Balay                      makefile \
251b38bb785SSatish Balay                      src/makefile src/*/makefile src/*/src/makefile \
252b38bb785SSatish Balay                      src/*/interface/makefile \
253b38bb785SSatish Balay                      src/*/utils/makefile \
254b38bb785SSatish Balay                      src/*/impls/makefile src/*/impls/*/makefile src/*/impls/*/*/makefile \
255b38bb785SSatish Balay                      src/*/examples/makefile src/*/examples/*/makefile src/*/examples/*/*/makefile \
256b38bb785SSatish Balay                      src/gvec/impls/*/*/*/*/makefile src/gvec/impls/*/*/*/makefile \
257b38bb785SSatish Balay                      src/fortran/*/makefile \
258b38bb785SSatish Balay                      src/contrib/*/makefile src/contrib/*/src/makefile \
259b38bb785SSatish Balay                      src/contrib/*/examples/makefile src/contrib/*/examples/*/makefile \
260b38bb785SSatish Balay                      docs/makefile
261b38bb785SSatish Balay
26211b6ed10SLois Curfman McInnes# Builds all etags files
26311b6ed10SLois Curfman McInnesalletags:
2649ae7ee0fSLois Curfman McInnes	-make etags_complete
26511b6ed10SLois Curfman McInnes	-make etags
26611b6ed10SLois Curfman McInnes	-make etags_noexamples
267f830108cSBarry Smith	-make etags_examples
26811b6ed10SLois Curfman McInnes	-make etags_makefiles
26911b6ed10SLois Curfman McInnes
27011b6ed10SLois Curfman McInnes# Builds the basic etags file.	This should be employed by most users.
27120563c6bSBarry Smithetags:
272edd2f0e1SBarry Smith	$(RM) TAGS
273b38bb785SSatish Balay	etags -f TAGS $(TAGS_INCLUDE_FILES)
274b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_SRC_FILES)
275b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_EXAMPLE_FILES)
276b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_MAKEFILE_FILES)
277b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_BMAKE_FILES)
27828988994SBarry Smith	chmod g+w TAGS
279bfce26a3SBarry Smith
28029cdf679SBarry Smith# Builds complete etags list; only for PETSc developers.
28129cdf679SBarry Smithetags_complete:
28229cdf679SBarry Smith	$(RM) TAGS_COMPLETE
2839ca56a1bSSatish Balay	etags -f TAGS_COMPLETE $(TAGS_SRC_FILES)
2849ca56a1bSSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_INCLUDE_FILES)
285b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_EXAMPLE_FILES)
286b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_MAKEFILE_FILES)
287b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_BMAKE_FILES)
288b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_DOC_FILES)
28929cdf679SBarry Smith	chmod g+w TAGS_COMPLETE
29029cdf679SBarry Smith
29111b6ed10SLois Curfman McInnes# Builds the etags file that excludes the examples directories
292bfce26a3SBarry Smithetags_noexamples:
293bfce26a3SBarry Smith	$(RM) TAGS_NO_EXAMPLES
2949ca56a1bSSatish Balay	etags -f TAGS_NO_EXAMPLES $(TAGS_SRC_FILES)
2959ca56a1bSSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_INCLUDE_FILES)
296b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_MAKEFILE_FILES)
297b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_BMAKE_FILES)
298b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_DOC_FILES)
299bfce26a3SBarry Smith	chmod g+w TAGS_NO_EXAMPLES
300b16a3bb1SBarry Smith
30111b6ed10SLois Curfman McInnes# Builds the etags file for makefiles
302b16a3bb1SBarry Smithetags_makefiles:
303b16a3bb1SBarry Smith	$(RM) TAGS_MAKEFILES
304b38bb785SSatish Balay	etags -f TAGS_MAKEFILES $(TAGS_MAKEFILE_FILES)
305b38bb785SSatish Balay	etags -a -f TAGS_MAKEFILES $(TAGS_BMAKE_FILES)
306b16a3bb1SBarry Smith	chmod g+w TAGS_MAKEFILES
30711b6ed10SLois Curfman McInnes
308dc80aa23SSatish Balay# Builds the etags file for examples
309dc80aa23SSatish Balayetags_examples:
310dc80aa23SSatish Balay	$(RM) TAGS_EXAMPLES
311dc80aa23SSatish Balay	etags -f TAGS_EXAMPLES $(TAGS_EXAMPLE_FILES)
312dc80aa23SSatish Balay	chmod g+w TAGS_EXAMPLES
313dc80aa23SSatish Balay
314b38bb785SSatish Balay#
31565783a8cSBarry Smith# To use the tags file from VI do the following:
31665783a8cSBarry Smith# 1. within vi invoke the command - :set tags=/home/bsmith/petsc/tags
317b38bb785SSatish Balay#    or add  the command to your ~/.exrc file - set tags=/home/bsmith/petsc/tags
318b38bb785SSatish Balay# 2. now to go to a tag do - :tag TAGNAME for eg - :tag MatCreate
319b38bb785SSatish Balay#
320b38bb785SSatish Balayctags:
321b38bb785SSatish Balay	$(RM) tags
322b8319b70SSatish Balay	ctags -w -f tags $(TAGS_INCLUDE_FILES)
323b8319b70SSatish Balay	ctags -w -a -f tags $(TAGS_SRC_FILES)
324b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_EXAMPLE_FILES)
325b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_MAKEFILE_FILES)
326b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_BMAKE_FILES)
327b38bb785SSatish Balay	chmod g+w tags
328b38bb785SSatish Balay
32911b6ed10SLois Curfman McInnes# ------------------------------------------------------------------
33011b6ed10SLois Curfman McInnes#
33111b6ed10SLois Curfman McInnes# All remaining actions are intended for PETSc developers only.
33211b6ed10SLois Curfman McInnes# PETSc users should not generally need to use these commands.
33311b6ed10SLois Curfman McInnes#
33411b6ed10SLois Curfman McInnes
33511b6ed10SLois Curfman McInnes# Builds all versions of the man pages
336981c4779SBarry Smithallmanpages: allmanualpages alllatexpages
337981c4779SBarry Smithallmanualpages: deletemanualpages
338981c4779SBarry Smith	-make ACTION=manualpages_buildcite tree
339981c4779SBarry Smith	-cd src/fortran/custom; make manualpages_buildcite
340981c4779SBarry Smith	-cd src/fortran/custom; make manualpages
341981c4779SBarry Smith	-make ACTION=manualpages tree
342dea827f2SLois Curfman McInnes	-maint/wwwman
343981c4779SBarry Smith	-maint/examplesindex.tcl
344f8cfbf3fSSatish Balay	-maint/htmlkeywords.tcl
345981c4779SBarry Smith	-@chmod g+w docs/manualpages/man*/*
346e01137a2SSatish Balay
347416022c9SBarry Smithalllatexpages: deletelatexpages
348416022c9SBarry Smith	-make ACTION=latexpages tree
349c3e30b67SBarry Smith	-cd src/fortran/custom; make latexpages
35051c61065SBarry Smith	-@chmod g+w docs/tex/rsum/*
351416022c9SBarry Smith
35211b6ed10SLois Curfman McInnes# Builds Fortran stub files
35311b6ed10SLois Curfman McInnesallfortranstubs:
35435aab85fSBarry Smith	-@include/finclude/generateincludes
3550a0eb2c5SBarry Smith	-@$(RM) -f src/fortran/auto/*.c
35611b6ed10SLois Curfman McInnes	-make ACTION=fortranstubs tree
3570a0eb2c5SBarry Smith	chmod g+w src/fortran/auto/*.c
358f6ff2982SSatish Balay
359d55938c2SBarry Smithallci:
360d55938c2SBarry Smith	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) ci
361b951964fSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=ci  tree
362b951964fSBarry Smith
363d55938c2SBarry Smithallco:
364d55938c2SBarry Smith	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) co
365d55938c2SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=co  tree
366d55938c2SBarry Smith
367b334301eSBarry Smith#
368b334301eSBarry Smith#   The commands below are for generating ADIC versions of the code;
369b334301eSBarry Smith# they are not currently used.
370b334301eSBarry Smith#
371b334301eSBarry SmithCFLAGS   =  $(CPPFLAGS) $(CONF)
3725eea60f9SBarry Smithalladicignore:
3735eea60f9SBarry Smith	-@$(RM) $(PDIR)/adicignore
3745eea60f9SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adicignore  tree
3755eea60f9SBarry Smith
3765eea60f9SBarry Smithalladic:
377d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC source code in all directories"
378d18b0ea7SBarry Smith	-@echo "Using ADIC compiler: $(ADIC_CC) $(CFLAGS)"
379d18b0ea7SBarry Smith	-@echo "========================================="
38047794344SBarry Smith	-@cd include ; \
381f218b1c0SBarry Smith           $(ADIC_CC) -s -f 1 $(CFLAGS) petsc.h
382ba8edd79SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
38347794344SBarry Smith	-@cd src/inline ; \
38447794344SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
3857e351921SBarry Smith	-@cd src/adic/blas ; \
3867e351921SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
3877e351921SBarry Smith	-@cd src/adic/lapack ; \
388e1063516SSatish Balay            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
3896e81b665SBarry Smith
39047794344SBarry Smithalladiclib:
391d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC libraries in all directories"
392d18b0ea7SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
393d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
394d18b0ea7SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
395d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
396d18b0ea7SBarry Smith	-@echo "Using configuration flags: $(CONF)"
397d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
398d18b0ea7SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
399d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
400d18b0ea7SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
401d18b0ea7SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
402d18b0ea7SBarry Smith	-@echo "========================================="
403f218b1c0SBarry Smith	-@$(RM) -f  $(PDIR)/*adic.a
40447794344SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
4057e351921SBarry Smith	-@cd src/adic/blas ; \
4067e351921SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adiclib
4077e351921SBarry Smith	-@cd src/adic/lapack ; \
408e1063516SSatish Balay            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
4097e351921SBarry Smith	-@cd src/adic/src ; \
410cb3b3f49SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib
4115eea60f9SBarry Smith
4129e417c50SSatish Balay# -------------------------------------------------------------------------------
4139e417c50SSatish Balay#
4149e417c50SSatish Balay# Some macros to check if the fortran interface is up-to-date.
4159e417c50SSatish Balay#
4169e417c50SSatish Balaycountfortranfunctions:
4179e417c50SSatish Balay	-@cd $(PETSC_DIR)/src/fortran; egrep '^void' custom/*.c auto/*.c | \
4189e417c50SSatish Balay	cut -d'(' -f1 | tr -s '' ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
4199e417c50SSatish Balay	sed "s/_$$//" | sort > /tmp/countfortranfunctions
420b334301eSBarry Smith
4219e417c50SSatish Balaycountcfunctions:
4229e417c50SSatish Balay	-@ grep extern $(PETSC_DIR)/include/*.h *.h | grep "(" | tr -s '' ' ' | \
4239e417c50SSatish Balay	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '' '\012' |  \
4249e417c50SSatish Balay	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
4259e417c50SSatish Balay
4269e417c50SSatish Balaydifffortranfunctions: countfortranfunctions countcfunctions
4279e417c50SSatish Balay	-@echo -------------- Functions missing in the fortran interface ---------------------
4289e417c50SSatish Balay	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
4299e417c50SSatish Balay	-@echo ----------------- Functions missing in the C interface ------------------------
4309e417c50SSatish Balay	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
4319e417c50SSatish Balay	-@$(RM)  /tmp/countcfunctions /tmp/countfortranfunctions
432b334301eSBarry Smith
4333f4c9a3aSSatish Balaycheckbadfortranstubs:
4343f4c9a3aSSatish Balay	-@echo "========================================="
4353f4c9a3aSSatish Balay	-@echo "Functions with MPI_Comm as an Argument"
4363f4c9a3aSSatish Balay	-@echo "========================================="
4373f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
4383f4c9a3aSSatish Balay	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
4393f4c9a3aSSatish Balay	-@echo "========================================="
4403f4c9a3aSSatish Balay	-@echo "Functions with a String as an Argument"
4413f4c9a3aSSatish Balay	-@echo "========================================="
4423f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
4433f4c9a3aSSatish Balay	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
4443f4c9a3aSSatish Balay	-@echo "========================================="
4453f4c9a3aSSatish Balay	-@echo "Functions with Pointers to PETSc Objects as Argument"
4463f4c9a3aSSatish Balay	-@echo "========================================="
4473f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; \
4483f4c9a3aSSatish Balay	_p_OBJ=`grep _p_ $(PETSC_DIR)/include/*.h | tr -s '' ' ' | \
4493f4c9a3aSSatish Balay	cut -d' ' -f 3 | tr -s '' '\012' | grep -v '{' | cut -d'*' -f1 | \
4503f4c9a3aSSatish Balay	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
4513f4c9a3aSSatish Balay	for OBJ in $$_p_OBJ; do \
4523f4c9a3aSSatish Balay	grep "$$OBJ \*" *.c | tr -s '' ' ' | tr -s ':' ' ' | \
4533f4c9a3aSSatish Balay	cut -d'(' -f1 | cut -d' ' -f1,3; \
4543f4c9a3aSSatish Balay	done
455