111b6ed10SLois Curfman McInnes# 211b6ed10SLois Curfman McInnes# This makefile contains some basic commands for building PETSc. 311b6ed10SLois Curfman McInnes# See bmake/common for additional commands. 411b6ed10SLois Curfman McInnes# 511b6ed10SLois Curfman McInnes 60de55854SLois Curfman McInnesPETSC_DIR = . 761523587SBarry Smith 855659b69SBarry SmithCFLAGS = -I$(PETSC_DIR)/include -I.. -I$(PETSC_DIR) $(CONF) $(PCONF) 961523587SBarry SmithSOURCEC = 1061523587SBarry SmithSOURCEF = 116daaf66cSBarry SmithSOURCEH = Changes Machines Readme maint/addlinks \ 12bcfa8486SBarry Smith maint/builddist FAQ Installation Performance BugReporting\ 13deb7fc1cSBarry Smith maint/buildlinks maint/wwwman maint/xclude maint/crontab\ 144e627d3aSBarry Smith bmake/common bmake/*/base* maint/autoftp docs/www/sec/* 1561523587SBarry SmithOBJSC = 1661523587SBarry SmithOBJSF = 1761523587SBarry SmithLIBBASE = libpetscvec 18b16a3bb1SBarry SmithDIRS = src include docs 1961523587SBarry Smith 204e627d3aSBarry Smithinclude $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base 2161523587SBarry Smith 2211b6ed10SLois Curfman McInnes# Builds PETSc libraries for a given BOPT and architecture 237857610eSBarry Smithall: chkpetsc_dir 244e04c1a0SBarry Smith -$(RM) -f $(PDIR)/*.a 250b3634f8SBarry Smith -@echo "Beginning to compile libraries in all directories" 26171c9062SLois Curfman McInnes -@echo "Using compiler: $(CC) $(PETSC_INCLUDE) $(CONF) $(PCONF) $(BASEOPT)" 270b3634f8SBarry Smith -@echo "------------------------------------------" 28e35bd481SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 29f3848965SBarry Smith ACTION=libfast tree 30aa45e91cSSatish Balay -@cd $(PETSC_DIR)/src/sys/src ; $(OMAKE) PETSC_ARCH=$(PETSC_ARCH) rs6000_time 314e04c1a0SBarry Smith $(RANLIB) $(PDIR)/*.a 320b3634f8SBarry Smith -@echo "Completed building libraries" 330b3634f8SBarry Smith -@echo "------------------------------------------" 340b3634f8SBarry Smith 350b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture 360b3634f8SBarry Smithtestexamples: chkpetsc_dir 370b3634f8SBarry Smith -@echo "Beginning to compile and run test examples" 389c69534bSBarry Smith -@echo "Using compiler: $(CC) $(PETSC_INCLUDE) $(PCONF) $(BASEOPT)" 399c69534bSBarry Smith -@echo "Using linker: $(CLINKER)" 409c69534bSBarry Smith -@echo "Using libraries: $(PETSC_LIB)" 410b3634f8SBarry Smith -@echo "------------------------------------------" 42eb817c50SBarry Smith -@echo "Due to different numerical round-off on certain" 43eb817c50SBarry Smith -@echo "machines some of the numbers may not match exactly." 4431ca9999SBarry Smith -@echo "------------------------------------------" 450b3634f8SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 460b3634f8SBarry Smith ACTION=testexamples_1 tree 470b3634f8SBarry Smith -@echo "Completed compiling and running test examples" 480b3634f8SBarry Smith -@echo "------------------------------------------" 490b3634f8SBarry Smith 500b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture 518475343bSBarry Smithtestexamples_uni: chkpetsc_dir 528475343bSBarry Smith -@echo "Beginning to compile and run uniprocessor test examples" 538475343bSBarry Smith -@echo "Using compiler: $(CC) $(PETSC_INCLUDE) $(PCONF) $(BASEOPT)" 548475343bSBarry Smith -@echo "Using linker: $(CLINKER)" 558475343bSBarry Smith -@echo "Using libraries: $(PETSC_LIB)" 568475343bSBarry Smith -@echo "------------------------------------------" 578475343bSBarry Smith -@echo "Due to different numerical round-off on certain" 588475343bSBarry Smith -@echo "machines some of the numbers may not match exactly." 598475343bSBarry Smith -@echo "------------------------------------------" 608475343bSBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 618475343bSBarry Smith ACTION=testexamples_4 tree 628475343bSBarry Smith -@echo "Completed compiling and running uniprocessor test examples" 638475343bSBarry Smith -@echo "------------------------------------------" 648475343bSBarry Smith 658475343bSBarry Smith# Builds PETSc test examples for a given BOPT and architecture 660b3634f8SBarry Smithtestfortran: chkpetsc_dir 670b3634f8SBarry Smith -@echo "Beginning to compile and run Fortran test examples" 689c69534bSBarry Smith -@echo "Using compiler: $(FC) $(BASEOPTF)" 699c69534bSBarry Smith -@echo "Using linker: $(FLINKER)" 709c69534bSBarry Smith -@echo "Using libraries: $(PETSC_FORTRAN_LIB) $(PETSC_LIB)" 710b3634f8SBarry Smith -@echo "------------------------------------------" 720b3634f8SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 730b3634f8SBarry Smith ACTION=testexamples_3 tree 740b3634f8SBarry Smith -@echo "Completed compiling and running Fortran test examples" 750b3634f8SBarry Smith -@echo "------------------------------------------" 7661523587SBarry Smith 7735ca7349SBarry Smith# 7811b6ed10SLois Curfman McInnes# Builds PETSc Fortran interface libary 7911b6ed10SLois Curfman McInnes# Note: libfast cannot run on .F files on certain machines, so we 8035ca7349SBarry Smith# use lib and check for errors here. 8183f0b094SBarry Smithfortran: chkpetsc_dir 82f4c0a52aSLois Curfman McInnes -$(RM) -f $(PDIR)/libpetscfortran.a 830b3634f8SBarry Smith -@echo "Beginning to compile Fortran interface library" 8477c4ece6SBarry Smith -@echo "Using C/C++ compiler: $(CC) $(PETSC_INCLUDE) $(PCONF) $(BASEOPT)" 8577c4ece6SBarry Smith -@echo "Using Fortran compiler: $(FC) $(BASEOPTF)" 860b3634f8SBarry Smith -@echo "------------------------------------------" 87b16a3bb1SBarry Smith -@cd src/fortran/custom; \ 8835ca7349SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \ 8935ca7349SBarry Smith grep -v clog trashz | grep -v "information sections" | \ 9035ca7349SBarry Smith egrep -i '(Error|warning|Can)' >> /dev/null;\ 9135ca7349SBarry Smith if [ "$$?" != 1 ]; then \ 9235ca7349SBarry Smith cat trashz ; fi; $(RM) trashz 93b16a3bb1SBarry Smith -@cd src/fortran/auto; \ 9435ca7349SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast 9583f0b094SBarry Smith $(RANLIB) $(PDIR)/libpetscfortran.a 960b3634f8SBarry Smith -@echo "Completed compiling Fortran interface library" 970b3634f8SBarry Smith -@echo "------------------------------------------" 9883f0b094SBarry Smith 998c37ef55SBarry Smithranlib: 1004e04c1a0SBarry Smith $(RANLIB) $(PDIR)/*.a 10161523587SBarry Smith 10211b6ed10SLois Curfman McInnes# Deletes PETSc libraries 10361523587SBarry Smithdeletelibs: 1044e04c1a0SBarry Smith -$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/* 105d44968ceSBarry Smith 10611b6ed10SLois Curfman McInnes# Deletes man pages (xman version) 107d44968ceSBarry Smithdeletemanpages: 1087857610eSBarry Smith $(RM) -f $(PETSC_DIR)/Keywords $(PETSC_DIR)/docs/man/man*/* 109d44968ceSBarry Smith 11011b6ed10SLois Curfman McInnes# Deletes man pages (HTML version) 111b346654fSBarry Smithdeletewwwpages: 112dea827f2SLois Curfman McInnes $(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit \ 113dea827f2SLois Curfman McInnes $(PETSC_DIR)/docs/www/man*.html 114b346654fSBarry Smith 11511b6ed10SLois Curfman McInnes# Deletes man pages (LaTeX version) 116b346654fSBarry Smithdeletelatexpages: 1177857610eSBarry Smith $(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex 11820563c6bSBarry Smith 1197acb7333SLois Curfman McInnes# To access the tags in emacs, type M-x visit-tags-table and specify 1207acb7333SLois Curfman McInnes# the file petsc/TAGS. Then, to move to where a PETSc function is 1217acb7333SLois Curfman McInnes# defined, enter M-. and the function name. To search for a string 1227acb7333SLois Curfman McInnes# and move to the first occurrence, use M-x tags-search and the string. 1237acb7333SLois Curfman McInnes# To locate later occurrences, use M-, 1247acb7333SLois Curfman McInnes 12511b6ed10SLois Curfman McInnes# Builds all etags files 12611b6ed10SLois Curfman McInnesalletags: 12711b6ed10SLois Curfman McInnes -make etags 12811b6ed10SLois Curfman McInnes -make etags_noexamples 12911b6ed10SLois Curfman McInnes -make etags_makefiles 13011b6ed10SLois Curfman McInnes 13111b6ed10SLois Curfman McInnes# Builds the basic etags file. This should be employed by most users. 13220563c6bSBarry Smithetags: 133edd2f0e1SBarry Smith $(RM) TAGS 13470a6ad8cSBarry Smith etags -f TAGS src/*/impls/*/*.h src/*/impls/*/*/*.h 135ba6aed2eSLois Curfman McInnes etags -a -f TAGS src/*/examples/*.c src/*/examples/*/*.c 136531823f5SLois Curfman McInnes etags -a -f TAGS src/*/*.h src/*/*/*.h src/*/interface/*.c 137bdec0fbfSBarry Smith etags -a -f TAGS src/*/src/*.c src/*/impls/*/*.c 1380429b4e3SLois Curfman McInnes etags -a -f TAGS src/*/impls/*/*/*.c 139cd9cd4f0SLois Curfman McInnes etags -a -f TAGS src/contrib/*/*.c src/contrib/*/src/*.c 140cd9cd4f0SLois Curfman McInnes etags -a -f TAGS src/contrib/*/examples/*.c src/contrib/*/src/*/*.c 141*5ae82d37SLois Curfman McInnes etags -a -f TAGS src/contrib/*/src/*/*/*.c 14270cf2eddSSatish Balay etags -a -f TAGS src/contrib/*/src/*.h src/contrib/*/examples/*.F 14370cf2eddSSatish Balay etags -a -f TAGS src/contrib/*/examples/*.f 14490ace30eSBarry Smith etags -a -f TAGS include/*.h include/pinclude/*.h bmake/common 14590ace30eSBarry Smith etags -a -f TAGS include/FINCLUDE/*.h 14670a6ad8cSBarry Smith etags -a -f TAGS src/*/impls/*.c src/*/utils/*.c 1470de55854SLois Curfman McInnes etags -a -f TAGS makefile src/*/src/makefile 1480de55854SLois Curfman McInnes etags -a -f TAGS src/*/interface/makefile src/makefile 149f5354500SBarry Smith etags -a -f TAGS src/*/impls/makefile src/*/impls/*/makefile 1503ebb8ef7SBarry Smith etags -a -f TAGS src/*/utils/makefile src/*/examples/makefile 1510de55854SLois Curfman McInnes etags -a -f TAGS src/*/examples/*/makefile 1523ebb8ef7SBarry Smith etags -a -f TAGS src/*/makefile src/*/impls/*/*/makefile 153cd9cd4f0SLois Curfman McInnes etags -a -f TAGS src/contrib/*/makefile src/contrib/*/src/makefile 154*5ae82d37SLois Curfman McInnes etags -a -f TAGS src/contrib/*/src/*/makefile src/contrib/*/src/*/*/makefile 1552bf65771SLois Curfman McInnes etags -a -f TAGS src/fortran/makefile src/fortran/auto/makefile 1562bf65771SLois Curfman McInnes etags -a -f TAGS src/fortran/custom/makefile 157fea641f4SSatish Balay etags -a -f TAGS include/makefile include/*/makefile 1584e627d3aSBarry Smith etags -a -f TAGS bmake/common bmake/*/base* 15970cf2eddSSatish Balay etags -a -f TAGS src/fortran/custom/*.c src/fortran/auto/*.c src/benchmarks/*.c 16070cf2eddSSatish Balay etags -a -f TAGS src/*/examples/*.F src/*/examples/*.f src/fortran/custom/*.F 16172936c9dSBarry Smith etags -a -f TAGS docs/tex/manual/routin.tex docs/tex/manual/manual.tex 16272936c9dSBarry Smith etags -a -f TAGS docs/tex/manual/manual_tex.tex 16372936c9dSBarry Smith etags -a -f TAGS docs/tex/manual/intro.tex docs/tex/manual/part1.tex 16472936c9dSBarry Smith etags -a -f TAGS docs/tex/manual/part2.tex 16572936c9dSBarry Smith etags -a -f TAGS docs/tex/manual/intro.tex docs/makefile 16628988994SBarry Smith chmod g+w TAGS 167bfce26a3SBarry Smith 16811b6ed10SLois Curfman McInnes# Builds the etags file that excludes the examples directories 169bfce26a3SBarry Smithetags_noexamples: 170bfce26a3SBarry Smith $(RM) TAGS_NO_EXAMPLES 171bfce26a3SBarry Smith etags -f TAGS_NO_EXAMPLES src/*/impls/*/*.h src/*/impls/*/*/*.h 172531823f5SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/*/*.h src/*/*/*.h src/*/interface/*.c 17364f8aa17SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/*/src/*.c src/*/impls/*/*.c 1740429b4e3SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/*/impls/*/*/*.c 175cd9cd4f0SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/contrib/*/*.c src/contrib/*/src/*.c 176cd9cd4f0SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/*/*.c src/contrib/*/src/*.h 177*5ae82d37SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/*/*/*.c 17890ace30eSBarry Smith etags -a -f TAGS_NO_EXAMPLES include/*.h include/pinclude/*.h 17990ace30eSBarry Smith etags -a -f TAGS_NO_EXAMPLES include/FINCLUDE/*.h 180b16a3bb1SBarry Smith etags -a -f TAGS_NO_EXAMPLES bmake/common 181464493b3SBarry Smith etags -a -f TAGS_NO_EXAMPLES src/*/impls/*.c src/*/utils/*.c 1820de55854SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES makefile src/*/src/makefile 1830de55854SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/*/interface/makefile src/makefile 184464493b3SBarry Smith etags -a -f TAGS_NO_EXAMPLES src/*/impls/makefile src/*/impls/*/makefile 185464493b3SBarry Smith etags -a -f TAGS_NO_EXAMPLES src/*/utils/makefile 186464493b3SBarry Smith etags -a -f TAGS_NO_EXAMPLES src/*/makefile src/*/impls/*/*/makefile 187cd9cd4f0SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/contrib/*/makefile src/contrib/*/src/makefile 188cd9cd4f0SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/*/makefile 189*5ae82d37SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/*/*/makefile 1902bf65771SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/fortran/makefile src/fortran/auto/makefile 1912bf65771SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/makefile 192fea641f4SSatish Balay etags -a -f TAGS_NO_EXAMPLES include/makefile include/*/makefile 1934e627d3aSBarry Smith etags -a -f TAGS_NO_EXAMPLES bmake/common bmake/*/base* 1944c71ded4SBarry Smith etags -a -f TAGS_NO_EXAMPLES src/fortran/auto/*.c 19562ce5da9SLois Curfman McInnes etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/*.c src/fortran/custom/*.F 19672936c9dSBarry Smith etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/routin.tex 19772936c9dSBarry Smith etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/manual.tex 19872936c9dSBarry Smith etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/intro.tex 19972936c9dSBarry Smith etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/part1.tex 20072936c9dSBarry Smith etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/part2.tex 201fea641f4SSatish Balay etags -a -f TAGS_NO_EXAMPLES docs/makefile 202bfce26a3SBarry Smith chmod g+w TAGS_NO_EXAMPLES 203b16a3bb1SBarry Smith 20411b6ed10SLois Curfman McInnes# Builds the etags file for makefiles 205b16a3bb1SBarry Smithetags_makefiles: 206b16a3bb1SBarry Smith $(RM) TAGS_MAKEFILES 207b16a3bb1SBarry Smith etags -a -f TAGS_MAKEFILES bmake/common 2080de55854SLois Curfman McInnes etags -a -f TAGS_MAKEFILES makefile src/*/src/makefile 2090de55854SLois Curfman McInnes etags -a -f TAGS_MAKEFILES src/*/interface/makefile src/makefile 210b16a3bb1SBarry Smith etags -a -f TAGS_MAKEFILES src/*/impls/makefile src/*/impls/*/makefile 2112328c152SLois Curfman McInnes etags -a -f TAGS_MAKEFILES src/*/utils/makefile src/*/interface/makefile 212b16a3bb1SBarry Smith etags -a -f TAGS_MAKEFILES src/*/makefile src/*/impls/*/*/makefile 2130de55854SLois Curfman McInnes etags -a -f TAGS_MAKEFILES src/*/examples/makefile src/*/examples/*/makefile 2142bf65771SLois Curfman McInnes etags -a -f TAGS_MAKEFILES src/fortran/makefile src/fortran/auto/makefile 215cd9cd4f0SLois Curfman McInnes etags -a -f TAGS_MAKEFILES src/contrib/*/makefile src/contrib/*/src/makefile 216cd9cd4f0SLois Curfman McInnes etags -a -f TAGS_MAKEFILES src/contrib/*/src/*/makefile 217*5ae82d37SLois Curfman McInnes etags -a -f TAGS_MAKEFILES src/contrib/*/src/*/*/makefile 2182bf65771SLois Curfman McInnes etags -a -f TAGS_MAKEFILES src/fortran/custom/makefile 219fea641f4SSatish Balay etags -a -f TAGS_MAKEFILES include/makefile include/*/makefile 2204e627d3aSBarry Smith etags -a -f TAGS_MAKEFILES bmake/common bmake/*/base* 221fea641f4SSatish Balay etags -a -f TAGS_MAKEFILES docs/makefile 222b16a3bb1SBarry Smith chmod g+w TAGS_MAKEFILES 22311b6ed10SLois Curfman McInnes 224*5ae82d37SLois Curfman McInnes# Builds the etags file for contrib directory only 225*5ae82d37SLois Curfman McInnesetags_contrib: 226*5ae82d37SLois Curfman McInnes $(RM) TAGS_CONTRIB 227*5ae82d37SLois Curfman McInnes etags -f TAGS_CONTRIB src/contrib/*/*.c src/contrib/*/src/*.c 228*5ae82d37SLois Curfman McInnes etags -a -f TAGS_CONTRIB src/contrib/*/examples/*.c src/contrib/*/src/*/*.c 229*5ae82d37SLois Curfman McInnes etags -a -f TAGS_CONTRIB src/contrib/*/src/*/*/*.c 230*5ae82d37SLois Curfman McInnes etags -a -f TAGS_CONTRIB src/contrib/*/*.h 231*5ae82d37SLois Curfman McInnes etags -a -f TAGS_CONTRIB src/contrib/*/src/*.h src/contrib/*/examples/*.F 232*5ae82d37SLois Curfman McInnes etags -a -f TAGS_CONTRIB src/contrib/*/examples/*.f src/contrib/*/README 233*5ae82d37SLois Curfman McInnes etags -a -f TAGS_CONTRIB src/contrib/*/makefile src/contrib/*/src/makefile 234*5ae82d37SLois Curfman McInnes etags -a -f TAGS_CONTRIB src/contrib/*/src/*/makefile 235*5ae82d37SLois Curfman McInnes etags -a -f TAGS_CONTRIB src/contrib/*/src/*/*/makefile 236*5ae82d37SLois Curfman McInnes 23711b6ed10SLois Curfman McInnes# ------------------------------------------------------------------ 23811b6ed10SLois Curfman McInnes# 23911b6ed10SLois Curfman McInnes# All remaining actions are intended for PETSc developers only. 24011b6ed10SLois Curfman McInnes# PETSc users should not generally need to use these commands. 24111b6ed10SLois Curfman McInnes# 24211b6ed10SLois Curfman McInnes 24311b6ed10SLois Curfman McInnes# Builds all versions of the man pages 244c3e30b67SBarry Smithallmanpages: deletemanpages allwwwpages alllatexpages 24511b6ed10SLois Curfman McInnes -make ACTION=manpages tree 246c3e30b67SBarry Smith -cd src/fortran/custom; make manpages 24711b6ed10SLois Curfman McInnes 248dea827f2SLois Curfman McInnesallwwwpages: deletewwwpages 249299192b9SLois Curfman McInnes -make ACTION=wwwpages_buildcite tree 250c3e30b67SBarry Smith -cd src/fortran/custom; make wwwpages_buildcite 251c3e30b67SBarry Smith -cd src/fortran/custom; make wwwpages 252dea827f2SLois Curfman McInnes -make ACTION=wwwpages tree 253dea827f2SLois Curfman McInnes -maint/wwwman 254dea827f2SLois Curfman McInnes 255416022c9SBarry Smithalllatexpages: deletelatexpages 256416022c9SBarry Smith -make ACTION=latexpages tree 257c3e30b67SBarry Smith -cd src/fortran/custom; make latexpages 258416022c9SBarry Smith 25911b6ed10SLois Curfman McInnes# Builds Fortran stub files 26011b6ed10SLois Curfman McInnesallfortranstubs: 26135aab85fSBarry Smith -@include/finclude/generateincludes 2624b0e389bSBarry Smith -@$(RM) -f $(PETSC_DIR)/src/fortran/auto/*.c 26311b6ed10SLois Curfman McInnes -make ACTION=fortranstubs tree 2644b0e389bSBarry Smith chmod g+w $(PETSC_DIR)/src/fortran/auto/*.c 26511b6ed10SLois Curfman McInnes 26635aab85fSBarry Smith 267