1*d20fc7d1SSatish Balay# $Id: makefile,v 1.206 1998/01/06 20:07:40 bsmith Exp balay $ 211b6ed10SLois Curfman McInnes# 3cfd69a58SBarry Smith# This is the makefile for installing PETSc. See the file 4cfd69a58SBarry Smith# Installation for directions on installing PETSc. 5cfd69a58SBarry Smith# See also bmake/common for additional commands. 611b6ed10SLois Curfman McInnes# 711b6ed10SLois Curfman McInnes 8ab94cc7aSSatish BalayCFLAGS = 961523587SBarry SmithSOURCEC = 1061523587SBarry SmithSOURCEF = 11ca161407SBarry SmithDOCS = maint/addlinks maint/builddist \ 12deb7fc1cSBarry Smith maint/buildlinks maint/wwwman maint/xclude maint/crontab\ 13981c4779SBarry Smith bmake/common bmake/*/base* maint/autoftp docs/manualpages/sec/* \ 14630a6785SBarry Smith include/finclude/generateincludes bin/petscviewinfo.text \ 15630a6785SBarry Smith bin/petscoptsinfo.text 1661523587SBarry SmithOBJSC = 1761523587SBarry SmithOBJSF = 1861523587SBarry SmithLIBBASE = libpetscvec 19b16a3bb1SBarry SmithDIRS = src include docs 2061523587SBarry Smith 214e627d3aSBarry Smithinclude $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base 2261523587SBarry Smith 23efd74e9bSBarry Smith# 24efd74e9bSBarry Smith# Prints information about the system and PETSc being compiled 25efd74e9bSBarry Smith# 26efd74e9bSBarry Smithinfo: 27efd74e9bSBarry Smith -@echo "==========================================" 281d91fb6eSBarry Smith -@echo On `date` on `hostname` 2930fdcc7aSBarry Smith -@echo Machine characteristics: `uname -a` 30efd74e9bSBarry Smith -@echo "-----------------------------------------" 31efd74e9bSBarry Smith -@echo "Using C compiler: $(CC) $(COPTFLAGS)" 32614fe6ffSWilliam Gropp -@if [ -n "$(CCV)" -a "$(CCV)" != "unknown" ] ; then \ 33*d20fc7d1SSatish Balay echo "Compiler version:" `$(CCV)` ; fi 34efd74e9bSBarry Smith -@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)" 3547794344SBarry Smith -@echo "-----------------------------------------" 3623f40d59SSatish Balay -@grep PETSC_VERSION_NUMBER include/petsc.h | sed "s/........//" 37f265ae5cSBarry Smith -@echo "-----------------------------------------" 38b14e8f29SBarry Smith -@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)" 3947794344SBarry Smith -@echo "-----------------------------------------" 40b14e8f29SBarry Smith -@echo "Using configuration flags: $(CONF)" 4147794344SBarry Smith -@echo "-----------------------------------------" 42b14e8f29SBarry Smith -@echo "Using include paths: $(PETSC_INCLUDE)" 4347794344SBarry Smith -@echo "-----------------------------------------" 44c2c9bc36SBarry Smith -@echo "Using PETSc directory: $(PETSC_DIR)" 45c2c9bc36SBarry Smith -@echo "Using PETSc arch: $(PETSC_ARCH)" 46efd74e9bSBarry Smith -@echo "------------------------------------------" 47efd74e9bSBarry Smith -@echo "Using C linker: $(CLINKER)" 48efd74e9bSBarry Smith -@echo "Using libraries: $(PETSC_LIB)" 49efd74e9bSBarry Smith -@echo "Using Fortran linker: $(FLINKER)" 503c7f52eaSSatish Balay -@echo "Using Fortran libraries: $(PETSC_FORTRAN_LIB)" 51efd74e9bSBarry Smith -@echo "==========================================" 52efd74e9bSBarry Smith 53efd74e9bSBarry Smith# Builds PETSc libraries for a given BOPT and architecture 54f3eacedaSSatish Balayall: info chkpetsc_dir deletelibs build_kernels 55efd74e9bSBarry Smith -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 5647794344SBarry Smith -@echo "=========================================" 57e35bd481SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 58f3848965SBarry Smith ACTION=libfast tree 59f88f42abSSatish Balay -@cd $(PETSC_DIR)/src/sys/src ; \ 60f88f42abSSatish Balay $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) rs6000_time 614e04c1a0SBarry Smith $(RANLIB) $(PDIR)/*.a 6285232361SSatish Balay -@chmod g+w $(PDIR)/*.a 630b3634f8SBarry Smith -@echo "Completed building libraries" 6447794344SBarry Smith -@echo "=========================================" 650b3634f8SBarry Smith 660b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture 67efd74e9bSBarry Smithtestexamples: info chkopts 68efd74e9bSBarry Smith -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 69eb817c50SBarry Smith -@echo "Due to different numerical round-off on certain" 70eb817c50SBarry Smith -@echo "machines some of the numbers may not match exactly." 7147794344SBarry Smith -@echo "=========================================" 720b3634f8SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 730b3634f8SBarry Smith ACTION=testexamples_1 tree 740b3634f8SBarry Smith -@echo "Completed compiling and running test examples" 7547794344SBarry Smith -@echo "=========================================" 760b3634f8SBarry Smith 770b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture 78efd74e9bSBarry Smithtestexamples_uni: info chkopts 79efd74e9bSBarry Smith -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 808475343bSBarry Smith -@echo "Due to different numerical round-off on certain" 818475343bSBarry Smith -@echo "machines some of the numbers may not match exactly." 8247794344SBarry Smith -@echo "=========================================" 838475343bSBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 848475343bSBarry Smith ACTION=testexamples_4 tree 858475343bSBarry Smith -@echo "Completed compiling and running uniprocessor test examples" 8647794344SBarry Smith -@echo "=========================================" 878475343bSBarry Smith 8835ca7349SBarry Smith# 8911b6ed10SLois Curfman McInnes# Builds PETSc Fortran interface libary 9011b6ed10SLois Curfman McInnes# Note: libfast cannot run on .F files on certain machines, so we 9135ca7349SBarry Smith# use lib and check for errors here. 92efd74e9bSBarry Smithfortran: info chkpetsc_dir 93efd74e9bSBarry Smith -@echo "BEGINNING TO COMPILE FORTRAN INTERFACE LIBRARY" 9447794344SBarry Smith -@echo "=========================================" 95efd74e9bSBarry Smith -$(RM) -f $(PDIR)/libpetscfortran.* 96b16a3bb1SBarry Smith -@cd src/fortran/custom; \ 9735ca7349SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \ 9835ca7349SBarry Smith grep -v clog trashz | grep -v "information sections" | \ 9935ca7349SBarry Smith egrep -i '(Error|warning|Can)' >> /dev/null;\ 10035ca7349SBarry Smith if [ "$$?" != 1 ]; then \ 10135ca7349SBarry Smith cat trashz ; fi; $(RM) trashz 102b16a3bb1SBarry Smith -@cd src/fortran/auto; \ 10335ca7349SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast 10483f0b094SBarry Smith $(RANLIB) $(PDIR)/libpetscfortran.a 10585232361SSatish Balay -@chmod g+w $(PDIR)/*.a 1060b3634f8SBarry Smith -@echo "Completed compiling Fortran interface library" 10747794344SBarry Smith -@echo "=========================================" 10883f0b094SBarry Smith 109971c2310SBarry Smith# 110971c2310SBarry Smith# Builds PETSc Fortran kernels; some numerical kernels have 111971c2310SBarry Smith# a Fortran version that may give better performance on certain 1128c34ac02SLois Curfman McInnes# machines. These always provide better performance for complex numbers. 113efd74e9bSBarry Smithfortrankernels: info chkpetsc_dir 114971c2310SBarry Smith -$(RM) -f $(PDIR)/libpetsckernels.* 115efd74e9bSBarry Smith -@echo "BEGINNING TO COMPILE FORTRAN KERNELS LIBRARY" 116971c2310SBarry Smith -@echo "=========================================" 117971c2310SBarry Smith -@cd src/fortran/kernels; \ 118971c2310SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib 11985232361SSatish Balay -@chmod g+w $(PDIR)/*.a 120971c2310SBarry Smith -@echo "Completed compiling Fortran kernels library" 121971c2310SBarry Smith -@echo "=========================================" 122971c2310SBarry Smith 123727c161cSBarry Smith# Builds PETSc test examples for a given BOPT and architecture 124efd74e9bSBarry Smithtestfortran: info chkopts 125efd74e9bSBarry Smith -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 12647794344SBarry Smith -@echo "=========================================" 127e4ef9893SBarry Smith -@echo "Due to different numerical round-off on certain" 128e4ef9893SBarry Smith -@echo "machines or the way Fortran formats numbers" 129e4ef9893SBarry Smith -@echo "some of the results may not match exactly." 130e4ef9893SBarry Smith -@echo "=========================================" 131e4ef9893SBarry Smith -@echo "On some machines you may get messages of the form" 132e4ef9893SBarry Smith -@echo "PetscScalarAddressToFortran:C and Fortran arrays are" 133e4ef9893SBarry Smith -@echo "not commonly aligned or are too far apart to be indexed" 134e4ef9893SBarry Smith -@echo "by an integer. Locations: C xxxc Fortran xxxf" 135e4ef9893SBarry Smith -@echo "Locations/sizeof(Scalar): C yyc Fortran yyf" 136e4ef9893SBarry Smith -@echo "This indicates that you may not be able to use the" 137e4ef9893SBarry Smith -@echo "PETSc routines VecGetArray() and MatGetArray() from Fortran" 138e4ef9893SBarry Smith -@echo "=========================================" 139727c161cSBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 140727c161cSBarry Smith ACTION=testexamples_3 tree 141727c161cSBarry Smith -@echo "Completed compiling and running Fortran test examples" 14247794344SBarry Smith -@echo "=========================================" 143b1f85764SBarry Smith# 144b1f85764SBarry Smith# Builds PETSc Fortran90 interface libary 145b1f85764SBarry Smith# Note: libfast cannot run on .F files on certain machines, so we 146b1f85764SBarry Smith# use lib and check for errors here. 147b1f85764SBarry Smith# Note: F90 interface currently only supported in NAG F90 compiler 148efd74e9bSBarry Smithfortran90: info chkpetsc_dir fortran 149efd74e9bSBarry Smith -@echo "BEGINNING TO COMPILE FORTRAN90 INTERFACE LIBRARY" 150b1f85764SBarry Smith -@echo "=========================================" 151b1f85764SBarry Smith -@cd src/fortran/f90; \ 152b1f85764SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \ 153b1f85764SBarry Smith grep -v clog trashz | grep -v "information sections" | \ 154b1f85764SBarry Smith egrep -i '(Error|warning|Can)' >> /dev/null;\ 155b1f85764SBarry Smith if [ "$$?" != 1 ]; then \ 156b1f85764SBarry Smith cat trashz ; fi; $(RM) trashz 157b1f85764SBarry Smith $(RANLIB) $(PDIR)/libpetscfortran.a 15885232361SSatish Balay -@chmod g+w $(PDIR)/*.a 159b1f85764SBarry Smith -@echo "Completed compiling Fortran90 interface library" 160b1f85764SBarry Smith -@echo "=========================================" 161b1f85764SBarry Smith 162ad96cc0dSLois Curfman McInnes# Builds noise routines (not yet publically available) 163ad96cc0dSLois Curfman McInnes# Note: libfast cannot run on .F files on certain machines, so we 164ad96cc0dSLois Curfman McInnes# use lib and check for errors here. 165efd74e9bSBarry Smithnoise: info chkpetsc_dir 166ad96cc0dSLois Curfman McInnes -@echo "Beginning to compile noise routines" 167ad96cc0dSLois Curfman McInnes -@echo "=========================================" 168ad96cc0dSLois Curfman McInnes -@cd src/snes/interface/noise; \ 169ad96cc0dSLois Curfman McInnes $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \ 170ad96cc0dSLois Curfman McInnes grep -v clog trashz | grep -v "information sections" | \ 171ad96cc0dSLois Curfman McInnes egrep -i '(Error|warning|Can)' >> /dev/null;\ 172ad96cc0dSLois Curfman McInnes if [ "$$?" != 1 ]; then \ 173ad96cc0dSLois Curfman McInnes cat trashz ; fi; $(RM) trashz 174ad96cc0dSLois Curfman McInnes $(RANLIB) $(PDIR)/libpetscsnes.a 17585232361SSatish Balay -@chmod g+w $(PDIR)/libpetscsnes.a 176ad96cc0dSLois Curfman McInnes -@echo "Completed compiling noise routines" 177ad96cc0dSLois Curfman McInnes -@echo "=========================================" 178ad96cc0dSLois Curfman McInnes 179efd74e9bSBarry Smithpetscblas: info chkpetsc_dir 18066341c5dSSatish Balay -$(RM) -f $(PDIR)/libpetscblas.* 181efd74e9bSBarry Smith -@echo "BEGINNING TO COMPILE C VERSION OF BLAS AND LAPACK" 18266341c5dSSatish Balay -@echo "=========================================" 18366341c5dSSatish Balay -@cd src/adic/blas; \ 18466341c5dSSatish Balay $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast 18566341c5dSSatish Balay -@cd src/adic/lapack; \ 18666341c5dSSatish Balay $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=libfast tree 18766341c5dSSatish Balay $(RANLIB) $(PDIR)/libpetscblas.a 18885232361SSatish Balay -@chmod g+w $(PDIR)/*.a 189229e8d5cSBarry Smith -@echo "Completed compiling C version of BLAS and LAPACK" 19066341c5dSSatish Balay -@echo "=========================================" 19166341c5dSSatish Balay 192f3eacedaSSatish Balay# If fortrankernels are used, build them. 193f3eacedaSSatish Balaybuild_kernels: 19478a0b705SSatish Balay -@if [ "$(KERNEL_LIB)" != "" ] ; then \ 195f3eacedaSSatish Balay $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) fortrankernels; fi 196ad96cc0dSLois Curfman McInnes 197f3eacedaSSatish Balay# Ranlib on the libraries 1988c37ef55SBarry Smithranlib: 1994e04c1a0SBarry Smith $(RANLIB) $(PDIR)/*.a 20061523587SBarry Smith 20111b6ed10SLois Curfman McInnes# Deletes PETSc libraries 202f3eacedaSSatish Balaydeletelibs: chkopts_basic 203f3eacedaSSatish Balay -$(RM) -f $(PDIR)/* 204d44968ceSBarry Smith 20511b6ed10SLois Curfman McInnes# Deletes man pages (HTML version) 206981c4779SBarry Smithdeletemanualpages: 207981c4779SBarry Smith $(RM) -f $(PETSC_DIR)/docs/manualpages/man*/* $(PETSC_DIR)/docs/manualpages/www.cit \ 208981c4779SBarry Smith $(PETSC_DIR)/docs/manualpages/man*.html 209b346654fSBarry Smith 21011b6ed10SLois Curfman McInnes# Deletes man pages (LaTeX version) 211b346654fSBarry Smithdeletelatexpages: 2127857610eSBarry Smith $(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex 21320563c6bSBarry Smith 21465783a8cSBarry Smith# To access the tags in EMACS, type M-x visit-tags-table and specify 21565783a8cSBarry Smith# the file petsc/TAGS. 21665783a8cSBarry Smith# 1) To move to where a PETSc function is defined, enter M-. and the 21765783a8cSBarry Smith# function name. 21865783a8cSBarry Smith# 2) To search for a string and move to the first occurrence, 21965783a8cSBarry Smith# use M-x tags-search and the string. 2207acb7333SLois Curfman McInnes# To locate later occurrences, use M-, 2217acb7333SLois Curfman McInnes 222b38bb785SSatish BalayTAGS_INCLUDE_FILES = include/*.h include/pinclude/*.h include/FINCLUDE/*.h 223b38bb785SSatish BalayTAGS_BMAKE_FILES = bmake/common bmake/*/base* 224b38bb785SSatish BalayTAGS_EXAMPLE_FILES = src/*/examples/*/*.[c,h,F,f] src/*/examples/*/*/*.[c,h,F,f] \ 225b38bb785SSatish Balay src/benchmarks/*.c src/contrib/*/examples/*/*.[c,h,F,f] 226b38bb785SSatish BalayTAGS_DOC_FILES = docs/tex/manual/routin.tex docs/tex/manual/manual.tex \ 227b38bb785SSatish Balay docs/tex/manual/manual_tex.tex docs/tex/manual/intro.tex \ 228b38bb785SSatish Balay docs/tex/manual/part1.tex docs/tex/manual/part2.tex 2294431cf12SSatish BalayTAGS_SRC_FILES = src/*/*.[c,h] src/*/interface/*.[c,h] src/*/src/*.[c,h] \ 230b38bb785SSatish Balay src/*/utils/*.[c,h] \ 231b38bb785SSatish Balay src/*/impls/*.[c,h] src/*/impls/*/*.[c,h] src/*/impls/*/*/*.[c,h] \ 232b334301eSBarry Smith src/gvec/impls/*/*/*/*/*.[c,h] src/contrib/*/*.[c,h] \ 233e38488c2SSatish Balay src/contrib/*/src/*.[c,h] src/fortran/custom/*.[c,h,F] \ 234e38488c2SSatish Balay src/fortran/f90/*.[c,h,F] src/fortran/kernels/*.[c,h,F] 235b38bb785SSatish BalayTAGS_MAKEFILE_FILES = include/makefile include/*/makefile \ 236b38bb785SSatish Balay makefile \ 237b38bb785SSatish Balay src/makefile src/*/makefile src/*/src/makefile \ 238b38bb785SSatish Balay src/*/interface/makefile \ 239b38bb785SSatish Balay src/*/utils/makefile \ 240b38bb785SSatish Balay src/*/impls/makefile src/*/impls/*/makefile src/*/impls/*/*/makefile \ 241b38bb785SSatish Balay src/*/examples/makefile src/*/examples/*/makefile src/*/examples/*/*/makefile \ 242b38bb785SSatish Balay src/gvec/impls/*/*/*/*/makefile src/gvec/impls/*/*/*/makefile \ 243b38bb785SSatish Balay src/fortran/*/makefile \ 244b38bb785SSatish Balay src/contrib/*/makefile src/contrib/*/src/makefile \ 245b38bb785SSatish Balay src/contrib/*/examples/makefile src/contrib/*/examples/*/makefile \ 246b38bb785SSatish Balay docs/makefile 247b38bb785SSatish Balay 24811b6ed10SLois Curfman McInnes# Builds all etags files 24911b6ed10SLois Curfman McInnesalletags: 2509ae7ee0fSLois Curfman McInnes -make etags_complete 25111b6ed10SLois Curfman McInnes -make etags 25211b6ed10SLois Curfman McInnes -make etags_noexamples 25311b6ed10SLois Curfman McInnes -make etags_makefiles 25411b6ed10SLois Curfman McInnes 25511b6ed10SLois Curfman McInnes# Builds the basic etags file. This should be employed by most users. 25620563c6bSBarry Smithetags: 257edd2f0e1SBarry Smith $(RM) TAGS 258b38bb785SSatish Balay etags -f TAGS $(TAGS_INCLUDE_FILES) 259b38bb785SSatish Balay etags -a -f TAGS $(TAGS_SRC_FILES) 260b38bb785SSatish Balay etags -a -f TAGS $(TAGS_EXAMPLE_FILES) 261b38bb785SSatish Balay etags -a -f TAGS $(TAGS_MAKEFILE_FILES) 262b38bb785SSatish Balay etags -a -f TAGS $(TAGS_BMAKE_FILES) 26328988994SBarry Smith chmod g+w TAGS 264bfce26a3SBarry Smith 26529cdf679SBarry Smith# Builds complete etags list; only for PETSc developers. 26629cdf679SBarry Smithetags_complete: 26729cdf679SBarry Smith $(RM) TAGS_COMPLETE 2689ca56a1bSSatish Balay etags -f TAGS_COMPLETE $(TAGS_SRC_FILES) 2699ca56a1bSSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_INCLUDE_FILES) 270b38bb785SSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_EXAMPLE_FILES) 271b38bb785SSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_MAKEFILE_FILES) 272b38bb785SSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_BMAKE_FILES) 273b38bb785SSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_DOC_FILES) 27429cdf679SBarry Smith chmod g+w TAGS_COMPLETE 27529cdf679SBarry Smith 27611b6ed10SLois Curfman McInnes# Builds the etags file that excludes the examples directories 277bfce26a3SBarry Smithetags_noexamples: 278bfce26a3SBarry Smith $(RM) TAGS_NO_EXAMPLES 2799ca56a1bSSatish Balay etags -f TAGS_NO_EXAMPLES $(TAGS_SRC_FILES) 2809ca56a1bSSatish Balay etags -a -f TAGS_NO_EXAMPLES $(TAGS_INCLUDE_FILES) 281b38bb785SSatish Balay etags -a -f TAGS_NO_EXAMPLES $(TAGS_MAKEFILE_FILES) 282b38bb785SSatish Balay etags -a -f TAGS_NO_EXAMPLES $(TAGS_BMAKE_FILES) 283b38bb785SSatish Balay etags -a -f TAGS_NO_EXAMPLES $(TAGS_DOC_FILES) 284bfce26a3SBarry Smith chmod g+w TAGS_NO_EXAMPLES 285b16a3bb1SBarry Smith 28611b6ed10SLois Curfman McInnes# Builds the etags file for makefiles 287b16a3bb1SBarry Smithetags_makefiles: 288b16a3bb1SBarry Smith $(RM) TAGS_MAKEFILES 289b38bb785SSatish Balay etags -f TAGS_MAKEFILES $(TAGS_MAKEFILE_FILES) 290b38bb785SSatish Balay etags -a -f TAGS_MAKEFILES $(TAGS_BMAKE_FILES) 291b16a3bb1SBarry Smith chmod g+w TAGS_MAKEFILES 29211b6ed10SLois Curfman McInnes 293dc80aa23SSatish Balay# Builds the etags file for examples 294dc80aa23SSatish Balayetags_examples: 295dc80aa23SSatish Balay $(RM) TAGS_EXAMPLES 296dc80aa23SSatish Balay etags -f TAGS_EXAMPLES $(TAGS_EXAMPLE_FILES) 297dc80aa23SSatish Balay chmod g+w TAGS_EXAMPLES 298dc80aa23SSatish Balay 299b38bb785SSatish Balay# 30065783a8cSBarry Smith# To use the tags file from VI do the following: 30165783a8cSBarry Smith# 1. within vi invoke the command - :set tags=/home/bsmith/petsc/tags 302b38bb785SSatish Balay# or add the command to your ~/.exrc file - set tags=/home/bsmith/petsc/tags 303b38bb785SSatish Balay# 2. now to go to a tag do - :tag TAGNAME for eg - :tag MatCreate 304b38bb785SSatish Balay# 305b38bb785SSatish Balayctags: 306b38bb785SSatish Balay $(RM) tags 307b8319b70SSatish Balay ctags -w -f tags $(TAGS_INCLUDE_FILES) 308b8319b70SSatish Balay ctags -w -a -f tags $(TAGS_SRC_FILES) 309b38bb785SSatish Balay ctags -w -a -f tags $(TAGS_EXAMPLE_FILES) 310b38bb785SSatish Balay ctags -w -a -f tags $(TAGS_MAKEFILE_FILES) 311b38bb785SSatish Balay ctags -w -a -f tags $(TAGS_BMAKE_FILES) 312b38bb785SSatish Balay chmod g+w tags 313b38bb785SSatish Balay 31411b6ed10SLois Curfman McInnes# ------------------------------------------------------------------ 31511b6ed10SLois Curfman McInnes# 31611b6ed10SLois Curfman McInnes# All remaining actions are intended for PETSc developers only. 31711b6ed10SLois Curfman McInnes# PETSc users should not generally need to use these commands. 31811b6ed10SLois Curfman McInnes# 31911b6ed10SLois Curfman McInnes 32011b6ed10SLois Curfman McInnes# Builds all versions of the man pages 321981c4779SBarry Smithallmanpages: allmanualpages alllatexpages 322981c4779SBarry Smithallmanualpages: deletemanualpages 323981c4779SBarry Smith -make ACTION=manualpages_buildcite tree 324981c4779SBarry Smith -cd src/fortran/custom; make manualpages_buildcite 325981c4779SBarry Smith -cd src/fortran/custom; make manualpages 326981c4779SBarry Smith -make ACTION=manualpages tree 327dea827f2SLois Curfman McInnes -maint/wwwman 328981c4779SBarry Smith -maint/examplesindex.tcl 329f8cfbf3fSSatish Balay -maint/htmlkeywords.tcl 330981c4779SBarry Smith -@chmod g+w docs/manualpages/man*/* 331e01137a2SSatish Balay 332416022c9SBarry Smithalllatexpages: deletelatexpages 333416022c9SBarry Smith -make ACTION=latexpages tree 334c3e30b67SBarry Smith -cd src/fortran/custom; make latexpages 33551c61065SBarry Smith -@chmod g+w docs/tex/rsum/* 336416022c9SBarry Smith 33711b6ed10SLois Curfman McInnes# Builds Fortran stub files 33811b6ed10SLois Curfman McInnesallfortranstubs: 33935aab85fSBarry Smith -@include/finclude/generateincludes 3400a0eb2c5SBarry Smith -@$(RM) -f src/fortran/auto/*.c 34111b6ed10SLois Curfman McInnes -make ACTION=fortranstubs tree 3420a0eb2c5SBarry Smith chmod g+w src/fortran/auto/*.c 343f6ff2982SSatish Balay 344d55938c2SBarry Smithallci: 345d55938c2SBarry Smith -@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) ci 346b951964fSBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=ci tree 347b951964fSBarry Smith 348d55938c2SBarry Smithallco: 349d55938c2SBarry Smith -@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) co 350d55938c2SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=co tree 351d55938c2SBarry Smith 352b334301eSBarry Smith# 353b334301eSBarry Smith# The commands below are for generating ADIC versions of the code; 354b334301eSBarry Smith# they are not currently used. 355b334301eSBarry Smith# 356b334301eSBarry SmithCFLAGS = $(CPPFLAGS) $(CONF) 3575eea60f9SBarry Smithalladicignore: 3585eea60f9SBarry Smith -@$(RM) $(PDIR)/adicignore 3595eea60f9SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adicignore tree 3605eea60f9SBarry Smith 3615eea60f9SBarry Smithalladic: 362d18b0ea7SBarry Smith -@echo "Beginning to compile ADIC source code in all directories" 363d18b0ea7SBarry Smith -@echo "Using ADIC compiler: $(ADIC_CC) $(CFLAGS)" 364d18b0ea7SBarry Smith -@echo "=========================================" 36547794344SBarry Smith -@cd include ; \ 366f218b1c0SBarry Smith $(ADIC_CC) -s -f 1 $(CFLAGS) petsc.h 367ba8edd79SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic tree 36847794344SBarry Smith -@cd src/inline ; \ 36947794344SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic 3707e351921SBarry Smith -@cd src/adic/blas ; \ 3717e351921SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic 3727e351921SBarry Smith -@cd src/adic/lapack ; \ 373e1063516SSatish Balay $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic tree 3746e81b665SBarry Smith 37547794344SBarry Smithalladiclib: 376d18b0ea7SBarry Smith -@echo "Beginning to compile ADIC libraries in all directories" 377d18b0ea7SBarry Smith -@echo "Using compiler: $(CC) $(COPTFLAGS)" 378d18b0ea7SBarry Smith -@echo "-----------------------------------------" 379d18b0ea7SBarry Smith -@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)" 380d18b0ea7SBarry Smith -@echo "-----------------------------------------" 381d18b0ea7SBarry Smith -@echo "Using configuration flags: $(CONF)" 382d18b0ea7SBarry Smith -@echo "-----------------------------------------" 383d18b0ea7SBarry Smith -@echo "Using include paths: $(PETSC_INCLUDE)" 384d18b0ea7SBarry Smith -@echo "-----------------------------------------" 385d18b0ea7SBarry Smith -@echo "Using PETSc directory: $(PETSC_DIR)" 386d18b0ea7SBarry Smith -@echo "Using PETSc arch: $(PETSC_ARCH)" 387d18b0ea7SBarry Smith -@echo "=========================================" 388f218b1c0SBarry Smith -@$(RM) -f $(PDIR)/*adic.a 38947794344SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib tree 3907e351921SBarry Smith -@cd src/adic/blas ; \ 3917e351921SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adiclib 3927e351921SBarry Smith -@cd src/adic/lapack ; \ 393e1063516SSatish Balay $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib tree 3947e351921SBarry Smith -@cd src/adic/src ; \ 395cb3b3f49SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib 3965eea60f9SBarry Smith 3979e417c50SSatish Balay# ------------------------------------------------------------------------------- 3989e417c50SSatish Balay# 3999e417c50SSatish Balay# Some macros to check if the fortran interface is up-to-date. 4009e417c50SSatish Balay# 4019e417c50SSatish Balaycountfortranfunctions: 4029e417c50SSatish Balay -@cd $(PETSC_DIR)/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 4039e417c50SSatish Balay cut -d'(' -f1 | tr -s '' ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 4049e417c50SSatish Balay sed "s/_$$//" | sort > /tmp/countfortranfunctions 405b334301eSBarry Smith 4069e417c50SSatish Balaycountcfunctions: 4079e417c50SSatish Balay -@ grep extern $(PETSC_DIR)/include/*.h *.h | grep "(" | tr -s '' ' ' | \ 4089e417c50SSatish Balay cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '' '\012' | \ 4099e417c50SSatish Balay tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 4109e417c50SSatish Balay 4119e417c50SSatish Balaydifffortranfunctions: countfortranfunctions countcfunctions 4129e417c50SSatish Balay -@echo -------------- Functions missing in the fortran interface --------------------- 4139e417c50SSatish Balay -@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 4149e417c50SSatish Balay -@echo ----------------- Functions missing in the C interface ------------------------ 4159e417c50SSatish Balay -@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 4169e417c50SSatish Balay -@$(RM) /tmp/countcfunctions /tmp/countfortranfunctions 417b334301eSBarry Smith 4183f4c9a3aSSatish Balaycheckbadfortranstubs: 4193f4c9a3aSSatish Balay -@echo "=========================================" 4203f4c9a3aSSatish Balay -@echo "Functions with MPI_Comm as an Argument" 4213f4c9a3aSSatish Balay -@echo "=========================================" 4223f4c9a3aSSatish Balay -@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 4233f4c9a3aSSatish Balay tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 4243f4c9a3aSSatish Balay -@echo "=========================================" 4253f4c9a3aSSatish Balay -@echo "Functions with a String as an Argument" 4263f4c9a3aSSatish Balay -@echo "=========================================" 4273f4c9a3aSSatish Balay -@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 4283f4c9a3aSSatish Balay tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 4293f4c9a3aSSatish Balay -@echo "=========================================" 4303f4c9a3aSSatish Balay -@echo "Functions with Pointers to PETSc Objects as Argument" 4313f4c9a3aSSatish Balay -@echo "=========================================" 4323f4c9a3aSSatish Balay -@cd $(PETSC_DIR)/src/fortran/auto; \ 4333f4c9a3aSSatish Balay _p_OBJ=`grep _p_ $(PETSC_DIR)/include/*.h | tr -s '' ' ' | \ 4343f4c9a3aSSatish Balay cut -d' ' -f 3 | tr -s '' '\012' | grep -v '{' | cut -d'*' -f1 | \ 4353f4c9a3aSSatish Balay sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 4363f4c9a3aSSatish Balay for OBJ in $$_p_OBJ; do \ 4373f4c9a3aSSatish Balay grep "$$OBJ \*" *.c | tr -s '' ' ' | tr -s ':' ' ' | \ 4383f4c9a3aSSatish Balay cut -d'(' -f1 | cut -d' ' -f1,3; \ 4393f4c9a3aSSatish Balay done 440