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