111b6ed10SLois Curfman McInnes# 2cfd69a58SBarry Smith# This is the makefile for installing PETSc. See the file 3cfd69a58SBarry Smith# Installation for directions on installing PETSc. 4cfd69a58SBarry Smith# See also bmake/common for additional commands. 511b6ed10SLois Curfman McInnes# 611b6ed10SLois Curfman McInnes 772035b96SSatish Balay#PETSC_DIR = . 861523587SBarry Smith 9ab94cc7aSSatish BalayCFLAGS = 1061523587SBarry SmithSOURCEC = 1161523587SBarry SmithSOURCEF = 126daaf66cSBarry SmithSOURCEH = Changes Machines Readme maint/addlinks \ 1343a90d84SBarry Smith maint/builddist FAQ Installation BugReporting\ 14deb7fc1cSBarry Smith maint/buildlinks maint/wwwman maint/xclude maint/crontab\ 15630a6785SBarry Smith bmake/common bmake/*/base* maint/autoftp docs/www/sec/* \ 16630a6785SBarry Smith include/finclude/generateincludes bin/petscviewinfo.text \ 17630a6785SBarry Smith bin/petscoptsinfo.text 1861523587SBarry SmithOBJSC = 1961523587SBarry SmithOBJSF = 2061523587SBarry SmithLIBBASE = libpetscvec 21b16a3bb1SBarry SmithDIRS = src include docs 2261523587SBarry Smith 234e627d3aSBarry Smithinclude $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base 2461523587SBarry Smith 2511b6ed10SLois Curfman McInnes# Builds PETSc libraries for a given BOPT and architecture 267857610eSBarry Smithall: chkpetsc_dir 27511caf8eSSatish Balay -$(RM) -f $(PDIR)/* 280b3634f8SBarry Smith -@echo "Beginning to compile libraries in all directories" 2926de76a5SSatish Balay -@echo "Using compiler: $(CC) $(CFLAGS) $(COPTFLAGS)" 30b14e8f29SBarry Smith -@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)" 31b14e8f29SBarry Smith -@echo "Using configuration flags: $(CONF)" 32b14e8f29SBarry Smith -@echo "Using include paths: $(PETSC_INCLUDE)" 33c2c9bc36SBarry Smith -@echo "Using PETSc directory: $(PETSC_DIR)" 34c2c9bc36SBarry Smith -@echo "Using PETSc arch: $(PETSC_ARCH)" 350b3634f8SBarry Smith -@echo "------------------------------------------" 36e35bd481SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 37f3848965SBarry Smith ACTION=libfast tree 38*f88f42abSSatish Balay -@cd $(PETSC_DIR)/src/sys/src ; \ 39*f88f42abSSatish Balay $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) rs6000_time 404e04c1a0SBarry Smith $(RANLIB) $(PDIR)/*.a 417862f17cSBarry Smith -@chmod g+w $(PDIR)/*.a 420b3634f8SBarry Smith -@echo "Completed building libraries" 430b3634f8SBarry Smith -@echo "------------------------------------------" 440b3634f8SBarry Smith 450b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture 46a9369724SSatish Balaytestexamples: chkopts 470b3634f8SBarry Smith -@echo "Beginning to compile and run test examples" 4826de76a5SSatish Balay -@echo "Using compiler: $(CC) $(CFLAGS) $(COPTFLAGS)" 49b14e8f29SBarry Smith -@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)" 50b14e8f29SBarry Smith -@echo "Using include paths: $(PETSC_INCLUDE)" 51c2c9bc36SBarry Smith -@echo "Using PETSc directory: $(PETSC_DIR)" 52c2c9bc36SBarry Smith -@echo "Using PETSc arch: $(PETSC_ARCH)" 53c2c9bc36SBarry Smith -@echo "------------------------------------------" 549c69534bSBarry Smith -@echo "Using linker: $(CLINKER)" 559c69534bSBarry Smith -@echo "Using libraries: $(PETSC_LIB)" 560b3634f8SBarry Smith -@echo "------------------------------------------" 57eb817c50SBarry Smith -@echo "Due to different numerical round-off on certain" 58eb817c50SBarry Smith -@echo "machines some of the numbers may not match exactly." 5931ca9999SBarry Smith -@echo "------------------------------------------" 600b3634f8SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 610b3634f8SBarry Smith ACTION=testexamples_1 tree 620b3634f8SBarry Smith -@echo "Completed compiling and running test examples" 630b3634f8SBarry Smith -@echo "------------------------------------------" 640b3634f8SBarry Smith 650b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture 66a9369724SSatish Balaytestexamples_uni: chkopts 678475343bSBarry Smith -@echo "Beginning to compile and run uniprocessor test examples" 6826de76a5SSatish Balay -@echo "Using compiler: $(CC) $(CFLAGS) $(COPTFLAGS)" 698475343bSBarry Smith -@echo "Using linker: $(CLINKER)" 70b14e8f29SBarry Smith -@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)" 71b14e8f29SBarry Smith -@echo "Using include paths: $(PETSC_INCLUDE)" 72d6db1478SLois Curfman McInnes -@echo "Using PETSc directory: $(PETSC_DIR)" 73d6db1478SLois Curfman McInnes -@echo "Using PETSc arch: $(PETSC_ARCH)" 74d6db1478SLois Curfman McInnes -@echo "------------------------------------------" 75d6db1478SLois Curfman McInnes -@echo "Using linker: $(CLINKER)" 768475343bSBarry Smith -@echo "Using libraries: $(PETSC_LIB)" 778475343bSBarry Smith -@echo "------------------------------------------" 788475343bSBarry Smith -@echo "Due to different numerical round-off on certain" 798475343bSBarry Smith -@echo "machines some of the numbers may not match exactly." 808475343bSBarry Smith -@echo "------------------------------------------" 818475343bSBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 828475343bSBarry Smith ACTION=testexamples_4 tree 838475343bSBarry Smith -@echo "Completed compiling and running uniprocessor test examples" 848475343bSBarry Smith -@echo "------------------------------------------" 858475343bSBarry Smith 8635ca7349SBarry Smith# 8711b6ed10SLois Curfman McInnes# Builds PETSc Fortran interface libary 8811b6ed10SLois Curfman McInnes# Note: libfast cannot run on .F files on certain machines, so we 8935ca7349SBarry Smith# use lib and check for errors here. 9083f0b094SBarry Smithfortran: chkpetsc_dir 91727c161cSBarry Smith -$(RM) -f $(PDIR)/libpetscfortran.* 920b3634f8SBarry Smith -@echo "Beginning to compile Fortran interface library" 9326de76a5SSatish Balay -@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)" 94fc939babSLois Curfman McInnes -@echo "Using C/C++ compiler: $(CC) $(CFLAGS) $(COPTFLAGS)" 95fc939babSLois Curfman McInnes -@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)" 96fc939babSLois Curfman McInnes -@echo "Using configuration flags: $(CONF)" 97fc939babSLois Curfman McInnes -@echo "Using include paths: $(PETSC_INCLUDE)" 98d6db1478SLois Curfman McInnes -@echo "Using PETSc directory: $(PETSC_DIR)" 99d6db1478SLois Curfman McInnes -@echo "Using PETSc arch: $(PETSC_ARCH)" 1000b3634f8SBarry Smith -@echo "------------------------------------------" 101b16a3bb1SBarry Smith -@cd src/fortran/custom; \ 10235ca7349SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \ 10335ca7349SBarry Smith grep -v clog trashz | grep -v "information sections" | \ 10435ca7349SBarry Smith egrep -i '(Error|warning|Can)' >> /dev/null;\ 10535ca7349SBarry Smith if [ "$$?" != 1 ]; then \ 10635ca7349SBarry Smith cat trashz ; fi; $(RM) trashz 107b16a3bb1SBarry Smith -@cd src/fortran/auto; \ 10835ca7349SBarry Smith $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast 10983f0b094SBarry Smith $(RANLIB) $(PDIR)/libpetscfortran.a 11031dbba39SBarry Smith -@chmod g+w $(PDIR)/*.a 1110b3634f8SBarry Smith -@echo "Completed compiling Fortran interface library" 1120b3634f8SBarry Smith -@echo "------------------------------------------" 11383f0b094SBarry Smith 114727c161cSBarry Smith# Builds PETSc test examples for a given BOPT and architecture 115a9369724SSatish Balaytestfortran: chkopts 116727c161cSBarry Smith -@echo "Beginning to compile and run Fortran test examples" 117727c161cSBarry Smith -@echo "Using compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)" 118727c161cSBarry Smith -@echo "Using linker: $(FLINKER)" 119727c161cSBarry Smith -@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)" 120727c161cSBarry Smith -@echo "Using PETSc directory: $(PETSC_DIR)" 121727c161cSBarry Smith -@echo "Using PETSc arch: $(PETSC_ARCH)" 122727c161cSBarry Smith -@echo "------------------------------------------" 123727c161cSBarry Smith -@echo "Using linker: $(FLINKER)" 124727c161cSBarry Smith -@echo "Using libraries: $(PETSC_FORTRAN_LIB) $(PETSC_LIB)" 125727c161cSBarry Smith -@echo "------------------------------------------" 126727c161cSBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 127727c161cSBarry Smith ACTION=testexamples_3 tree 128727c161cSBarry Smith -@echo "Completed compiling and running Fortran test examples" 129727c161cSBarry Smith -@echo "------------------------------------------" 130727c161cSBarry Smith 1318c37ef55SBarry Smithranlib: 1324e04c1a0SBarry Smith $(RANLIB) $(PDIR)/*.a 13361523587SBarry Smith 13411b6ed10SLois Curfman McInnes# Deletes PETSc libraries 13561523587SBarry Smithdeletelibs: 1364e04c1a0SBarry Smith -$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/* 137d44968ceSBarry Smith 138d44968ceSBarry Smith 13911b6ed10SLois Curfman McInnes# Deletes man pages (HTML version) 140b346654fSBarry Smithdeletewwwpages: 141dea827f2SLois Curfman McInnes $(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit \ 142dea827f2SLois Curfman McInnes $(PETSC_DIR)/docs/www/man*.html 143b346654fSBarry Smith 14411b6ed10SLois Curfman McInnes# Deletes man pages (LaTeX version) 145b346654fSBarry Smithdeletelatexpages: 1467857610eSBarry Smith $(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex 14720563c6bSBarry Smith 1487acb7333SLois Curfman McInnes# To access the tags in emacs, type M-x visit-tags-table and specify 1497acb7333SLois Curfman McInnes# the file petsc/TAGS. Then, to move to where a PETSc function is 1507acb7333SLois Curfman McInnes# defined, enter M-. and the function name. To search for a string 1517acb7333SLois Curfman McInnes# and move to the first occurrence, use M-x tags-search and the string. 1527acb7333SLois Curfman McInnes# To locate later occurrences, use M-, 1537acb7333SLois Curfman McInnes 154b38bb785SSatish BalayTAGS_INCLUDE_FILES = include/*.h include/pinclude/*.h include/FINCLUDE/*.h 155b38bb785SSatish BalayTAGS_BMAKE_FILES = bmake/common bmake/*/base* 156b38bb785SSatish BalayTAGS_EXAMPLE_FILES = src/*/examples/*/*.[c,h,F,f] src/*/examples/*/*/*.[c,h,F,f] \ 157b38bb785SSatish Balay src/benchmarks/*.c src/contrib/*/examples/*/*.[c,h,F,f] 158b38bb785SSatish BalayTAGS_DOC_FILES = docs/tex/manual/routin.tex docs/tex/manual/manual.tex \ 159b38bb785SSatish Balay docs/tex/manual/manual_tex.tex docs/tex/manual/intro.tex \ 160b38bb785SSatish Balay docs/tex/manual/part1.tex docs/tex/manual/part2.tex 1614431cf12SSatish BalayTAGS_SRC_FILES = src/*/*.[c,h] src/*/interface/*.[c,h] src/*/src/*.[c,h] \ 162b38bb785SSatish Balay src/*/utils/*.[c,h] \ 163b38bb785SSatish Balay src/*/impls/*.[c,h] src/*/impls/*/*.[c,h] src/*/impls/*/*/*.[c,h] \ 164b38bb785SSatish Balay src/gvec/impls/*/*/*/*/*.[c,h] src/contrib/*/*.[c,h] src/contrib/*/src/*.[c,h] \ 165b38bb785SSatish Balay src/fortran/custom/*.[c,h,F] 166b38bb785SSatish BalayTAGS_MAKEFILE_FILES = include/makefile include/*/makefile \ 167b38bb785SSatish Balay makefile \ 168b38bb785SSatish Balay src/makefile src/*/makefile src/*/src/makefile \ 169b38bb785SSatish Balay src/*/interface/makefile \ 170b38bb785SSatish Balay src/*/utils/makefile \ 171b38bb785SSatish Balay src/*/impls/makefile src/*/impls/*/makefile src/*/impls/*/*/makefile \ 172b38bb785SSatish Balay src/*/examples/makefile src/*/examples/*/makefile src/*/examples/*/*/makefile \ 173b38bb785SSatish Balay src/gvec/impls/*/*/*/*/makefile src/gvec/impls/*/*/*/makefile \ 174b38bb785SSatish Balay src/fortran/*/makefile \ 175b38bb785SSatish Balay src/contrib/*/makefile src/contrib/*/src/makefile \ 176b38bb785SSatish Balay src/contrib/*/examples/makefile src/contrib/*/examples/*/makefile \ 177b38bb785SSatish Balay docs/makefile 178b38bb785SSatish Balay 17911b6ed10SLois Curfman McInnes# Builds all etags files 18011b6ed10SLois Curfman McInnesalletags: 1819ae7ee0fSLois Curfman McInnes -make etags_complete 18211b6ed10SLois Curfman McInnes -make etags 18311b6ed10SLois Curfman McInnes -make etags_noexamples 18411b6ed10SLois Curfman McInnes -make etags_makefiles 18511b6ed10SLois Curfman McInnes 18611b6ed10SLois Curfman McInnes# Builds the basic etags file. This should be employed by most users. 18720563c6bSBarry Smithetags: 188edd2f0e1SBarry Smith $(RM) TAGS 189b38bb785SSatish Balay etags -f TAGS $(TAGS_INCLUDE_FILES) 190b38bb785SSatish Balay etags -a -f TAGS $(TAGS_SRC_FILES) 191b38bb785SSatish Balay etags -a -f TAGS $(TAGS_EXAMPLE_FILES) 192b38bb785SSatish Balay etags -a -f TAGS $(TAGS_MAKEFILE_FILES) 193b38bb785SSatish Balay etags -a -f TAGS $(TAGS_BMAKE_FILES) 19428988994SBarry Smith chmod g+w TAGS 195bfce26a3SBarry Smith 19629cdf679SBarry Smith# Builds complete etags list; only for PETSc developers. 19729cdf679SBarry Smithetags_complete: 19829cdf679SBarry Smith $(RM) TAGS_COMPLETE 1999ca56a1bSSatish Balay etags -f TAGS_COMPLETE $(TAGS_SRC_FILES) 2009ca56a1bSSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_INCLUDE_FILES) 201b38bb785SSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_EXAMPLE_FILES) 202b38bb785SSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_MAKEFILE_FILES) 203b38bb785SSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_BMAKE_FILES) 204b38bb785SSatish Balay etags -a -f TAGS_COMPLETE $(TAGS_DOC_FILES) 20529cdf679SBarry Smith chmod g+w TAGS_COMPLETE 20629cdf679SBarry Smith 20711b6ed10SLois Curfman McInnes# Builds the etags file that excludes the examples directories 208bfce26a3SBarry Smithetags_noexamples: 209bfce26a3SBarry Smith $(RM) TAGS_NO_EXAMPLES 2109ca56a1bSSatish Balay etags -f TAGS_NO_EXAMPLES $(TAGS_SRC_FILES) 2119ca56a1bSSatish Balay etags -a -f TAGS_NO_EXAMPLES $(TAGS_INCLUDE_FILES) 212b38bb785SSatish Balay etags -a -f TAGS_NO_EXAMPLES $(TAGS_MAKEFILE_FILES) 213b38bb785SSatish Balay etags -a -f TAGS_NO_EXAMPLES $(TAGS_BMAKE_FILES) 214b38bb785SSatish Balay etags -a -f TAGS_NO_EXAMPLES $(TAGS_DOC_FILES) 215bfce26a3SBarry Smith chmod g+w TAGS_NO_EXAMPLES 216b16a3bb1SBarry Smith 21711b6ed10SLois Curfman McInnes# Builds the etags file for makefiles 218b16a3bb1SBarry Smithetags_makefiles: 219b16a3bb1SBarry Smith $(RM) TAGS_MAKEFILES 220b38bb785SSatish Balay etags -f TAGS_MAKEFILES $(TAGS_MAKEFILE_FILES) 221b38bb785SSatish Balay etags -a -f TAGS_MAKEFILES $(TAGS_BMAKE_FILES) 222b16a3bb1SBarry Smith chmod g+w TAGS_MAKEFILES 22311b6ed10SLois Curfman McInnes 224b38bb785SSatish Balay# 225b38bb785SSatish Balay# ctags builds the tags file required for VI. 226b38bb785SSatish Balay# To use the tags file do the following: 227b38bb785SSatish Balay# 1. within vi invole the command - :set tags=/home/bsmith/petsc/tags 228b38bb785SSatish Balay# or add the command to your ~/.exrc file - set tags=/home/bsmith/petsc/tags 229b38bb785SSatish Balay# 2. now to go to a tag do - :tag TAGNAME for eg - :tag MatCreate 230b38bb785SSatish Balay# 231b38bb785SSatish Balayctags: 232b38bb785SSatish Balay $(RM) tags 233b8319b70SSatish Balay ctags -w -f tags $(TAGS_INCLUDE_FILES) 234b8319b70SSatish Balay ctags -w -a -f tags $(TAGS_SRC_FILES) 235b38bb785SSatish Balay ctags -w -a -f tags $(TAGS_EXAMPLE_FILES) 236b38bb785SSatish Balay ctags -w -a -f tags $(TAGS_MAKEFILE_FILES) 237b38bb785SSatish Balay ctags -w -a -f tags $(TAGS_BMAKE_FILES) 238b38bb785SSatish Balay chmod g+w tags 239b38bb785SSatish Balay 24011b6ed10SLois Curfman McInnes# ------------------------------------------------------------------ 24111b6ed10SLois Curfman McInnes# 24211b6ed10SLois Curfman McInnes# All remaining actions are intended for PETSc developers only. 24311b6ed10SLois Curfman McInnes# PETSc users should not generally need to use these commands. 24411b6ed10SLois Curfman McInnes# 24511b6ed10SLois Curfman McInnes 24611b6ed10SLois Curfman McInnes# Builds all versions of the man pages 247956e605aSBarry Smithallmanpages: allwwwpages alllatexpages 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 2549921e35aSSatish Balay -maint/examplesindex.tcl -www 255f8cfbf3fSSatish Balay -maint/htmlkeywords.tcl 25651c61065SBarry Smith -@chmod g+w docs/www/man*/* 257416022c9SBarry Smithalllatexpages: deletelatexpages 258416022c9SBarry Smith -make ACTION=latexpages tree 259c3e30b67SBarry Smith -cd src/fortran/custom; make latexpages 26051c61065SBarry Smith -@chmod g+w docs/tex/rsum/* 261416022c9SBarry Smith 26211b6ed10SLois Curfman McInnes# Builds Fortran stub files 26311b6ed10SLois Curfman McInnesallfortranstubs: 26435aab85fSBarry Smith -@include/finclude/generateincludes 2654b0e389bSBarry Smith -@$(RM) -f $(PETSC_DIR)/src/fortran/auto/*.c 26611b6ed10SLois Curfman McInnes -make ACTION=fortranstubs tree 2674b0e389bSBarry Smith chmod g+w $(PETSC_DIR)/src/fortran/auto/*.c 268f6ff2982SSatish Balay 269d55938c2SBarry Smithallci: 270d55938c2SBarry Smith -@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) ci 271b951964fSBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=ci tree 272b951964fSBarry Smith 273d55938c2SBarry Smithallco: 274d55938c2SBarry Smith -@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) co 275d55938c2SBarry Smith -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=co tree 276d55938c2SBarry Smith 277956e605aSBarry Smith# 278956e605aSBarry Smith# We no longer make Unix manpages 279956e605aSBarry Smith# 280956e605aSBarry Smith#allunixmanpages: 281956e605aSBarry Smith# -make ACTION=manpages tree 282956e605aSBarry Smith# -cd src/fortran/custom; make manpages 283956e605aSBarry Smith# -cd docs/man; catman -W . 284956e605aSBarry Smith# -@chmod g+w docs/man/man*/* 285956e605aSBarry Smith# Deletes man pages (xman version) 286956e605aSBarry Smith#deletemanpages: 287956e605aSBarry Smith# $(RM) -f $(PETSC_DIR)/Keywords $(PETSC_DIR)/docs/man/man*/* 288f6ff2982SSatish Balay 289