173f4d377SMatthew Knepley# $Id: makefile,v 1.353 2001/08/28 19:43:38 balay Exp $ 211b6ed10SLois Curfman McInnes# 3cfd69a58SBarry Smith# This is the makefile for installing PETSc. See the file 4ba3fcebfSBarry Smith# docs/website/documentation/installation.html for directions on installing PETSc. 5cfd69a58SBarry Smith# See also bmake/common for additional commands. 611b6ed10SLois Curfman McInnes# 7716b9c40SSatish BalayALL: all 848b2c0e9SBarry SmithLOCDIR = . 9b16a3bb1SBarry SmithDIRS = src include docs 1061523587SBarry Smith 11516d1546SSatish Balayinclude ${PETSC_DIR}/bmake/common/base 12516d1546SSatish Balayinclude ${PETSC_DIR}/bmake/common/test 1361523587SBarry Smith 14ca5c9d59SMatthew Knepley# 153677444aSSatish Balay# Basic targets to build PETSc libraries. 16fa527775SLois Curfman McInnes# all: builds the c, fortran, and f90 libraries 17b5fa40b8SBarry Smithall: 18b5fa40b8SBarry Smith @${OMAKE} PETSC_ARCH=${PETSC_ARCH} BOPT=${BOPT} chkpetsc_dir 1944ecba3fSMatthew Knepley -@${MAKE} all_build 2>&1 | tee make_log_${PETSC_ARCH}_${BOPT} 20bdde29a3SBarry Smithall_build: chk_petsc_dir info info_h chklib_dir deletelibs chk_fortranstubs blaslapack mpich build shared 21efd74e9bSBarry Smith# 22fa527775SLois Curfman McInnes# Prints information about the system and version of PETSc being compiled 23efd74e9bSBarry Smith# 24efd74e9bSBarry Smithinfo: 25efd74e9bSBarry Smith -@echo "==========================================" 2611b6dc0cSBarry Smith -@echo " " 27d76296fbSBarry Smith -@echo "See docs/troubleshooting.html and docs/bugreporting.html" 28d76296fbSBarry Smith -@echo "for help with installation problems. Please send EVERYTHING" 29d76296fbSBarry Smith -@echo "printed out below when reporting problems" 3011b6dc0cSBarry Smith -@echo " " 3111b6dc0cSBarry Smith -@echo "To subscribe to the PETSc users mailing list, send mail to " 3211b6dc0cSBarry Smith -@echo "majordomo@mcs.anl.gov with the message: " 338b6f49e5SSatish Balay -@echo "subscribe petsc-announce" 3411b6dc0cSBarry Smith -@echo " " 35d76296fbSBarry Smith -@echo "==========================================" 361d91fb6eSBarry Smith -@echo On `date` on `hostname` 3730fdcc7aSBarry Smith -@echo Machine characteristics: `uname -a` 38efd74e9bSBarry Smith -@echo "-----------------------------------------" 390387d3c6SKris Buschelman -@echo "Using C compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS}" 40dffd13fbSMatthew Knepley -@echo "C Compiler version: " `${C_CCV}` 410387d3c6SKris Buschelman -@echo "Using C++ compiler: ${CXX_CC} ${COPTFLAGS} ${CCPPFLAGS}" 42dffd13fbSMatthew Knepley -@echo "C++ Compiler version: " `${CXX_CCV}` 430387d3c6SKris Buschelman -@echo "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}" 44dffd13fbSMatthew Knepley -@echo "Fortran Compiler version: " `${C_FCV}` 4547794344SBarry Smith -@echo "-----------------------------------------" 46bdd8b494SSatish Balay -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" 47f265ae5cSBarry Smith -@echo "-----------------------------------------" 48d77bb2e1SSatish Balay -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 4947794344SBarry Smith -@echo "-----------------------------------------" 50e0e703c1SSatish Balay -@echo "Using configuration flags:" 5119552e71SMatthew Knepley -@grep "\#define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h 5247794344SBarry Smith -@echo "-----------------------------------------" 53d77bb2e1SSatish Balay -@echo "Using include paths: ${PETSC_INCLUDE}" 5447794344SBarry Smith -@echo "-----------------------------------------" 55d77bb2e1SSatish Balay -@echo "Using PETSc directory: ${PETSC_DIR}" 5619552e71SMatthew Knepley -@echo "Using PETSc arch: ${PETSC_ARCH}" 57efd74e9bSBarry Smith -@echo "------------------------------------------" 58d77bb2e1SSatish Balay -@echo "Using C linker: ${CLINKER}" 59d77bb2e1SSatish Balay -@echo "Using Fortran linker: ${FLINKER}" 60f2b01315SBarry Smith -@echo "Using libraries: ${PETSC_LIB}" 61e3353558SSatish Balay -@echo "------------------------------------------" 62e3353558SSatish Balay -@echo "Using mpirun: ${MPIRUN}" 63efd74e9bSBarry Smith -@echo "==========================================" 64b8d81f61SBarry Smith# 65b8d81f61SBarry Smith# 6619552e71SMatthew KnepleyMINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h 67b8d81f61SBarry Smithinfo_h: 68ddbfe947SBarry Smith -@$(RM) -f MINFO ${MINFO} 692fc52814SBarry Smith -@echo "static const char *petscmachineinfo = \" " >> MINFO 7034a92de5SBarry Smith -@echo "Libraries compiled on `date` on `hostname` " >> MINFO 71c5e9c7dfSBarry Smith -@echo Machine characteristics: `uname -a` "" >> MINFO 72f6a9982fSBarry Smith -@echo "Using PETSc directory: ${PETSC_DIR}" >> MINFO 7319552e71SMatthew Knepley -@echo "Using PETSc arch: ${PETSC_ARCH}" >> MINFO 7493520af8SSatish Balay -@echo "-----------------------------------------\"; " >> MINFO 752fc52814SBarry Smith -@echo "static const char *petsccompilerinfo = \" " >> MINFO 765323642bSKris Buschelman -@echo "Using C compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO 77dffd13fbSMatthew Knepley -@echo "C Compiler version:" >> MINFO ; ${C_CCV} >> MINFO 2>&1 ; true 78dffd13fbSMatthew Knepley -@echo "C++ Compiler version:" >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; true 795323642bSKris Buschelman -@echo "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO 80dffd13fbSMatthew Knepley -@echo "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; true 8193520af8SSatish Balay -@echo "-----------------------------------------\"; " >> MINFO 822fc52814SBarry Smith -@echo "static const char *petsccompilerflagsinfo = \" " >> MINFO 83c5e9c7dfSBarry Smith -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO 84c5e9c7dfSBarry Smith -@echo "-----------------------------------------" >> MINFO 85c5e9c7dfSBarry Smith -@echo "Using configuration flags:" >> MINFO 86c5e9c7dfSBarry Smith -@echo "-----------------------------------------" >> MINFO 87c5e9c7dfSBarry Smith -@echo "Using include paths: ${PETSC_INCLUDE}" >> MINFO 8893520af8SSatish Balay -@echo "------------------------------------------\"; " >> MINFO 892fc52814SBarry Smith -@echo "static const char *petsclinkerinfo = \" " >> MINFO 90c5e9c7dfSBarry Smith -@echo "Using C linker: ${CLINKER}" >> MINFO 91c5e9c7dfSBarry Smith -@echo "Using Fortran linker: ${FLINKER}" >> MINFO 9293520af8SSatish Balay -@echo "Using libraries: ${PETSC_LIB} \"; " >> MINFO 939f5e290dSSYSTEM -@cat MINFO | ${SED} -e 's/\ 949c0905fcSSatish Balay//g' | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\; \\n\\/\;/'> ${MINFO} 95ce0f4ea0SKris Buschelman -@$(RM) MINFO 963677444aSSatish Balay 97fa527775SLois Curfman McInnes# 98fa527775SLois Curfman McInnes# Builds the PETSc libraries 99f6a9982fSBarry Smith# This target also builds fortran77 and f90 interface 1003677444aSSatish Balay# files and compiles .F files 101f6a9982fSBarry Smith# 102efd74e9bSBarry Smithbuild: 10347794344SBarry Smith -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 10444ecba3fSMatthew Knepley -@echo "=========================================" 1055fde6e02SSatish Balay -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 1060b3634f8SBarry Smith -@${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX} 10747794344SBarry Smith -@echo "Completed building libraries" 10835ca7349SBarry Smith -@echo "=========================================" 109c8fd01ffSBarry Smith# 110c8fd01ffSBarry Smith# Compiles the blas and lapack source code if found 111c8fd01ffSBarry Smithblaslapack: 112c8fd01ffSBarry Smith -@if [ -d f2cblaslapack/${PETSC_ARCH} -a ! -s f2cblaslapack/${PETSC_ARCH}/libf2cblas.a ] ; then cd f2cblaslapack;\ 113c8fd01ffSBarry Smith echo "=========================================";\ 114c8fd01ffSBarry Smith echo "Building C Blas/Lapack libraries";\ 115c8fd01ffSBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ;\ 11682fb4bcfSBarry Smith ${MV} libf2cblas.a libf2clapack.a ${PETSC_ARCH};\ 117c8fd01ffSBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleanblaslapack ;\ 118c8fd01ffSBarry Smith echo "Completed C building Blas/Lapack libraries";\ 119c8fd01ffSBarry Smith echo "========================================="; fi 120c8fd01ffSBarry Smith -@if [ -d fblaslapack/${PETSC_ARCH} -a ! -s fblaslapack/${PETSC_ARCH}/libfblas.a ] ; then cd fblaslapack;\ 121c8fd01ffSBarry Smith echo "=========================================";\ 122c8fd01ffSBarry Smith echo "Building Fortran Blas/Lapack libraries";\ 123c8fd01ffSBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ;\ 12482fb4bcfSBarry Smith ${MV} libfblas.a libflapack.a ${PETSC_ARCH};\ 125c8fd01ffSBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleanblaslapck ;\ 126c8fd01ffSBarry Smith echo "Completed building Fortran Blas/Lapack libraries";\ 127c8fd01ffSBarry Smith echo "========================================="; fi 1286f02d409SBarry Smith# 1296f02d409SBarry Smith# Compiles MPICH if found 13015876681SBarry Smithmpich: 1316f02d409SBarry Smith -@releasename=`ls -d mpich* 2> /dev/null`;\ 1326f02d409SBarry Smith if [ -d $${releasename}/${PETSC_ARCH} -a ! -d $${releasename}/${PETSC_ARCH}/lib ] ; then cd $${releasename} ;\ 1336f02d409SBarry Smith echo "=========================================";\ 1346f02d409SBarry Smith echo "Compiling and installing " $${releasename};\ 1356f02d409SBarry Smith make; make install; \ 1366f02d409SBarry Smith echo "=========================================";\ 1376f02d409SBarry Smith fi; 1383677444aSSatish Balay# 1398744090aSBarry Smith# Builds PETSc test examples for a given BOPT and architecture 1400ce59502SBarry Smith# 14104f117c6SBarry Smithtest: chkopts 14204f117c6SBarry Smith -@echo "Running test examples to verify correct installation" 14304f117c6SBarry Smith @cd src/snes/examples/tutorials; ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex19 14404f117c6SBarry Smith @if [ "${C_FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex5f; fi; 1450ce59502SBarry Smith -@echo "Completed test examples" 1463677444aSSatish Balay 1473677444aSSatish Balaytestexamples: info chkopts 1483677444aSSatish Balay -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 1493677444aSSatish Balay -@echo "Due to different numerical round-off on certain" 1503677444aSSatish Balay -@echo "machines some of the numbers may not match exactly." 15119552e71SMatthew Knepley -@echo "=========================================" 1523677444aSSatish Balay -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1 tree 1533677444aSSatish Balay -@echo "Completed compiling and running test examples" 1543677444aSSatish Balay -@echo "=========================================" 1553677444aSSatish Balaytestfortran: info chkopts 1563677444aSSatish Balay -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 1573677444aSSatish Balay -@echo "=========================================" 1583677444aSSatish Balay -@echo "Due to different numerical round-off on certain" 1593677444aSSatish Balay -@echo "machines or the way Fortran formats numbers" 1603677444aSSatish Balay -@echo "some of the results may not match exactly." 1614b5d664cSKris Buschelman -@echo "=========================================" 1624b5d664cSKris Buschelman -@if [ "${C_FC}" != "" ]; then \ 1636d2f2efaSKris Buschelman ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3 tree; \ 1646d2f2efaSKris Buschelman echo "Completed compiling and running Fortran test examples"; \ 1656d2f2efaSKris Buschelman else \ 1664b5d664cSKris Buschelman echo "Error: No FORTRAN compiler available"; \ 1673677444aSSatish Balay fi 16801c5c36fSSatish Balay -@echo "=========================================" 16901c5c36fSSatish Balaytestexamples_uni: info chkopts 17001c5c36fSSatish Balay -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 17101c5c36fSSatish Balay -@echo "Due to different numerical round-off on certain" 17201c5c36fSSatish Balay -@echo "machines some of the numbers may not match exactly." 17319552e71SMatthew Knepley -@echo "=========================================" 17401c5c36fSSatish Balay -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4 tree 17501c5c36fSSatish Balay -@echo "Completed compiling and running uniprocessor test examples" 1763677444aSSatish Balay -@echo "=========================================" 1773677444aSSatish Balaytestfortran_uni: info chkopts 1783677444aSSatish Balay -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES" 1793677444aSSatish Balay -@echo "Due to different numerical round-off on certain" 1803677444aSSatish Balay -@echo "machines some of the numbers may not match exactly." 1814b5d664cSKris Buschelman -@echo "=========================================" 1824b5d664cSKris Buschelman -@if [ "${C_FC}" != "" ]; then \ 1836d2f2efaSKris Buschelman ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9 tree; \ 1846d2f2efaSKris Buschelman echo "Completed compiling and running uniprocessor fortran test examples"; \ 1856d2f2efaSKris Buschelman else \ 1864b5d664cSKris Buschelman echo "Error: No FORTRAN compiler available"; \ 1876d2f2efaSKris Buschelman fi 1883677444aSSatish Balay -@ 189ad96cc0dSLois Curfman McInnes -@echo "=========================================" 190f3eacedaSSatish Balay 1918c37ef55SBarry Smith# Ranlib on the libraries 1925fde6e02SSatish Balayranlib: 19361523587SBarry Smith ${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX} 19411b6ed10SLois Curfman McInnes 195f3eacedaSSatish Balay# Deletes PETSc libraries 196b87434adSSatish Balaydeletelibs: chkopts_basic 197d44968ceSBarry Smith -${RM} -f ${PETSC_LIB_DIR}/* 198a42cec9dSMatthew Knepley 199a42cec9dSMatthew Knepley# Cleans up build 20019552e71SMatthew Knepleyallclean: deletelibs 201a42cec9dSMatthew Knepley -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree 2023677444aSSatish Balay 2034918a6b0SSatish Balay 2044918a6b0SSatish Balay# 2054918a6b0SSatish Balay# Check if PETSC_DIR variable specified is valid 2064918a6b0SSatish Balay# 2074918a6b0SSatish Balaychk_petsc_dir: 2081390f061SBarry Smith @if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \ 2091390f061SBarry Smith echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \ 2101390f061SBarry Smith echo "You need to use / to separate directories, not \\!"; \ 2114918a6b0SSatish Balay echo "Aborting build"; \ 2124918a6b0SSatish Balay false; fi 213*3c94ec11SBarry Smith 214*3c94ec11SBarry Smithinstall: 215*3c94ec11SBarry Smith -@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \ 216*3c94ec11SBarry Smith echo "You did not set a directory to install to";\ 217*3c94ec11SBarry Smith else \ 218*3c94ec11SBarry Smith echo Installing PETSc at ${INSTALL_DIR};\ 219*3c94ec11SBarry Smith if [ ! -d `dirname ${INSTALL_DIR}` ]; then \ 220*3c94ec11SBarry Smith mkdir `dirname ${INSTALL_DIR}` ; \ 221*3c94ec11SBarry Smith fi;\ 222*3c94ec11SBarry Smith if [ ! -d ${INSTALL_DIR} ]; then \ 223*3c94ec11SBarry Smith mkdir ${INSTALL_DIR} ; \ 224*3c94ec11SBarry Smith fi;\ 225*3c94ec11SBarry Smith cp -fr include ${INSTALL_DIR};\ 226*3c94ec11SBarry Smith if [ ! -d ${INSTALL_DIR}/bmake ]; then \ 227*3c94ec11SBarry Smith mkdir ${INSTALL_DIR}/bmake ; \ 228*3c94ec11SBarry Smith fi;\ 229*3c94ec11SBarry Smith cp -f bmake/adic* bmake/variables ${INSTALL_DIR}/bmake ; \ 230*3c94ec11SBarry Smith cp -fr bmake/common ${INSTALL_DIR}/bmake;\ 231*3c94ec11SBarry Smith cp -fr bmake/${PETSC_ARCH} ${INSTALL_DIR}/bmake;\ 232*3c94ec11SBarry Smith cp -fr bin ${INSTALL_DIR};\ 233*3c94ec11SBarry Smith if [ ! -d ${INSTALL_DIR}/lib ]; then \ 234*3c94ec11SBarry Smith mkdir ${INSTALL_DIR}/lib ; \ 235*3c94ec11SBarry Smith fi;\ 236*3c94ec11SBarry Smith for i in lib/lib*; do \ 237*3c94ec11SBarry Smith bopt=`echo $${i} | ${SED} s=lib/lib==g`;\ 238*3c94ec11SBarry Smith if [ ! -d ${INSTALL_DIR}/$${i} ]; then \ 239*3c94ec11SBarry Smith mkdir ${INSTALL_DIR}/$${i};\ 240*3c94ec11SBarry Smith fi; \ 241*3c94ec11SBarry Smith if [ -d $${i}/${PETSC_ARCH} ]; then \ 242*3c94ec11SBarry Smith cp -fr $${i}/${PETSC_ARCH} ${INSTALL_DIR}/$${i};\ 243*3c94ec11SBarry Smith ${RANLIB} ${INSTALL_DIR}/$${i}/*.a > /dev/null 2>&1 ;\ 244*3c94ec11SBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${INSTALL_DIR} BOPT=$${bopt} shared; \ 245*3c94ec11SBarry Smith fi;\ 246*3c94ec11SBarry Smith done;\ 247*3c94ec11SBarry Smith echo "sh/bash: PETSC_DIR="${INSTALL_DIR}"; export PETSC_DIR";\ 248*3c94ec11SBarry Smith echo "csh/tcsh: setenv PETSC_DIR "${INSTALL_DIR} ;\ 249*3c94ec11SBarry Smith echo "The do make test to verify correct install";\ 250*3c94ec11SBarry Smith fi; 251*3c94ec11SBarry Smith 252*3c94ec11SBarry Smithinstall_src: 253*3c94ec11SBarry Smith -@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \ 254*3c94ec11SBarry Smith echo "You did not set a directory to install to";\ 255*3c94ec11SBarry Smith else \ 256*3c94ec11SBarry Smith echo Installing PETSc source at ${INSTALL_DIR};\ 257*3c94ec11SBarry Smith if [ ! -d `dirname ${INSTALL_DIR}` ]; then \ 258*3c94ec11SBarry Smith mkdir `dirname ${INSTALL_DIR}` ; \ 259*3c94ec11SBarry Smith fi;\ 260*3c94ec11SBarry Smith if [ ! -d ${INSTALL_DIR} ]; then \ 261*3c94ec11SBarry Smith mkdir ${INSTALL_DIR} ; \ 262*3c94ec11SBarry Smith fi;\ 263*3c94ec11SBarry Smith cp -fr src ${INSTALL_DIR};\ 264*3c94ec11SBarry Smith fi; 265*3c94ec11SBarry Smith 266*3c94ec11SBarry Smithinstall_docs: 267*3c94ec11SBarry Smith -@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \ 268*3c94ec11SBarry Smith echo "You did not set a directory to install to";\ 269*3c94ec11SBarry Smith else \ 270*3c94ec11SBarry Smith echo Installing PETSc documentation at ${INSTALL_DIR};\ 271*3c94ec11SBarry Smith if [ ! -d `dirname ${INSTALL_DIR}` ]; then \ 272*3c94ec11SBarry Smith mkdir `dirname ${INSTALL_DIR}` ; \ 273*3c94ec11SBarry Smith fi;\ 274*3c94ec11SBarry Smith if [ ! -d ${INSTALL_DIR} ]; then \ 275*3c94ec11SBarry Smith mkdir ${INSTALL_DIR} ; \ 276*3c94ec11SBarry Smith fi;\ 277*3c94ec11SBarry Smith cp -fr docs ${INSTALL_DIR};\ 278*3c94ec11SBarry Smith ${RM} -fr docs/tex;\ 2793677444aSSatish Balay fi; 2803677444aSSatish Balay# ------------------------------------------------------------------ 2813677444aSSatish Balay# 2823677444aSSatish Balay# All remaining actions are intended for PETSc developers only. 2833677444aSSatish Balay# PETSc users should not generally need to use these commands. 2843677444aSSatish Balay# 28565783a8cSBarry Smith 28665783a8cSBarry Smith# To access the tags in EMACS, type M-x visit-tags-table and specify 28765783a8cSBarry Smith# the file petsc/TAGS. 28865783a8cSBarry Smith# 1) To move to where a PETSc function is defined, enter M-. and the 28965783a8cSBarry Smith# function name. 29065783a8cSBarry Smith# 2) To search for a string and move to the first occurrence, 2917acb7333SLois Curfman McInnes# use M-x tags-search and the string. 29211b6ed10SLois Curfman McInnes# To locate later occurrences, use M-, 29311b6ed10SLois Curfman McInnes# Builds all etags files 29401c05c5cSSatish Balayalletags: 29509f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags 29609f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples 29709f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples 2984fa9d4e7SBarry Smith -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles 29920563c6bSBarry Smith# Builds complete etags list 30009f7043eSSatish Balayetags: 30109f7043eSSatish Balay -${RM} ${TAGSDIR}/TAGS 30209f7043eSSatish Balay -touch ${TAGSDIR}/TAGS 30341fa366cSBarry Smith -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree 30409f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree 30509f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree 30609f7043eSSatish Balay -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree 30709f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree 30809f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree 30909f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree 31009f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree 31109f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree 3124fa9d4e7SBarry Smith -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles 3134fa9d4e7SBarry Smith -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_docs alltree 31411b6ed10SLois Curfman McInnes -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_scripts alltree 315bfce26a3SBarry Smith# Builds the etags file that excludes the examples directories 31609f7043eSSatish Balayetags_noexamples: 31709f7043eSSatish Balay -${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES 31809f7043eSSatish Balay -touch ${TAGSDIR}/TAGS_NO_EXAMPLES 31941fa366cSBarry Smith -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree 32009f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree 32109f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree 32209f7043eSSatish Balay -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree 32309f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree 32409f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles 32511b6ed10SLois Curfman McInnes -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree 326b16a3bb1SBarry Smith# Builds the etags file for makefiles 3277e0368d4SSatish Balayetags_makefiles: 3287e0368d4SSatish Balay -${RM} ${TAGSDIR}/TAGS_MAKEFILES 3297e0368d4SSatish Balay -touch ${TAGSDIR}/TAGS_MAKEFILES 3307e0368d4SSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree 331dc80aa23SSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles 332dc80aa23SSatish Balay# Builds the etags file for examples 33309f7043eSSatish Balayetags_examples: 33409f7043eSSatish Balay -${RM} ${TAGSDIR}/TAGS_EXAMPLES 33509f7043eSSatish Balay -touch ${TAGSDIR}/TAGS_EXAMPLES 33609f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree 33709f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree 33809f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree 3392176044fSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree 34009f7043eSSatish Balayetags_fexamples: 34109f7043eSSatish Balay -${RM} ${TAGSDIR}/TAGS_FEXAMPLES 34209f7043eSSatish Balay -touch ${TAGSDIR}/TAGS_FEXAMPLES 34309f7043eSSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree 344b38bb785SSatish Balay -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree 345f20f7ba3SSatish Balay# 3463677444aSSatish Balay# These are here for the target allci and allco, and etags 347b38bb785SSatish Balay# 34823bef294SSatish Balay 349516d1546SSatish BalayBMAKEFILES = bmake/common/base bmake/common/test \ 3502bda9e70SSatish Balay bmake/common/bopt* bmake/*/rules bmake/*/variables bmake/*/packages \ 3512905d4d4SKris Buschelman bmake/*/petscconf.h bmake/*/petscfix.h bmake/config/packages.in \ 35237dc49f7SBarry Smith bmake/config/petscfix.h.in bmake/config/rules.in \ 3532f1ebae6SLois Curfman McInnes bmake/config/variables.in bmake/adic.init bmake/adicmf.init 354d56c4d9fSBarry SmithDOCS = bmake/readme bmake/petscconf.defs 355d56c4d9fSBarry SmithSCRIPTS = maint/builddist maint/wwwman maint/xclude maint/crontab python/PETSc/Configure.py python/PETSc/Options.py \ 356d56c4d9fSBarry Smith python/PETSc/packages/ADIC.py python/PETSc/packages/MPE.py python/PETSc/packages/Mathematica.py \ 357d56c4d9fSBarry Smith python/PETSc/packages/PLAPACK.py python/PETSc/packages/Triangle.py python/PETSc/packages/Matlab.py \ 358d56c4d9fSBarry Smith python/PETSc/packages/PVODE.py python/PETSc/packages/BlasLapack.py python/PETSc/packages/MPI.py \ 359e9f3bb17SBarry Smith python/PETSc/packages/BlockSolve.py python/PETSc/packages/NetCDF.py python/PETSc/packages/ParMetis.py \ 360d56c4d9fSBarry Smith python/PETSc/packages/update.py maint/confignightly/* config/*.py 36111b6ed10SLois Curfman McInnes 3626b91f8d1SSatish Balay 3636b91f8d1SSatish Balayupdatewebdocs: 3646b91f8d1SSatish Balay -chmod -R ug+w /mcs/tmp/petsc-tmp 3656b91f8d1SSatish Balay -chgrp -R petsc /mcs/tmp/petsc-tmp 3666b91f8d1SSatish Balay -/bin/rm -rf /mcs/tmp/petscdocs 3676b91f8d1SSatish Balay -/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs 3686b91f8d1SSatish Balay -maint/update-docs.py /mcs/tmp/petscdocs 3696b91f8d1SSatish Balay -find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \; 3706b91f8d1SSatish Balay -/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs 3716b91f8d1SSatish Balay -/bin/rm -rf /mcs/tmp/petscdocs 372ad56a76cSSatish Balay 373ad56a76cSSatish Balaychk_loc: 374ad56a76cSSatish Balay @if [ ${LOC}foo = foo ] ; then \ 375ad56a76cSSatish Balay echo "*********************** ERROR ************************" ; \ 376ad56a76cSSatish Balay echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \ 3772496ca06SSatish Balay echo "******************************************************"; false; fi 378a2fc510eSBarry Smith 379f1d13e97SSatish Balay# Builds all the documentation - should be done every night 380f1d13e97SSatish Balayalldoc: alldoc1 alldoc2 381f1d13e97SSatish Balay 382f1d13e97SSatish Balay# Build everything that goes into 'doc' dir except html sources 383130c9832SBarry Smithalldoc1: chk_loc deletemanualpages chk_concepts_dir 384fe742e3dSSatish Balay -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 385130c9832SBarry Smith cd docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 38648b2c0e9SBarry Smith -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 387130c9832SBarry Smith -maint/wwwindex.py ${PETSC_DIR} ${LOC} 388130c9832SBarry Smith -${OMAKE} ACTION=manexamples tree LOC=${LOC} 38948b2c0e9SBarry Smith -${OMAKE} manconcepts LOC=${LOC} 39048b2c0e9SBarry Smith -${OMAKE} ACTION=getexlist tree LOC=${LOC} 39148b2c0e9SBarry Smith -${OMAKE} ACTION=exampleconcepts tree LOC=${LOC} 392e01137a2SSatish Balay -maint/helpindex.py ${PETSC_DIR} ${LOC} 393435da068SBarry Smith 394062da8f7SSatish Balay# Builds .html versions of the source 395f1d13e97SSatish Balay# html overwrites some stuff created by update-docs - hence this is done later. 3963a2060ecSSatish Balayalldoc2: chk_loc 397062da8f7SSatish Balay -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 398435da068SBarry Smith -maint/update-docs.py ${LOC} 399efaa7783SSatish Balay 400efaa7783SSatish Balayalldocclean: deletemanualpages allcleanhtml 401efaa7783SSatish Balay 402efaa7783SSatish Balay# Deletes man pages (HTML version) 403efaa7783SSatish Balaydeletemanualpages: chk_loc 404efaa7783SSatish Balay find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; 405efaa7783SSatish Balay ${RM} ${LOC}/docs/tex/exampleconcepts 406efaa7783SSatish Balay ${RM} ${LOC}/docs/tex/manconcepts 407efaa7783SSatish Balay ${RM} ${LOC}/docs/manualpages/manualpages.cit 408efaa7783SSatish Balay -maint/update-docs.py ${LOC} clean 409115a300dSBarry Smith 410efaa7783SSatish Balayallcleanhtml: 411cc4dcc40SBarry Smith -${RM} include/adic/*.h.html include/esi/petsc/*.h.html 412395565bcSBarry Smith -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 413ad56a76cSSatish Balay 414fe742e3dSSatish Balaychk_concepts_dir: chk_loc 415bfe54af3SSatish Balay @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 416bdde29a3SBarry Smith echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 417bdde29a3SBarry Smith# 418bdde29a3SBarry Smith# checks if should build Fortran stubs 419da77a087SBarry Smithchk_fortranstubs: 420bdde29a3SBarry Smith -@if [ ! -f "${PETSC_DIR}/src/fortran/auto/makefile.src" -a "${C_FC}" != "" ]; then \ 421bdde29a3SBarry Smith ${OMAKE} PETSC_DIR=${PETSC_DIR} allfortranstubs ;\ 422bdde29a3SBarry Smith fi 42311b6ed10SLois Curfman McInnes 42411b6ed10SLois Curfman McInnes# Builds Fortran stub files 42509d4790eSSatish Balayallfortranstubs: 4269c0ff1f6SBarry Smith -@which ${BFORT} > /dev/null 2>&1; \ 4279c0ff1f6SBarry Smith if [ "$$?" != "0" ]; then \ 4289c0ff1f6SBarry Smith echo "No bfort available, skipping building Fortran stubs";\ 4299c0ff1f6SBarry Smith else \ 4309c0ff1f6SBarry Smith ${RM} -f ${PETSC_DIR}/src/fortran/auto/*.c ;\ 4319c0ff1f6SBarry Smith touch ${PETSC_DIR}/src/fortran/auto/makefile.src ;\ 4329c0ff1f6SBarry Smith ${OMAKE} ACTION=fortranstubs tree_basic ;\ 4339c0ff1f6SBarry Smith cd ${PETSC_DIR}/src/fortran/auto; ${RM} makefile.src; echo SOURCEC = ` ls *.c | tr -s '\n' ' '` > makefile.src ;\ 4349c0ff1f6SBarry Smith cd ${PETSC_DIR}/src/fortran/auto; ${OMAKE} fixfortran ;\ 435f6ff2982SSatish Balay fi 436d55938c2SBarry Smith 43719552e71SMatthew Knepleyallci: 438b951964fSBarry Smith -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci alltree 439d55938c2SBarry Smith 44019552e71SMatthew Knepleyallco: 441d55938c2SBarry Smith -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co alltree 442791d64f4SSatish Balay 443791d64f4SSatish Balay# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28 44419552e71SMatthew Knepleyallrcslabel: 445b334301eSBarry Smith -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel alltree 446b334301eSBarry Smith# 447b334301eSBarry Smith# The commands below are for generating ADIC versions of the code; 448b334301eSBarry Smith# they are not currently used. 4495eea60f9SBarry Smith# 450b87434adSSatish Balayalladicignore: 45119552e71SMatthew Knepley -@${RM} ${INSTALL_LIB_DIR}/adicignore 4525eea60f9SBarry Smith -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore tree 4535eea60f9SBarry Smith 454d18b0ea7SBarry Smithalladic: 45567b024f7SSatish Balay -@echo "Beginning to compile ADIC source code in all directories" 456d18b0ea7SBarry Smith -@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}" 45747794344SBarry Smith -@echo "=========================================" 45867b024f7SSatish Balay -@cd include ; \ 45919552e71SMatthew Knepley ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h 46047794344SBarry Smith -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 46119552e71SMatthew Knepley -@cd src/inline ; \ 46277ed5343SBarry Smith ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic 46319552e71SMatthew Knepley -@cd src/blaslapack ; \ 4646e81b665SBarry Smith ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 46547794344SBarry Smith 466d18b0ea7SBarry Smithalladiclib: 467d77bb2e1SSatish Balay -@echo "Beginning to compile ADIC libraries in all directories" 468d18b0ea7SBarry Smith -@echo "Using compiler: ${CC} ${COPTFLAGS}" 469d77bb2e1SSatish Balay -@echo "-----------------------------------------" 470d18b0ea7SBarry Smith -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 471e0e703c1SSatish Balay -@echo "-----------------------------------------" 472ba1077baSMatthew Knepley -@echo "Using configuration flags:" 473d18b0ea7SBarry Smith -@grep "define " bmake/${INLUDE_ARCH}/petscconf.h 474d77bb2e1SSatish Balay -@echo "-----------------------------------------" 475d18b0ea7SBarry Smith -@echo "Using include paths: ${PETSC_INCLUDE}" 476d77bb2e1SSatish Balay -@echo "-----------------------------------------" 47719552e71SMatthew Knepley -@echo "Using PETSc directory: ${PETSC_DIR}" 478d18b0ea7SBarry Smith -@echo "Using PETSc arch: ${PETSC_ARCH}" 4795fde6e02SSatish Balay -@echo "=========================================" 48019552e71SMatthew Knepley -@${RM} -f ${INSTALL_LIB_DIR}/*adic.${LIB_SUFFIX} 48177ed5343SBarry Smith -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 48219552e71SMatthew Knepley -@cd src/blaslapack ; \ 4837e351921SBarry Smith ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 48419552e71SMatthew Knepley -@cd src/adic/src ; \ 4855eea60f9SBarry Smith ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib 4869e417c50SSatish Balay 4879e417c50SSatish Balay# ------------------------------------------------------------------------------- 4889e417c50SSatish Balay# 4899e417c50SSatish Balay# Some macros to check if the fortran interface is up-to-date. 4909e417c50SSatish Balay# 491d77bb2e1SSatish Balaycountfortranfunctions: 49285c7cd6cSSatish Balay -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 4939e417c50SSatish Balay cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 494b334301eSBarry Smith sed "s/_$$//" | sort > /tmp/countfortranfunctions 4959e417c50SSatish Balay 49685c7cd6cSSatish Balaycountcfunctions: 49785c7cd6cSSatish Balay -@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \ 4989e417c50SSatish Balay cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 4999e417c50SSatish Balay tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 5009e417c50SSatish Balay 5019e417c50SSatish Balaydifffortranfunctions: countfortranfunctions countcfunctions 5029700b7f8SSatish Balay -@echo -------------- Functions missing in the fortran interface --------------------- 5039e417c50SSatish Balay -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 5049700b7f8SSatish Balay -@echo ----------------- Functions missing in the C interface ------------------------ 505d77bb2e1SSatish Balay -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 506b334301eSBarry Smith -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 5073f4c9a3aSSatish Balay 5083f4c9a3aSSatish Balaycheckbadfortranstubs: 5093f4c9a3aSSatish Balay -@echo "=========================================" 5103f4c9a3aSSatish Balay -@echo "Functions with MPI_Comm as an Argument" 511d77bb2e1SSatish Balay -@echo "=========================================" 51285c7cd6cSSatish Balay -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 5133f4c9a3aSSatish Balay tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 5143f4c9a3aSSatish Balay -@echo "=========================================" 5153f4c9a3aSSatish Balay -@echo "Functions with a String as an Argument" 516d77bb2e1SSatish Balay -@echo "=========================================" 51785c7cd6cSSatish Balay -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 5183f4c9a3aSSatish Balay tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 5193f4c9a3aSSatish Balay -@echo "=========================================" 5203f4c9a3aSSatish Balay -@echo "Functions with Pointers to PETSc Objects as Argument" 521d77bb2e1SSatish Balay -@echo "=========================================" 52285c7cd6cSSatish Balay -@cd ${PETSC_DIR}/src/fortran/auto; \ 52385c7cd6cSSatish Balay _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 5243f4c9a3aSSatish Balay cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 5253f4c9a3aSSatish Balay sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 52685c7cd6cSSatish Balay for OBJ in $$_p_OBJ; do \ 5273f4c9a3aSSatish Balay grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 5283f4c9a3aSSatish Balay cut -d'(' -f1 | cut -d' ' -f1,3; \ 5294556b810SBarry Smith done 5304556b810SBarry Smith# 531b6ea66eeSBarry Smith# Automatically generates PETSc exercises in html from the tutorial examples. 53275df30afSSatish Balay# 533b6ea66eeSBarry Smith# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited 534b6ea66eeSBarry Smith# (used also in introductions to the manual pages) 535b6ea66eeSBarry Smith# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited 536b6ea66eeSBarry Smith# The list of exercises is from TUTORIALS in each directory's makefile 5374556b810SBarry Smith# 5384556b810SBarry Smith# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced. 5394556b810SBarry Smith# The pagemaker rule is in the file bmake/common (at the bottom) 540843ae28eSBarry Smith# 54197e8d271SBarry Smith# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 542843ae28eSBarry Smith# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 54397e8d271SBarry Smith# 54497e8d271SBarry Smithexercises: 54597e8d271SBarry Smith -@echo "=========================================" 546467fbd6dSBarry Smith -@echo "Generating HTML tutorial exercises" 54797e8d271SBarry Smith -@${RM} docs/pageform.txt 54897e8d271SBarry Smith -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 549beb1b3a5SBarry Smith -@echo "access_title=Exercise Sections" >> docs/pageform.txt 55097e8d271SBarry Smith -@echo "access_format=short" >> docs/pageform.txt 55197e8d271SBarry Smith -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 55297e8d271SBarry Smith -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 55397e8d271SBarry Smith -@echo "Generating HTML for individual directories" 554beb1b3a5SBarry Smith -@echo "=========================================" 55597e8d271SBarry Smith -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 55697e8d271SBarry Smith -@echo "Completed HTML for individual directories" 55797e8d271SBarry Smith -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 55897e8d271SBarry Smith -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 55997e8d271SBarry Smith /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 56097e8d271SBarry Smith -@echo "=========================================" 561b4b3a923SMatthew Knepley 562b4b3a923SMatthew Knepley# Make a tarball of all the Python code 563b4b3a923SMatthew Knepley# This is currently used to release to the Teragrid 564b4b3a923SMatthew KnepleypetscPython.tgz: 565b4b3a923SMatthew Knepley @tar cvzf $@ --exclude SCCS --exclude BitKeeper --dereference python/ 566b4b3a923SMatthew Knepley -@scp $@ tg-login2.uc.teragrid.org:./ 5678852b4e5SMatthew Knepley 568a42cec9dSMatthew Knepley.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \ 569a42cec9dSMatthew Knepley alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \ 570b4b3a923SMatthew Knepley allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \ 571f7819401SBarry Smith start_configure configure_petsc configure_clean petscPython.tgz 572 573