xref: /petsc/makefile (revision cbdba4167cb3324043c04e039d70263c86cf38f8)
1
2#
3# This is the makefile for compiling PETSc. See
4# http://www.mcs.anl.gov/petsc/petsc-as/documentation/installation.html for directions on installing PETSc.
5# See also conf for additional commands.
6#
7ALL: all
8LOCDIR	 = ./
9DIRS	 = src include tutorials
10CFLAGS	 =
11FFLAGS	 =
12
13include ${PETSC_DIR}/conf/base
14include ${PETSC_DIR}/conf/test
15
16#
17# Basic targets to build PETSc libraries.
18# all: builds the c, fortran, and f90 libraries
19all:
20	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  chkpetsc_dir
21	-@${OMAKE} all_build 2>&1 | tee ${PETSC_ARCH}/conf/make.log
22	-@if [ -L make.log ]; then ${RM} make.log; fi; ln -s ${PETSC_ARCH}/conf/make.log make.log
23	-@egrep -i "( error | error:)" ${PETSC_ARCH}/conf/make.log > /dev/null; if [ "$$?" = "0" ]; then \
24           echo "********************************************************************" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \
25           echo "  Error during compile, check ${PETSC_ARCH}/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \
26           echo "  Send it and ${PETSC_ARCH}/conf/configure.log to petsc-maint@mcs.anl.gov" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log;\
27           echo "********************************************************************" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \
28           exit 1; \
29	 else \
30	  ${OMAKE} shared_install  2>&1 | tee -a ${PETSC_ARCH}/conf/make.log ;\
31	 fi
32
33#
34#  Notes: the shared_nomesg and petsc4py should NOT be built if --prefix was used
35#  the rules for shared_nomesg_noinstall petsc4py_noinstall are generated automatically
36#  by config/PETSc/Configure.py and config/PETSc/packages/petsc4py.py based on the existance
37all_build: chk_petsc_dir chklib_dir info info_h deletelibs deletemods build shared_nomesg_noinstall mpi4py_noinstall petsc4py_noinstall
38#
39# Prints information about the system and version of PETSc being compiled
40#
41info:
42	-@echo "=========================================="
43	-@echo " "
44	-@echo "See documentation/faq.html and documentation/bugreporting.html"
45	-@echo "for help with installation problems. Please send EVERYTHING"
46	-@echo "printed out below when reporting problems"
47	-@echo " "
48	-@echo "To subscribe to the PETSc announcement list, send mail to "
49	-@echo "majordomo@mcs.anl.gov with the message: "
50	-@echo "subscribe petsc-announce"
51	-@echo " "
52	-@echo "To subscribe to the PETSc users mailing list, send mail to "
53	-@echo "majordomo@mcs.anl.gov with the message: "
54	-@echo "subscribe petsc-users"
55	-@echo " "
56	-@echo "=========================================="
57	-@echo On `date` on `hostname`
58	-@echo Machine characteristics: `uname -a`
59	-@echo "-----------------------------------------"
60	-@echo "Using PETSc directory: ${PETSC_DIR}"
61	-@echo "Using PETSc arch: ${PETSC_ARCH}"
62	-@echo "-----------------------------------------"
63	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
64	-@echo "-----------------------------------------"
65	-@echo "Using configure Options: ${CONFIGURE_OPTIONS}"
66	-@echo "Using configuration flags:"
67	-@grep "\#define " ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h
68	-@echo "-----------------------------------------"
69	-@echo "Using include paths: ${PETSC_INCLUDE}"
70	-@echo "------------------------------------------"
71	-@echo "Using C/C++ compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}"
72	-@echo "C/C++ Compiler version: " `${CCV}`
73	-@if [ "${FC}" != "" ]; then \
74	   echo "Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}";\
75	   echo "Fortran Compiler version: " `${FCV}`;\
76         fi
77	-@echo "-----------------------------------------"
78	-@echo "Using C/C++ linker: ${PCC_LINKER}"
79	-@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}"
80	-@if [ "${FC}" != "" ]; then \
81	   echo "Using Fortran linker: ${FC_LINKER}";\
82	   echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\
83         fi
84	-@echo "-----------------------------------------"
85	-@echo "Using libraries: ${PETSC_LIB}"
86	-@echo "------------------------------------------"
87	-@echo "Using mpiexec: ${MPIEXEC}"
88	-@echo "=========================================="
89#
90#
91MINFO = ${PETSC_DIR}/${PETSC_ARCH}/include/petscmachineinfo.h
92info_h:
93	-@$(RM) -f ${MINFO} MINFO
94	-@echo  "static const char *petscmachineinfo = \"\__n__\"" >> MINFO
95	-@echo  "\"-----------------------------------------\__n__\"" >> MINFO
96	-@if [ -f /usr/bin/cygcheck.exe ]; then \
97	  echo  "\"Libraries compiled on `date` on `hostname|/usr/bin/dos2unix` \__n__\"" >> MINFO; \
98          else \
99	  echo  "\"Libraries compiled on `date` on `hostname` \__n__\"" >> MINFO; \
100          fi
101	-@echo  "\"Machine characteristics: `uname -a` \__n__\"" >> MINFO
102	-@echo  "\"Using PETSc directory: ${PETSC_DIR}\__n__\"" >> MINFO
103	-@echo  "\"Using PETSc arch: ${PETSC_ARCH}\__n__\"" >> MINFO
104	-@echo  "\"-----------------------------------------\"; " >> MINFO
105	-@echo  "static const char *petsccompilerinfo = \"\__n__\"" >> MINFO
106	-@echo  "\"Using C compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}\__n__\"" >> MINFO
107	-@echo  "\"Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}\__n__\"" >> MINFO
108	-@echo  "\"-----------------------------------------\"; " >> MINFO
109	-@echo  "static const char *petsccompilerflagsinfo = \"\__n__\"" >> MINFO
110	-@echo  "\"Using include paths: ${PETSC_INCLUDE}\__n__\"" >> MINFO
111	-@echo  "\"------------------------------------------\"; " >> MINFO
112	-@echo  "static const char *petsclinkerinfo = \"\__n__\"" >> MINFO
113	-@echo  "\"Using C linker: ${CLINKER}\__n__\"" >> MINFO
114	-@echo  "\"Using Fortran linker: ${FLINKER}\__n__\"" >> MINFO
115	-@echo  "\"Using libraries: ${PETSC_LIB} \__n__\"" >> MINFO
116	-@echo  "\"------------------------------------------\"; " >> MINFO
117	-@cat MINFO | ${SED} -e 's/\\ /\\\\ /g' | ${SED} -e 's/__n__/n/g' > ${MINFO}
118	-@ if [ -f /usr/bin/cygcheck.exe ]; then /usr/bin/dos2unix ${MINFO} 2> /dev/null; fi
119	-@$(RM) -f MINFO
120
121#
122# Builds the PETSc libraries
123# This target also builds fortran77 and f90 interface
124# files and compiles .F files
125#
126build:
127	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
128	-@echo "========================================="
129	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
130	-@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}  > tmpf 2>&1 ; ${GREP} -v "has no symbols" tmpf; ${RM} tmpf;
131	-@echo "Completed building libraries"
132	-@echo "========================================="
133#
134#
135# Builds PETSc test examples for a given architecture
136#
137test:
138	-@${OMAKE} test_build 2>&1 | tee ${PETSC_DIR}/${PETSC_ARCH}/conf/test.log
139test_build:
140	-@echo "Running test examples to verify correct installation"
141	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} clean
142	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex19
143	@if [ "${FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex5f; fi;
144	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} clean
145	-@echo "Completed test examples"
146
147testexamples: info
148	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
149	-@echo "Due to different numerical round-off on certain"
150	-@echo "machines some of the numbers may not match exactly."
151	-@echo "========================================="
152	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C  tree
153	-@echo "Completed compiling and running test examples"
154	-@echo "========================================="
155testfortran: info
156	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
157	-@echo "========================================="
158	-@echo "Due to different numerical round-off on certain"
159	-@echo "machines or the way Fortran formats numbers"
160	-@echo "some of the results may not match exactly."
161	-@echo "========================================="
162	-@if [ "${FC}" != "" ]; then \
163            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran tree; \
164            echo "Completed compiling and running Fortran test examples"; \
165          else \
166            echo "Error: No FORTRAN compiler available"; \
167          fi
168	-@echo "========================================="
169testexamples_uni: info
170	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
171	-@echo "Due to different numerical round-off on certain"
172	-@echo "machines some of the numbers may not match exactly."
173	-@echo "========================================="
174	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C_X11_MPIUni  tree
175	-@echo "Completed compiling and running uniprocessor test examples"
176	-@echo "========================================="
177testfortran_uni: info
178	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
179	-@echo "Due to different numerical round-off on certain"
180	-@echo "machines some of the numbers may not match exactly."
181	-@echo "========================================="
182	-@if [ "${FC}" != "" ]; then \
183            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni  tree; \
184            echo "Completed compiling and running uniprocessor fortran test examples"; \
185          else \
186            echo "Error: No FORTRAN compiler available"; \
187          fi
188	-@
189	-@echo "========================================="
190
191# Ranlib on the libraries
192ranlib:
193	${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}
194
195# Deletes PETSc libraries
196deletelibs:
197	-${RM} -f ${PETSC_LIB_DIR}/libpetsc*.*
198deletemods:
199	-${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod
200
201# Cleans up build
202allclean: deletelibs deletemods
203	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
204
205
206#
207# Check if PETSC_DIR variable specified is valid
208#
209chk_petsc_dir:
210	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
211	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
212	  echo "You need to use / to separate directories, not \\!"; \
213	  echo "Aborting build"; \
214	  false; fi
215#
216#
217install:
218	-@./config/install.py
219
220newall:
221	-@cd src/sys; ${PETSC_DIR}/config/builder.py
222	-@cd src/vec; ${PETSC_DIR}/config/builder.py
223	-@cd src/mat; ${PETSC_DIR}/config/builder.py
224	-@cd src/dm; ${PETSC_DIR}/config/builder.py
225	-@cd src/ksp; ${PETSC_DIR}/config/builder.py
226	-@cd src/snes; ${PETSC_DIR}/config/builder.py
227	-@cd src/ts; ${PETSC_DIR}/config/builder.py
228# ------------------------------------------------------------------
229#
230# All remaining actions are intended for PETSc developers only.
231# PETSc users should not generally need to use these commands.
232#
233
234# To access the tags in EMACS, type M-x visit-tags-table and specify
235# the file petsc/TAGS.
236# 1) To move to where a PETSc function is defined, enter M-. and the
237#     function name.
238# 2) To search for a string and move to the first occurrence,
239#     use M-x tags-search and the string.
240#     To locate later occurrences, use M-,
241# Builds all etags files
242alletags:
243	-@bin/maint/generateetags.py
244	-@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON
245
246allfortranstubs:
247	-@bin/maint/generatefortranstubs.py ${BFORT}
248deletefortranstubs:
249	-@find . -type d -name ftn-auto | xargs rm -rf
250#
251# These are here for the target allci and allco, and etags
252#
253
254BMAKEFILES = conf/base conf/test bmake/adic.init bmake/adicmf.init
255SCRIPTS    = bin/maint/builddist  bin/maint/wwwman bin/maint/xclude bin/maint/bugReport.py bin/maint/buildconfigtest bin/maint/builddistlite \
256             bin/maint/buildtest bin/maint/checkBuilds.py bin/maint/copylognightly bin/maint/copylognightly.tao bin/maint/countfiles bin/maint/findbadfiles \
257             bin/maint/fixinclude bin/maint/getexlist bin/maint/getpdflabels.py bin/maint/helpindex.py bin/maint/hosts.local bin/maint/hosts.solaris  \
258             bin/maint/lex.py  bin/maint/mapnameslatex.py bin/maint/startnightly bin/maint/startnightly.tao bin/maint/submitPatch.py \
259             bin/maint/update-docs.py  bin/maint/wwwindex.py bin/maint/xcludebackup bin/maint/xcludecblas bin/maint/zap bin/maint/zapall \
260             config/PETSc/Configure.py config/PETSc/Options.py \
261             config/PETSc/packages/*.py config/PETSc/utilities/*.py
262
263
264# Builds all the documentation - should be done every night
265alldoc: alldoc1 alldoc2
266
267# Build everything that goes into 'doc' dir except html sources
268alldoc1: chk_loc deletemanualpages chk_concepts_dir
269	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
270	-@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap
271	-@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap
272	-cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC}
273	-${OMAKE} ACTION=manualpages tree_basic LOC=${LOC}
274	-bin/maint/wwwindex.py ${PETSC_DIR} ${LOC}
275	-${OMAKE} ACTION=manexamples tree_basic LOC=${LOC}
276	-${OMAKE} manconcepts LOC=${LOC}
277	-${OMAKE} ACTION=getexlist tree_basic LOC=${LOC}
278	-${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC}
279	-bin/maint/helpindex.py ${PETSC_DIR} ${LOC}
280	-grep -h Polymorphic include/*.h | grep -v '#define ' | sed "s?PetscPolymorphic[a-zA-Z]*(??g" | cut -f1 -d"{" > tmppoly
281	-bin/maint/processpoly.py ${PETSC_DIR} ${LOC}
282	-${RM} tmppoly
283
284# Builds .html versions of the source
285# html overwrites some stuff created by update-docs - hence this is done later.
286alldoc2: chk_loc
287	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC}
288	-bin/maint/update-docs.py ${PETSC_DIR} ${LOC}
289
290alldocclean: deletemanualpages allcleanhtml
291
292# Deletes man pages (HTML version)
293deletemanualpages: chk_loc
294	-@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \
295          find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\
296          ${RM} ${LOC}/docs/exampleconcepts ;\
297          ${RM} ${LOC}/docs/manconcepts ;\
298          ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\
299          bin/maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\
300        fi
301
302allcleanhtml:
303	-${RM} include/adic/*.h.html
304	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree
305
306chk_concepts_dir: chk_loc
307	@if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \
308	  echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi
309
310###########################################################
311# targets to build distribution and update docs
312###########################################################
313
314# Creates ${HOME}/petsc.tar.gz [and petsc-lite.tar.gz]
315dist:
316	${PETSC_DIR}/bin/maint/builddist ${PETSC_DIR}
317
318# This target works only if you can do 'ssh petsc@harley.mcs.anl.gov'
319# also copy the file over to ftp site.
320web-snapshot:
321	@if [ ! -f "${HOME}/petsc-dev.tar.gz" ]; then \
322	    echo "~/petsc-dev.tar.gz missing! cannot update petsc-dev snapshot on mcs-web-site"; \
323	  else \
324            echo "updating petsc-dev snapshot on mcs-web-site"; \
325	    tmpdir=`mktemp -d -t petsc-doc.XXXXXXXX`; \
326	    cd $${tmpdir}; tar -xzf ${HOME}/petsc-dev.tar.gz; \
327	    /usr/bin/rsync  -e ssh -az --delete $${tmpdir}/petsc-dev/ \
328              petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as/snapshots/petsc-dev ;\
329	    /bin/cp -f /home/petsc/petsc-dev.tar.gz /mcs/ftp/pub/petsc/petsc-dev.tar.gz;\
330	    ${RM} -rf $${tmpdir} ;\
331	  fi
332
333# build the tarfile - and then update petsc-dev snapshot on mcs-web-site
334update-web-snapshot: dist web-snapshot
335
336# This target updates website main pages
337update-web:
338	@cd ${PETSC_DIR}/src/docs; make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} bib2html; \
339	/usr/bin/rsync -az -C --exclude=BitKeeper --exclude=documentation/installation.html \
340	  ${PETSC_DIR}/src/docs/website/ petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as
341	@cd ${PETSC_DIR}/src/docs/tex/manual; make developers.pdf PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} LOC=${PETSC_DIR}; \
342	/usr/bin/rsync -az developers.pdf petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as/developers/
343
344#
345#  builds a single list of files for each PETSc library so they may all be built in parallel
346#  without a recursive set of make calls
347createfastbuild:
348	cd src/vec; ${RM} -f files; /bin/echo -n "SOURCEC = " > files; make tree ACTION=sourcelist BASE_DIR=${PETSC_DIR}/src/vec;  /bin/echo -n "OBJSC    = $${SOURCEC:.c=.o} " >> files
349
350###########################################################
351
352#
353#  makes .lines files for all source code
354#
355allgcov:
356	-@${RM} -rf ${PETSC_DIR}/tmp/gcov
357	-@mkdir ${PETSC_DIR}/tmp/gcov
358	-${OMAKE} ACTION=gcov PETSC_DIR=${PETSC_DIR} tree
359	-cd ${PETSC_DIR}/tmp/gcov; tar -czf gcov.tar.gz *.lines
360#-${RM) -rf ${PETSC_DIR}/tmp/gcov
361
362# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
363allrcslabel:
364	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
365#
366#   The commands below are for generating ADIC versions of the code;
367# they are not currently used.
368#
369alladicignore:
370	-@${RM} ${INSTALL_LIB_DIR}/adicignore
371	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
372
373alladic:
374	-@echo "Beginning to compile ADIC source code in all directories"
375	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
376	-@echo "========================================="
377	-@cd include ; \
378           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
379	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
380
381alladiclib:
382	-@echo "Beginning to compile ADIC libraries in all directories"
383	-@echo "Using compiler: ${PCC} ${COPTFLAGS}"
384	-@echo "-----------------------------------------"
385	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
386	-@echo "-----------------------------------------"
387	-@echo "Using configuration flags:"
388	-@grep "define " ${PETSC_ARCH}/include/petscconf.h
389	-@echo "-----------------------------------------"
390	-@echo "Using include paths: ${PETSC_INCLUDE}"
391	-@echo "-----------------------------------------"
392	-@echo "Using PETSc directory: ${PETSC_DIR}"
393	-@echo "Using PETSc arch: ${PETSC_ARCH}"
394	-@echo "========================================="
395	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.${AR_LIB_SUFFIX}
396	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
397	-@cd src/adic/src ; \
398            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} lib
399
400# -------------------------------------------------------------------------------
401#
402# Some macros to check if the fortran interface is up-to-date.
403#
404countfortranfunctions:
405	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
406	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
407	sed "s/_$$//" | sort > /tmp/countfortranfunctions
408
409countcfunctions:
410	-@grep extern ${PETSC_DIR}/include/*.h  | grep "(" | tr -s ' ' | \
411	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
412	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
413
414difffortranfunctions: countfortranfunctions countcfunctions
415	-@echo -------------- Functions missing in the fortran interface ---------------------
416	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
417	-@echo ----------------- Functions missing in the C interface ------------------------
418	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
419	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
420
421checkbadfortranstubs:
422	-@echo "========================================="
423	-@echo "Functions with MPI_Comm as an Argument"
424	-@echo "========================================="
425	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
426	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
427	-@echo "========================================="
428	-@echo "Functions with a String as an Argument"
429	-@echo "========================================="
430	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
431	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
432	-@echo "========================================="
433	-@echo "Functions with Pointers to PETSc Objects as Argument"
434	-@echo "========================================="
435	-@cd ${PETSC_DIR}/src/fortran/auto; \
436	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
437	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
438	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
439	for OBJ in $$_p_OBJ; do \
440	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
441	cut -d'(' -f1 | cut -d' ' -f1,3; \
442	done
443#
444# Automatically generates PETSc exercises in html from the tutorial examples.
445#
446# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited
447#  (used also in introductions to the manual pages)
448# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
449# The list of exercises is from TUTORIALS in each directory's makefile
450#
451# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
452# The pagemaker rule is in the file conf (at the bottom)
453#
454# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
455#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
456#
457exercises:
458	-@echo "========================================="
459	-@echo "Generating HTML tutorial exercises"
460	-@${RM} docs/pageform.txt
461	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
462	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
463	-@echo "access_format=short"                        >> docs/pageform.txt
464	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
465	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
466	-@echo "Generating HTML for individual directories"
467	-@echo "========================================="
468	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
469	-@echo "Completed HTML for individual directories"
470	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
471	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
472	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
473	-@echo "========================================="
474
475.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
476        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \
477        allhtml allcleanhtml  allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
478        start_configure configure_petsc configure_clean
479
480getsigs:
481	-@if [ ! -d src/sigs ]; then mkdir -p sigs; fi
482	-@echo ${PETSC_INCLUDE} > sigs/petsc_include
483	-@echo "#include \"petscvec.h\"" > sigs/vec.sigs.h
484	-@grep -h "enum " include/petscsys.h include/petscvec.h >> sigs/vec.sigs.h
485	-@grep " Vec[a-zA-Z][a-zA-Z]*(Vec," include/petscvec.h | grep EXTERN | grep -v "(\*)" | grep -v IS |grep -v VecType | sed "s/EXTERN PetscErrorCode PETSCVEC_DLLEXPORT//g" >> sigs/vec.sigs.h
486	-@echo "#include \"petscmat.h\"" > sigs/mat.sigs.h
487	-@grep "enum " include/petscmat.h | grep } >> sigs/mat.sigs.h
488	-@grep " Mat[a-zA-Z][a-zA-Z]*(Mat," include/petscmat.h | grep EXTERN | grep -v "(\*)" | grep -v IS |grep -v MatType | sed "s/EXTERN PetscErrorCode PETSCMAT_DLLEXPORT//g" >> sigs/mat.sigs.h
489	-@echo "#include \"petscpc.h\"" > sigs/pc.sigs.h
490	-@grep "enum " include/petscpc.h | grep } >> sigs/pc.sigs.h
491	-@grep " PC[a-zA-Z][a-zA-Z]*(PC," include/petscpc.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v PCType | sed "s/EXTERN PetscErrorCode PETSCKSP_DLLEXPORT//g" >> sigs/pc.sigs.h
492	-@echo "#include \"petscksp.h\"" > sigs/ksp.sigs.h
493	-@grep "enum " include/petscksp.h | grep } >> sigs/ksp.sigs.h
494	-@grep " KSP[a-zA-Z][a-zA-Z]*(KSP," include/petscksp.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v KSPType | sed "s/EXTERN PetscErrorCode PETSCKSP_DLLEXPORT//g" >> sigs/ksp.sigs.h
495	-@echo "#include \"petscsnes.h\"" > sigs/snes.sigs.h
496	-@grep " SNES[a-zA-Z][a-zA-Z]*(SNES," include/petscsnes.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v SNESType | sed "s/EXTERN PetscErrorCode PETSCSNES_DLLEXPORT//g" >> sigs/snes.sigs.h
497
498
499
500
501
502
503
504
505
506
507
508petscao : petscmat petscao.f90.h
509petscda : petscksp petscda.f90.h
510petscdraw : petsc petscdraw.f90.h
511petscis : petsc petscis.f90.h
512petscksp : petscpc  petscksp.f90.h
513petsclog : petsc petsclog.f90.h
514petscmat : petscvec petscmat.f90.h
515petscmg : petscksp petscmg.f90.h
516petscpc : petscmat petscpc.f90.h
517petscsnes : petscksp petscsnes.f90.h
518petscsys : petsc petscsys.f90.h
519petscts : petscsnes petscts.f90.h
520petsc : petsc.f90.h
521petscvec : petscis petscvec.f90.h
522petscviewer : petsc petscviewer.f90.h
523petscmesh : petsc petscmesh.f90.h
524modules : petscao petscda petscdraw petscis petscksp petsclog petscmat petscmg petscpc petscsnes petscsys petscts petsc petscvec petscviewer petscmesh
525