xref: /petsc/makefile (revision 7862f17c43475a68ccf17e1ea1880e54145894f1)
1#
2# This is the makefile for installing PETSc. See the file
3# Installation for directions on installing PETSc.
4# See also bmake/common for additional commands.
5#
6
7#PETSC_DIR = .
8
9CFLAGS	 =
10SOURCEC	 =
11SOURCEF	 =
12SOURCEH	 = Changes Machines Readme maint/addlinks \
13	   maint/builddist FAQ Installation Performance BugReporting\
14	   maint/buildlinks maint/wwwman maint/xclude maint/crontab\
15	   bmake/common bmake/*/base* maint/autoftp docs/www/sec/*
16OBJSC	 =
17OBJSF	 =
18LIBBASE	 = libpetscvec
19DIRS	 = src include docs
20
21include $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base
22
23# Builds PETSc libraries for a given BOPT and architecture
24all: chkpetsc_dir
25	-$(RM) -f $(PDIR)/*
26	-@echo "Beginning to compile libraries in all directories"
27	-@echo "Using compiler: $(CC) $(CFLAGS) $(COPTFLAGS)"
28	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
29	-@echo "Using configuration flags: $(CONF)"
30	-@echo "Using include paths: $(PETSC_INCLUDE)"
31	-@echo "Using PETSc directory: $(PETSC_DIR)"
32	-@echo "Using PETSc arch: $(PETSC_ARCH)"
33	-@echo "------------------------------------------"
34	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
35	   ACTION=libfast  tree
36	-@cd $(PETSC_DIR)/src/sys/src ; $(OMAKE) PETSC_ARCH=$(PETSC_ARCH) rs6000_time
37	$(RANLIB) $(PDIR)/*.a
38	-@chmod g+w  $(PDIR)/*.a
39	-@echo "Completed building libraries"
40	-@echo "------------------------------------------"
41
42# Builds PETSc test examples for a given BOPT and architecture
43testexamples: chkpetsc_dir
44	-@echo "Beginning to compile and run test examples"
45	-@echo "Using compiler: $(CC) $(CFLAGS) $(COPTFLAGS)"
46	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
47	-@echo "Using include paths: $(PETSC_INCLUDE)"
48	-@echo "Using PETSc directory: $(PETSC_DIR)"
49	-@echo "Using PETSc arch: $(PETSC_ARCH)"
50	-@echo "------------------------------------------"
51	-@echo "Using linker: $(CLINKER)"
52	-@echo "Using libraries: $(PETSC_LIB)"
53	-@echo "------------------------------------------"
54	-@echo "Due to different numerical round-off on certain"
55	-@echo "machines some of the numbers may not match exactly."
56	-@echo "------------------------------------------"
57	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
58	   ACTION=testexamples_1  tree
59	-@echo "Completed compiling and running test examples"
60	-@echo "------------------------------------------"
61
62# Builds PETSc test examples for a given BOPT and architecture
63testexamples_uni: chkpetsc_dir
64	-@echo "Beginning to compile and run uniprocessor test examples"
65	-@echo "Using compiler: $(CC) $(CFLAGS) $(COPTFLAGS)"
66	-@echo "Using linker: $(CLINKER)"
67	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
68	-@echo "Using include paths: $(PETSC_INCLUDE)"
69	-@echo "Using libraries: $(PETSC_LIB)"
70	-@echo "------------------------------------------"
71	-@echo "Due to different numerical round-off on certain"
72	-@echo "machines some of the numbers may not match exactly."
73	-@echo "------------------------------------------"
74	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
75	   ACTION=testexamples_4  tree
76	-@echo "Completed compiling and running uniprocessor test examples"
77	-@echo "------------------------------------------"
78
79# Builds PETSc test examples for a given BOPT and architecture
80testfortran: chkpetsc_dir
81	-@echo "Beginning to compile and run Fortran test examples"
82	-@echo "Using compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
83	-@echo "Using linker: $(FLINKER)"
84	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
85	-@echo "Using libraries: $(PETSC_FORTRAN_LIB)  $(PETSC_LIB)"
86	-@echo "------------------------------------------"
87	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
88	   ACTION=testexamples_3  tree
89	-@echo "Completed compiling and running Fortran test examples"
90	-@echo "------------------------------------------"
91
92#
93# Builds PETSc Fortran interface libary
94# Note:	 libfast cannot run on .F files on certain machines, so we
95# use lib and check for errors here.
96fortran: chkpetsc_dir
97	-$(RM) -f $(PDIR)/libpetscfortran.a
98	-@echo "Beginning to compile Fortran interface library"
99	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
100	-@echo "Using C/C++ compiler: $(CC) $(CFLAGS) $(COPTFLAGS)"
101	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
102	-@echo "Using configuration flags: $(CONF)"
103	-@echo "Using include paths: $(PETSC_INCLUDE)"
104	-@echo "------------------------------------------"
105	-@cd src/fortran/custom; \
106	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
107	  grep -v clog trashz | grep -v "information sections" | \
108	  egrep -i '(Error|warning|Can)' >> /dev/null;\
109	  if [ "$$?" != 1 ]; then \
110	  cat trashz ; fi; $(RM) trashz
111	-@cd src/fortran/auto; \
112	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
113	$(RANLIB) $(PDIR)/libpetscfortran.a
114	-@echo "Completed compiling Fortran interface library"
115	-@echo "------------------------------------------"
116
117ranlib:
118	$(RANLIB) $(PDIR)/*.a
119
120# Deletes PETSc libraries
121deletelibs:
122	-$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/*
123
124# Deletes man pages (xman version)
125deletemanpages:
126	$(RM) -f $(PETSC_DIR)/Keywords $(PETSC_DIR)/docs/man/man*/*
127
128# Deletes man pages (HTML version)
129deletewwwpages:
130	$(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit \
131	         $(PETSC_DIR)/docs/www/man*.html
132
133# Deletes man pages (LaTeX version)
134deletelatexpages:
135	$(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex
136
137# To access the tags in emacs, type M-x visit-tags-table and specify
138# the file petsc/TAGS.	Then, to move to where a PETSc function is
139# defined, enter M-. and the function name.  To search for a string
140# and move to the first occurrence, use M-x tags-search and the string.
141# To locate later occurrences, use M-,
142
143# Builds all etags files
144alletags:
145	-make etags_complete
146	-make etags
147	-make etags_noexamples
148	-make etags_makefiles
149
150# Builds the basic etags file.	This should be employed by most users.
151etags:
152	$(RM) TAGS
153	etags -f TAGS	 src/*/impls/*/*.h src/*/impls/*/*/*.h
154	etags -a -f TAGS src/*/examples/*/*.c src/*/examples/*/*/*.c
155	etags -a -f TAGS src/*/examples/*/*.F src/*/examples/*/*/*.F
156	etags -a -f TAGS src/*/examples/*/*.f
157	etags -a -f TAGS src/*/*.h src/*/*/*.h src/*/interface/*.c
158	etags -a -f TAGS src/*/src/*.c src/*/impls/*/*.c
159	etags -a -f TAGS src/*/impls/*/*/*.c  src/benchmarks/*.c
160	etags -a -f TAGS src/contrib/*/*.c src/contrib/*/src/*.c
161	etags -a -f TAGS src/contrib/*/examples/*/*.c src/contrib/*/examples/*/*.F
162	etags -a -f TAGS src/contrib/*/src/*.h
163	etags -a -f TAGS include/*.h include/pinclude/*.h bmake/common
164	etags -a -f TAGS include/FINCLUDE/*.h
165	etags -a -f TAGS src/*/impls/*.c src/*/utils/*.c
166	etags -a -f TAGS makefile src/*/src/makefile
167	etags -a -f TAGS src/*/interface/makefile src/makefile
168	etags -a -f TAGS src/*/impls/makefile src/*/impls/*/makefile
169	etags -a -f TAGS src/*/utils/makefile src/*/examples/makefile
170	etags -a -f TAGS src/*/examples/*/makefile src/*/examples/*/*/makefile
171	etags -a -f TAGS src/*/makefile src/*/impls/*/*/makefile
172	etags -a -f TAGS src/contrib/*/makefile src/contrib/*/src/makefile
173	etags -a -f TAGS src/contrib/*/examples/makefile src/contrib/*/examples/*/makefile
174	etags -a -f TAGS src/fortran/makefile src/fortran/auto/makefile
175	etags -a -f TAGS src/fortran/custom/makefile
176	etags -a -f TAGS include/makefile include/*/makefile
177	etags -a -f TAGS bmake/common bmake/*/base*
178	etags -a -f TAGS src/fortran/custom/*.c src/fortran/auto/*.c
179	etags -a -f TAGS src/benchmarks/*.c src/fortran/custom/*.F
180	chmod g+w TAGS
181
182# Builds complete etags list; only for PETSc developers.
183etags_complete:
184	$(RM) TAGS_COMPLETE
185	etags -f TAGS_COMPLETE	  src/*/impls/*/*.h src/*/impls/*/*/*.h
186	etags -a -f TAGS_COMPLETE src/*/examples/*/*.c src/*/examples/*/*/*.c
187	etags -a -f TAGS_COMPLETE src/*/examples/*/*.F src/*/examples/*/*/*.F
188	etags -a -f TAGS_COMPLETE src/*/examples/*/*.f
189	etags -a -f TAGS_COMPLETE src/*/*.h src/*/*/*.h src/*/interface/*.c
190	etags -a -f TAGS_COMPLETE src/*/src/*.c src/*/impls/*/*.c
191	etags -a -f TAGS_COMPLETE src/*/impls/*/*/*.c  src/benchmarks/*.c
192	etags -a -f TAGS_COMPLETE src/contrib/*/*.c src/contrib/*/src/*.c
193	etags -a -f TAGS_COMPLETE src/contrib/*/src/*.h
194	etags -a -f TAGS_COMPLETE src/contrib/*/examples/*/*.c src/contrib/*/examples/*/*.F
195	etags -a -f TAGS_COMPLETE include/*.h include/pinclude/*.h bmake/common
196	etags -a -f TAGS_COMPLETE include/FINCLUDE/*.h
197	etags -a -f TAGS_COMPLETE src/*/impls/*.c src/*/utils/*.c
198	etags -a -f TAGS_COMPLETE makefile src/*/src/makefile
199	etags -a -f TAGS_COMPLETE src/*/interface/makefile src/makefile
200	etags -a -f TAGS_COMPLETE src/*/impls/makefile src/*/impls/*/makefile
201	etags -a -f TAGS_COMPLETE src/*/utils/makefile src/*/examples/makefile
202	etags -a -f TAGS_COMPLETE src/*/examples/*/makefile
203	etags -a -f TAGS_COMPLETE src/*/examples/*/*/makefile
204	etags -a -f TAGS_COMPLETE src/*/makefile src/*/impls/*/*/makefile
205	etags -a -f TAGS_COMPLETE src/contrib/*/makefile
206	etags -a -f TAGS_COMPLETE src/contrib/*/src/makefile
207	etags -a -f TAGS_COMPLETE src/contrib/*/examples/makefile
208	etags -a -f TAGS_COMPLETE src/contrib/*/examples/*/makefile
209	etags -a -f TAGS_COMPLETE src/fortran/makefile src/fortran/auto/makefile
210	etags -a -f TAGS_COMPLETE src/fortran/custom/makefile
211	etags -a -f TAGS_COMPLETE include/makefile include/*/makefile
212	etags -a -f TAGS_COMPLETE bmake/common bmake/*/base*
213	etags -a -f TAGS_COMPLETE src/fortran/custom/*.c src/fortran/auto/*.c
214	etags -a -f TAGS_COMPLETE src/benchmarks/*.c
215	etags -a -f TAGS_COMPLETE src/fortran/custom/*.F
216	etags -a -f TAGS_COMPLETE docs/tex/manual/routin.tex
217	etags -a -f TAGS_COMPLETE docs/tex/manual/manual.tex
218	etags -a -f TAGS_COMPLETE docs/tex/manual/manual_tex.tex
219	etags -a -f TAGS_COMPLETE docs/tex/manual/intro.tex
220	etags -a -f TAGS_COMPLETE docs/tex/manual/part1.tex
221	etags -a -f TAGS_COMPLETE docs/tex/manual/part2.tex
222	etags -a -f TAGS_COMPLETE docs/tex/manual/intro.tex docs/makefile
223	chmod g+w TAGS_COMPLETE
224
225# Builds the etags file that excludes the examples directories
226etags_noexamples:
227	$(RM) TAGS_NO_EXAMPLES
228	etags -f TAGS_NO_EXAMPLES src/*/impls/*/*.h src/*/impls/*/*/*.h
229	etags -a -f TAGS_NO_EXAMPLES src/*/*.h src/*/*/*.h src/*/interface/*.c
230	etags -a -f TAGS_NO_EXAMPLES src/*/src/*.c  src/*/impls/*/*.c
231	etags -a -f TAGS_NO_EXAMPLES src/*/impls/*/*/*.c
232	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/*.c src/contrib/*/src/*.c
233	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/*.h
234	etags -a -f TAGS_NO_EXAMPLES include/*.h include/pinclude/*.h
235	etags -a -f TAGS_NO_EXAMPLES include/FINCLUDE/*.h
236	etags -a -f TAGS_NO_EXAMPLES bmake/common
237	etags -a -f TAGS_NO_EXAMPLES src/*/impls/*.c src/*/utils/*.c
238	etags -a -f TAGS_NO_EXAMPLES makefile src/*/src/makefile
239	etags -a -f TAGS_NO_EXAMPLES src/*/interface/makefile src/makefile
240	etags -a -f TAGS_NO_EXAMPLES src/*/impls/makefile src/*/impls/*/makefile
241	etags -a -f TAGS_NO_EXAMPLES src/*/utils/makefile
242	etags -a -f TAGS_NO_EXAMPLES src/*/makefile src/*/impls/*/*/makefile
243	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/makefile
244	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/makefile
245	etags -a -f TAGS_NO_EXAMPLES src/fortran/makefile
246	etags -a -f TAGS_NO_EXAMPLES src/fortran/auto/makefile
247	etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/makefile
248	etags -a -f TAGS_NO_EXAMPLES include/makefile include/*/makefile
249	etags -a -f TAGS_NO_EXAMPLES bmake/common bmake/*/base*
250	etags -a -f TAGS_NO_EXAMPLES src/fortran/auto/*.c
251	etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/*.c
252	etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/*.F
253	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/routin.tex
254	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/manual.tex
255	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/intro.tex
256	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/part1.tex
257	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/part2.tex
258	etags -a -f TAGS_NO_EXAMPLES docs/makefile
259	chmod g+w TAGS_NO_EXAMPLES
260
261# Builds the etags file for makefiles
262etags_makefiles:
263	$(RM) TAGS_MAKEFILES
264	etags -a -f TAGS_MAKEFILES bmake/common
265	etags -a -f TAGS_MAKEFILES makefile src/*/src/makefile
266	etags -a -f TAGS_MAKEFILES src/*/interface/makefile src/makefile
267	etags -a -f TAGS_MAKEFILES src/*/impls/makefile src/*/impls/*/makefile
268	etags -a -f TAGS_MAKEFILES src/*/utils/makefile src/*/interface/makefile
269	etags -a -f TAGS_MAKEFILES src/*/makefile src/*/impls/*/*/makefile
270	etags -a -f TAGS_MAKEFILES src/*/examples/makefile
271	etags -a -f TAGS_MAKEFILES src/*/examples/*/makefile
272	etags -a -f TAGS_MAKEFILES src/*/examples/*/*/makefile
273	etags -a -f TAGS_MAKEFILES src/fortran/makefile
274	etags -a -f TAGS_MAKEFILES src/fortran/auto/makefile
275	etags -a -f TAGS_MAKEFILES src/contrib/*/makefile
276	etags -a -f TAGS_MAKEFILES src/contrib/*/src/makefile
277	etags -a -f TAGS_MAKEFILES src/contrib/*/examples/makefile
278	etags -a -f TAGS_MAKEFILES src/contrib/*/examples/*/makefile
279	etags -a -f TAGS_MAKEFILES src/fortran/custom/makefile
280	etags -a -f TAGS_MAKEFILES include/makefile include/*/makefile
281	etags -a -f TAGS_MAKEFILES bmake/common bmake/*/base*
282	etags -a -f TAGS_MAKEFILES docs/makefile
283	chmod g+w TAGS_MAKEFILES
284
285# ------------------------------------------------------------------
286#
287# All remaining actions are intended for PETSc developers only.
288# PETSc users should not generally need to use these commands.
289#
290
291# Builds all versions of the man pages
292allmanpages: deletemanpages allwwwpages alllatexpages
293	-make ACTION=manpages tree
294	-cd src/fortran/custom; make manpages
295	-cd docs/man; catman -W .
296allwwwpages: deletewwwpages
297	-make ACTION=wwwpages_buildcite tree
298	-cd src/fortran/custom; make wwwpages_buildcite
299	-cd src/fortran/custom; make wwwpages
300	-make ACTION=wwwpages tree
301	-maint/wwwman
302	-maint/examplesindex.tcl -www
303alllatexpages: deletelatexpages
304	-make ACTION=latexpages tree
305	-cd src/fortran/custom; make latexpages
306
307# Builds Fortran stub files
308allfortranstubs:
309	-@include/finclude/generateincludes
310	-@$(RM) -f $(PETSC_DIR)/src/fortran/auto/*.c
311	-make ACTION=fortranstubs tree
312	chmod g+w $(PETSC_DIR)/src/fortran/auto/*.c
313
314
315
316