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