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