xref: /petsc/makefile (revision 329e7e40997572fb3f85cb96cb837791e4805581)
1# $Id: makefile,v 1.353 2001/08/28 19:43:38 balay Exp $
2#
3# This is the makefile for installing PETSc. See the file
4# docs/installation.html for directions on installing PETSc.
5# See also bmake/common for additional commands.
6#
7ALL: all
8LOCDIR = .
9DIRS   = src include docs
10#
11# Configuration Variables
12#
13# Read configure options from a file if CONFIGURE_OPTIONSis not defined
14CONFIGURE_OPTIONS_FILE = ./config/configure_options
15CONFIGURE_OPTIONS      = $(shell cat $(CONFIGURE_OPTIONS_FILE))
16CONFIGURE_LOG_FILE     = configure_petsc.log
17AUTOMAKE_ADD_FILES     = config/config.guess config/config.sub config/install-sh config/missing config/mkinstalldirs \
18                         config/ltconfig config/ltmain.sh
19
20include ${PETSC_DIR}/bmake/common/base
21include ${PETSC_DIR}/bmake/common/test
22
23#
24# Configuration Targets
25#
26aclocal.m4: configure.in
27	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
28	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
29	@aclocal >> $(CONFIGURE_LOG_FILE)
30
31bmake/config/petscconf.h.in: config/acconfig.h config/acsite.m4 configure.in
32	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
33	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
34	@autoheader -l config >> $(CONFIGURE_LOG_FILE)
35
36$(AUTOMAKE_ADD_FILES):
37	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
38	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
39	@automake --foreign --add-missing Makefile >> $(CONFIGURE_LOG_FILE)
40
41Makefile.am: $(AUTOMAKE_ADD_FILES)
42
43Makefile.in: Makefile.am
44	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
45	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
46	@automake --foreign Makefile >> $(CONFIGURE_LOG_FILE)
47
48configure: configure.in config/acsite.m4 aclocal.m4 bmake/config/petscconf.h.in $(AUTOMAKE_ADD_FILES)
49	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
50	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
51	@autoconf -l config >> $(CONFIGURE_LOG_FILE)
52
53start_configure:
54	-@$(RM) $(CONFIGURE_LOG_FILE)
55
56configure_petsc: start_configure configure Makefile.in
57	@echo "Configuring Petsc with options:" >> $(CONFIGURE_LOG_FILE)
58	@echo "$(CONFIGURE_OPTIONS)" >> $(CONFIGURE_LOG_FILE)
59	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
60	@echo "$(CONFIGURE_OPTIONS)" > $(CONFIGURE_OPTIONS_FILE)
61	@./configure $(CONFIGURE_OPTIONS) >> $(CONFIGURE_LOG_FILE)
62
63$(CONFIGURE_LOG_FILE): $(CONFIGURE_OPTIONS_FILE)
64	$(MAKE) configure_petsc
65
66configure_clean:
67	-@$(RM) aclocal.m4
68	-@$(RM) bmake/config/petscconf.h.in
69	-@$(RM) $(AUTOMAKE_ADD_FILES) Makefile.in
70	-@$(RM) configure
71#
72# Basic targets to build PETSc libraries.
73# all     : builds the c, fortran, and f90 libraries
74all       : $(CONFIGURE_LOG_FILE) nall
75all_lt    : $(CONFIGURE_LOG_FILE) chk_petsc_dir info info_h chklib_dir deletelibs build_lt shared
76nall      : chk_petsc_dir info info_h chklib_dir deletelibs build shared
77#
78# Prints information about the system and version of PETSc being compiled
79#
80info:
81	-@echo "=========================================="
82	-@echo " "
83	-@echo "See docs/troubleshooting.html and docs/bugreporting.html"
84	-@echo "for help with installation problems. Please send EVERYTHING"
85	-@echo "printed out below when reporting problems"
86	-@echo " "
87	-@echo "To subscribe to the PETSc users mailing list, send mail to "
88	-@echo "majordomo@mcs.anl.gov with the message: "
89	-@echo "subscribe petsc-users"
90	-@echo " "
91	-@echo "=========================================="
92	-@echo On `date` on `hostname`
93	-@echo Machine characteristics: `uname -a`
94	-@echo "-----------------------------------------"
95	-@echo "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS}"
96	-@if [ -n "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
97	  echo "C Compiler version:" ; ${C_CCV} ; fi ; true
98	-@if [ -n "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
99	  echo "C++ Compiler version:" ; ${CXX_CCV} ; fi; true
100	-@echo "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}"
101	-@if [ -n "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
102	  echo "Fortran Compiler version:" ; ${C_FCV} ; fi; true
103	-@echo "-----------------------------------------"
104	-@grep PETSC_VERSION_NUMBER ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
105	-@echo "-----------------------------------------"
106	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
107	-@echo "-----------------------------------------"
108	-@echo "Using configuration flags:"
109	-@grep "define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
110	-@echo "-----------------------------------------"
111	-@echo "Using include paths: ${PETSC_INCLUDE}"
112	-@echo "-----------------------------------------"
113	-@echo "Using PETSc directory: ${PETSC_DIR}"
114	-@echo "Using PETSc arch: ${PETSC_ARCH}"
115	-@echo "------------------------------------------"
116	-@echo "Using C linker: ${CLINKER}"
117	-@echo "Using Fortran linker: ${FLINKER}"
118	-@echo "Using libraries: ${PETSC_LIB}"
119	-@echo "=========================================="
120#
121#
122MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
123info_h:
124	-@$(RM) -f MINFO ${MINFO}
125	-@echo  "static char *petscmachineinfo = \"  " >> MINFO
126	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
127	-@echo  Machine characteristics: `uname -a` "" >> MINFO
128	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
129	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
130	-@echo  "-----------------------------------------\"; " >> MINFO
131	-@echo  "static char *petsccompilerinfo = \"  " >> MINFO
132	-@echo  "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO
133	-@if [  "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
134	  echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1; fi ; true
135	-@if [  "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
136	  echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; fi ; true
137	-@echo  "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO
138	-@if [  "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
139	  echo  "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; fi ; true
140	-@echo  "-----------------------------------------\"; " >> MINFO
141	-@echo  "static char *petsccompilerflagsinfo = \"  " >> MINFO
142	-@echo  "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO
143	-@echo  "-----------------------------------------" >> MINFO
144	-@echo  "Using configuration flags:" >> MINFO
145	-@echo  "-----------------------------------------" >> MINFO
146	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
147	-@echo  "------------------------------------------\"; " >> MINFO
148	-@echo  "static char *petsclinkerinfo = \"  " >> MINFO
149	-@echo  "Using C linker: ${CLINKER}" >> MINFO
150	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
151	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> MINFO
152	-@cat MINFO | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> ${MINFO}
153	-@chmod g+w ${MINFO}
154	-@$(RM) MINFO
155#
156# Builds the PETSc libraries
157# This target also builds fortran77 and f90 interface
158# files and compiles .F files
159#
160build:
161	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
162	-@echo "========================================="
163	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
164	${RANLIB} ${PETSC_LIB_DIR}/*.a
165	-@chmod g+w  ${PETSC_LIB_DIR}/*.a
166	-@echo "Completed building libraries"
167	-@echo "========================================="
168#
169# Builds the PETSc libraries
170# This target is the same as 'build', but uses the 'lib' target instead
171#
172build_lt:
173	-@echo "BEGINNING TO COMPILE LIBTOOL LIBRARIES IN ALL DIRECTORIES"
174	-@echo "========================================="
175	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=lib tree \
176          | egrep "(^lib|^*\.c:|Error)"
177	-@echo "Completed building libraries"
178	-@echo "========================================="
179#
180# Builds PETSc test examples for a given BOPT and architecture
181#
182testexamples: info chkopts
183	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
184	-@echo "Due to different numerical round-off on certain"
185	-@echo "machines some of the numbers may not match exactly."
186	-@echo "========================================="
187	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1  tree
188	-@echo "Completed compiling and running test examples"
189	-@echo "========================================="
190testfortran: info chkopts
191	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
192	-@echo "========================================="
193	-@echo "Due to different numerical round-off on certain"
194	-@echo "machines or the way Fortran formats numbers"
195	-@echo "some of the results may not match exactly."
196	-@echo "========================================="
197	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3  tree
198	-@echo "Completed compiling and running Fortran test examples"
199	-@echo "========================================="
200testexamples_uni: info chkopts
201	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
202	-@echo "Due to different numerical round-off on certain"
203	-@echo "machines some of the numbers may not match exactly."
204	-@echo "========================================="
205	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4  tree
206	-@echo "Completed compiling and running uniprocessor test examples"
207	-@echo "========================================="
208testfortran_uni: info chkopts
209	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
210	-@echo "Due to different numerical round-off on certain"
211	-@echo "machines some of the numbers may not match exactly."
212	-@echo "========================================="
213	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9  tree
214	-@echo "Completed compiling and running uniprocessor fortran test examples"
215	-@echo "========================================="
216
217# Ranlib on the libraries
218ranlib:
219	${RANLIB} ${PETSC_LIB_DIR}/*.a
220
221# Deletes PETSc libraries
222deletelibs: chkopts_basic
223	-${RM} -f ${PETSC_LIB_DIR}/*
224
225# Cleans up build
226allclean: deletelibs
227	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
228
229#
230#   Updates your PETSc version to the latest set of patches
231#
232update:
233	-@bin/petscupdate
234
235#
236# Check if PETSC_DIR variable specified is valid
237#
238chk_petsc_dir:
239	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
240	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
241	  echo "You need to use / to separate directories, not \\!"; \
242	  echo "Aborting build"; \
243	  false; fi
244
245# ------------------------------------------------------------------
246#
247# All remaining actions are intended for PETSc developers only.
248# PETSc users should not generally need to use these commands.
249#
250
251# To access the tags in EMACS, type M-x visit-tags-table and specify
252# the file petsc/TAGS.
253# 1) To move to where a PETSc function is defined, enter M-. and the
254#     function name.
255# 2) To search for a string and move to the first occurrence,
256#     use M-x tags-search and the string.
257#     To locate later occurrences, use M-,
258# Builds all etags files
259alletags:
260	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags
261	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_complete
262	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples
263	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples
264	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles
265# Builds the basic etags file.	This should be employed by most users.
266etags:
267	-${RM} ${TAGSDIR}/TAGS
268	-touch ${TAGSDIR}/TAGS
269	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree
270	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree
271	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree
272	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree
273	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree
274	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree
275	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree
276	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree
277	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree
278	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles
279	-chmod g+w TAGS
280# Builds complete etags list; only for PETSc developers.
281etags_complete:
282	-${RM} ${TAGSDIR}/TAGS_COMPLETE
283	-touch ${TAGSDIR}/TAGS_COMPLETE
284	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcec alltree
285	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcej alltree
286	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourceh alltree
287	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcef alltree
288	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesc alltree
289	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesf alltree
290	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesch alltree
291	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesfh alltree
292	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_makefile alltree
293	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE etags_bmakefiles
294	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_docs alltree
295	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_scripts alltree
296	-chmod g+w TAGS_COMPLETE
297# Builds the etags file that excludes the examples directories
298etags_noexamples:
299	-${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES
300	-touch ${TAGSDIR}/TAGS_NO_EXAMPLES
301	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree
302	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree
303	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree
304	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree
305	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree
306	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles
307	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree
308	-chmod g+w TAGS_NO_EXAMPLES
309# Builds the etags file for makefiles
310etags_makefiles:
311	-${RM} ${TAGSDIR}/TAGS_MAKEFILES
312	-touch ${TAGSDIR}/TAGS_MAKEFILES
313	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree
314	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles
315	-chmod g+w TAGS_MAKEFILES
316# Builds the etags file for examples
317etags_examples:
318	-${RM} ${TAGSDIR}/TAGS_EXAMPLES
319	-touch ${TAGSDIR}/TAGS_EXAMPLES
320	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree
321	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree
322	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree
323	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
324	-chmod g+w TAGS_EXAMPLES
325etags_fexamples:
326	-${RM} ${TAGSDIR}/TAGS_FEXAMPLES
327	-touch ${TAGSDIR}/TAGS_FEXAMPLES
328	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree
329	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
330	-chmod g+w TAGS_FEXAMPLES
331#
332# These are here for the target allci and allco, and etags
333#
334
335BMAKEFILES = bmake/common/base bmake/common/rules_win32 bmake/common/test \
336	     bmake/common/bopt* bmake/*/rules bmake/*/variables bmake/*/packages \
337	     bmake/*/petscconf.h bmake/*/petscfix.h bmake/win32/makefile.dos bmake/config/*.in \
338             bmake/*/buildtest bmake/adic.init bmake/adicmf.init
339DOCS	   = bmake/readme bmake/petscconf.defs
340SCRIPTS    = maint/addlinks maint/builddist maint/buildlinks maint/wwwman \
341	     maint/xclude maint/crontab  \
342	     maint/autoftp include/foldinclude/generateincludes
343
344updatewebdocs:
345	-chmod -R ug+w /mcs/tmp/petsc-tmp
346	-chgrp -R petsc /mcs/tmp/petsc-tmp
347	-/bin/rm -rf /mcs/tmp/petscdocs
348	-/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs
349	-maint/update-docs.py /mcs/tmp/petscdocs
350	-find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \;
351	-/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs
352	-/bin/rm -rf /mcs/tmp/petscdocs
353
354# Builds all the documentation - should be done every night
355alldoc: allmanualpages
356	cd docs/tex/manual; ${OMAKE} manual.dvi manual.ps manual.html splitmanual.html
357
358# Deletes man pages (HTML version)
359deletemanualpages:
360	${RM} -f ${LOC}/docs/manualpages/*/*.html \
361                 ${LOC}/docs/manualpages/manualpages.cit
362
363# Builds all versions of the man pages
364allmanualpages: deletemanualpages
365	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
366	-${OMAKE} ACTION=manualpages tree_basic  LOC=${LOC}
367	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
368	-${OMAKE} ACTION=manexamples tree  LOC=${LOC}
369	-${OMAKE} manconcepts  LOC=${LOC}
370	-${OMAKE} ACTION=getexlist tree LOC=${LOC}
371	-${OMAKE} ACTION=exampleconcepts tree LOC=${LOC}
372	-maint/helpindex.py ${PETSC_DIR} ${LOC}
373	-@chmod g+w ${LOC}/docs/manualpages/*/*.html
374
375# Builds .html versions of the source
376allhtml:
377	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} tree LOC=${LOC}
378
379allcleanhtml:
380	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} tree
381
382# Builds Fortran stub files
383allfortranstubs:
384	-@include/foldinclude/generateincludes
385	-@${RM} -f src/fortran/auto/*.c
386	-${OMAKE} ACTION=fortranstubs tree_basic
387	-@cd src/fortran/auto; ${OMAKE} fixfortran
388	chmod g+w src/fortran/auto/*.c
389
390allci:
391	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
392
393allco:
394	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
395
396# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
397allrcslabel:
398	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
399#
400#   The commands below are for generating ADIC versions of the code;
401# they are not currently used.
402#
403alladicignore:
404	-@${RM} ${INSTALL_LIB_DIR}/adicignore
405	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
406
407alladic:
408	-@echo "Beginning to compile ADIC source code in all directories"
409	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
410	-@echo "========================================="
411	-@cd include ; \
412           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
413	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
414	-@cd src/inline ; \
415            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
416	-@cd src/blaslapack ; \
417            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
418
419alladiclib:
420	-@echo "Beginning to compile ADIC libraries in all directories"
421	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
422	-@echo "-----------------------------------------"
423	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
424	-@echo "-----------------------------------------"
425	-@echo "Using configuration flags:"
426	-@grep "define " bmake/${PETSC_ARCH}/petscconf.h
427	-@echo "-----------------------------------------"
428	-@echo "Using include paths: ${PETSC_INCLUDE}"
429	-@echo "-----------------------------------------"
430	-@echo "Using PETSc directory: ${PETSC_DIR}"
431	-@echo "Using PETSc arch: ${PETSC_ARCH}"
432	-@echo "========================================="
433	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.a
434	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
435	-@cd src/blaslapack ; \
436            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
437	-@cd src/adic/src ; \
438            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
439
440# -------------------------------------------------------------------------------
441#
442# Some macros to check if the fortran interface is up-to-date.
443#
444countfortranfunctions:
445	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
446	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
447	sed "s/_$$//" | sort > /tmp/countfortranfunctions
448
449countcfunctions:
450	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
451	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
452	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
453
454difffortranfunctions: countfortranfunctions countcfunctions
455	-@echo -------------- Functions missing in the fortran interface ---------------------
456	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
457	-@echo ----------------- Functions missing in the C interface ------------------------
458	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
459	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
460
461checkbadfortranstubs:
462	-@echo "========================================="
463	-@echo "Functions with MPI_Comm as an Argument"
464	-@echo "========================================="
465	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
466	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
467	-@echo "========================================="
468	-@echo "Functions with a String as an Argument"
469	-@echo "========================================="
470	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
471	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
472	-@echo "========================================="
473	-@echo "Functions with Pointers to PETSc Objects as Argument"
474	-@echo "========================================="
475	-@cd ${PETSC_DIR}/src/fortran/auto; \
476	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
477	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
478	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
479	for OBJ in $$_p_OBJ; do \
480	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
481	cut -d'(' -f1 | cut -d' ' -f1,3; \
482	done
483# Builds noise routines (not yet publically available)
484# Note:	 libfast cannot run on .F files on certain machines, so we
485# use lib and check for errors here.
486noise: info chklib_dir
487	-@echo "Beginning to compile noise routines"
488	-@echo "========================================="
489	-@cd src/snes/interface/noise; \
490	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib > trashz 2>&1; \
491	  grep -v clog trashz | grep -v "information sections" | \
492	  egrep -i '(Error|warning|Can)' >> /dev/null;\
493	  if [ "$$?" != 1 ]; then \
494	  cat trashz ; fi; ${RM} trashz
495	${RANLIB} ${INSTALL_LIB_DIR}/libpetscsnes.a
496	-@chmod g+w  ${INSTALL_LIB_DIR}/libpetscsnes.a
497	-@echo "Completed compiling noise routines"
498	-@echo "========================================="
499
500#
501# Automatically generates PETSc exercises in html from the tutorial examples.
502#
503# The introduction for each section is obtained from docs/manualpages/bop.${MANSEC} is under RCS and may be edited
504#  (used also in introductions to the manual pages)
505# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
506# The list of exercises is from TUTORIALS in each directory's makefile
507#
508# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
509# The pagemaker rule is in the file bmake/common (at the bottom)
510#
511# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
512#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
513#
514exercises:
515	-@echo "========================================="
516	-@echo "Generating HTML tutorial exercises"
517	-@${RM} docs/pageform.txt
518	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
519	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
520	-@echo "access_format=short"                        >> docs/pageform.txt
521	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
522	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
523	-@echo "Generating HTML for individual directories"
524	-@echo "========================================="
525	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
526	-@echo "Completed HTML for individual directories"
527	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
528	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
529	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
530	-@echo "========================================="
531
532.PHONY: info info_h build build_lt testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
533        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \
534        allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
535        start_configure configure_petsc configure_clean
536
537