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