1# 2# This is the makefile for compiling PETSc. See 3# http://www.mcs.anl.gov/petsc/documentation/installation.html for directions on installing PETSc. 4# See also conf for additional commands. 5# 6ALL: all 7LOCDIR = ./ 8DIRS = src include tutorials interfaces share/petsc/matlab 9CFLAGS = 10FFLAGS = 11CPPFLAGS = 12FPPFLAGS = 13 14# next line defines PETSC_DIR and PETSC_ARCH if they are not set 15include ././${PETSC_ARCH}/lib/petsc/conf/petscvariables 16include ${PETSC_DIR}/lib/petsc/conf/variables 17include ${PETSC_DIR}/lib/petsc/conf/rules 18include ${PETSC_DIR}/lib/petsc/conf/test.common 19 20# This makefile contains a lot of PHONY targets with improperly specified prerequisites 21# where correct execution instead depends on the targets being processed in the correct 22# order. This is gross, but this makefile doesn't really do any work. Sub-makes still 23# benefit from parallelism. 24.NOTPARALLEL: 25 26# 27# Basic targets to build PETSc libraries. 28# 29all: 30 +@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} chk_petscdir chk_upgrade | tee ${PETSC_ARCH}/lib/petsc/conf/make.log 31 @ln -sf ${PETSC_ARCH}/lib/petsc/conf/make.log make.log 32 +@${OMAKE_PRINTDIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; 33 @egrep -i "( error | error: |no such file or directory)" ${PETSC_ARCH}/lib/petsc/conf/make.log | tee ${PETSC_ARCH}/lib/petsc/conf/error.log > /dev/null 34 +@if test -s ${PETSC_ARCH}/lib/petsc/conf/error.log; then \ 35 printf ${PETSC_TEXT_HILIGHT}"**************************ERROR*************************************\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \ 36 echo " Error during compile, check ${PETSC_ARCH}/lib/petsc/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \ 37 echo " Send it and ${PETSC_ARCH}/lib/petsc/conf/configure.log to petsc-maint@mcs.anl.gov" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\ 38 printf "********************************************************************"${PETSC_TEXT_NORMAL}"\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\ 39 fi #solaris make likes to print the whole command that gave error. So split this up into the smallest chunk below 40 @echo "Finishing make run at `date +'%a, %d %b %Y %H:%M:%S %z'`" >> ${PETSC_ARCH}/lib/petsc/conf/make.log 41 @if test -s ${PETSC_ARCH}/lib/petsc/conf/error.log; then exit 1; fi 42 43all-local: info libs matlabbin mpi4py-build petsc4py-build libmesh-build slepc-build mfem-build 44 45# 46# Prints information about the system and version of PETSc being compiled 47# 48info: 49 -@echo "==========================================" 50 -@echo " " 51 -@echo "See documentation/faq.html and documentation/bugreporting.html" 52 -@echo "for help with installation problems. Please send EVERYTHING" 53 -@echo "printed out below when reporting problems. Please check the" 54 -@echo "mailing list archives and consider subscribing." 55 -@echo " " 56 -@echo " http://www.mcs.anl.gov/petsc/miscellaneous/mailing-lists.html" 57 -@echo " " 58 -@echo "==========================================" 59 -@echo Starting make run on `hostname` at `date +'%a, %d %b %Y %H:%M:%S %z'` 60 -@echo Machine characteristics: `uname -a` 61 -@echo "-----------------------------------------" 62 -@echo "Using PETSc directory: ${PETSC_DIR}" 63 -@echo "Using PETSc arch: ${PETSC_ARCH}" 64 -@echo "-----------------------------------------" 65 -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" 66 -@echo "-----------------------------------------" 67 -@echo "Using configure Options: ${CONFIGURE_OPTIONS}" 68 -@echo "Using configuration flags:" 69 -@grep "\#define " ${PETSCCONF_H} 70 -@echo "-----------------------------------------" 71 -@echo "Using C compile: ${PETSC_COMPILE}" 72 -@if [ "${MPICC_SHOW}" != "" ]; then \ 73 printf "mpicc -show: %b\n" "${MPICC_SHOW}";\ 74 fi; \ 75 printf "C compiler version: %b\n" "${C_VERSION}"; \ 76 if [ "${CXX}" != "" ]; then \ 77 echo "Using C++ compile: ${PETSC_CXXCOMPILE}";\ 78 if [ "${MPICXX_SHOW}" != "" ]; then \ 79 printf "mpicxx -show: %b\n" "${MPICXX_SHOW}"; \ 80 fi;\ 81 printf "C++ compiler version: %b\n" "${Cxx_VERSION}"; \ 82 fi 83 -@if [ "${FC}" != "" ]; then \ 84 echo "Using Fortran compile: ${PETSC_FCOMPILE}";\ 85 if [ "${MPIFC_SHOW}" != "" ]; then \ 86 printf "mpif90 -show: %b\n" "${MPIFC_SHOW}"; \ 87 fi; \ 88 printf "Fortran compiler version: %b\n" "${FC_VERSION}"; \ 89 fi 90 -@if [ "${CUDAC}" != "" ]; then \ 91 echo "Using CUDA compile: ${PETSC_CUCOMPILE}";\ 92 fi 93 -@echo "-----------------------------------------" 94 -@echo "Using C/C++ linker: ${PCC_LINKER}" 95 -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" 96 -@if [ "${FC}" != "" ]; then \ 97 echo "Using Fortran linker: ${FC_LINKER}";\ 98 echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ 99 fi 100 -@echo "-----------------------------------------" 101 -@echo "Using system modules: ${LOADEDMODULES}" 102 -@if [ "${MPI_IS_MPIUNI}" = "1" ]; then \ 103 echo Using mpi.h: mpiuni; \ 104 else \ 105 TESTDIR=`mktemp -q -d -t petscmpi-XXXXXXXX` && \ 106 echo '#include <mpi.h>' > $${TESTDIR}/mpitest.c && \ 107 BUF=`${CPP} ${PETSC_CCPPFLAGS} $${TESTDIR}/mpitest.c |grep 'mpi\.h' | ( head -1 ; cat > /dev/null )` && \ 108 echo Using mpi.h: $${BUF}; ${RM} -rf $${TESTDIR}; \ 109 fi 110 -@echo "-----------------------------------------" 111 -@echo "Using libraries: ${PETSC_LIB}" 112 -@echo "------------------------------------------" 113 -@echo "Using mpiexec: ${MPIEXEC}" 114 -@echo "------------------------------------------" 115 -@echo "Using MAKEFLAGS: -j$(MAKE_NP) -l$(MAKE_LOAD) $(MAKEFLAGS)" 116 -@echo "==========================================" 117 118# 119# Build MatLab binaries 120# 121matlabbin: 122 -@if [ "${MATLAB_MEX}" != "" -a "${MATLAB_SOCKET}" != "" -a "${PETSC_SCALAR}" = "real" -a "${PETSC_PRECISION}" = "double" ]; then \ 123 echo "BEGINNING TO COMPILE MATLAB INTERFACE"; \ 124 if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc; fi; \ 125 if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab; fi; \ 126 cd src/sys/classes/viewer/impls/socket/matlab && ${OMAKE} matlabcodes PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR}; \ 127 echo "========================================="; \ 128 fi 129# 130# Builds PETSc test examples for a given architecture 131# 132test_install: test 133check: test 134test: 135 -+@${OMAKE} PATH="${PETSC_DIR}/${PETSC_ARCH}/lib:${PATH}" PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} test_build 2>&1 | tee ./${PETSC_ARCH}/lib/petsc/conf/test.log 136testx: 137 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testx_build 2>&1 | tee ./${PETSC_ARCH}/lib/petsc/conf/testx.log 138test_build: 139 -@echo "Running test examples to verify correct installation" 140 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 141 +@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 142 +@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex19 143 +@if [ "${HYPRE_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 144 cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} DIFF=${PETSC_DIR}/lib/petsc/bin/petscdiff runex19_hypre; \ 145 fi; 146 +@if [ "${MUMPS_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 147 cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} DIFF=${PETSC_DIR}/lib/petsc/bin/petscdiff runex19_fieldsplit_mumps; \ 148 fi; 149 +@if [ "${SUPERLU_DIST_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 150 cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} DIFF=${PETSC_DIR}/lib/petsc/bin/petscdiff runex19_superlu_dist; \ 151 fi; 152 +@if ( [ "${ML_LIB}" != "" ] || [ "${TRILINOS_LIB}" != "" ] ) && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 153 cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} DIFF=${PETSC_DIR}/lib/petsc/bin/petscdiff runex19_ml; \ 154 fi; 155 +@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ex19.rm 156 +@if [ "${PETSC4PY}" = "yes" ]; then \ 157 cd src/ksp/ksp/examples/tutorials >/dev/null; \ 158 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean; \ 159 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex100; \ 160 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean; \ 161 fi; 162 +@egrep "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ 163 if test -s .ftn.log; then \ 164 cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex5f; \ 165 fi; ${RM} .ftn.log; 166 +@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 167 -@echo "Completed test examples" 168testx_build: 169 -@echo "Running graphics test example to verify correct X11 installation" 170 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 171 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 172 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testxex19 173 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 174 -@echo "Completed graphics test example" 175test_usermakefile: 176 -@echo "Testing compile with user makefile" 177 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 178 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${PETSC_DIR}/share/petsc/Makefile.user ex19 179 @egrep "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ 180 if test -s .ftn.log; then \ 181 cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${PETSC_DIR}/share/petsc/Makefile.user ex5f; \ 182 fi; ${RM} .ftn.log; 183 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 184 -@echo "Completed compile with user makefile" 185 186# Compare ABI/API of two versions of PETSc library with the old one defined by PETSC_{DIR,ARCH}_ABI_OLD 187abitest: 188 @if [ "${PETSC_DIR_ABI_OLD}" == "" ] || [ "${PETSC_ARCH_ABI_OLD}" == "" ]; \ 189 then printf "You must set environment variables PETSC_DIR_ABI_OLD and PETSC_ARCH_ABI_OLD to run abitest\n"; \ 190 exit 1; \ 191 fi; 192 -@echo "Comparing ABI/API of the following two PETSc versions (you must have already configured and built them using GCC and with -g):" 193 -@echo "=========================================================================================" 194 -@echo " Old: PETSC_DIR_ABI_OLD = ${PETSC_DIR_ABI_OLD}" 195 -@echo " PETSC_ARCH_ABI_OLD = ${PETSC_ARCH_ABI_OLD}" 196 -@pushd ${PETSC_DIR_ABI_OLD} >> /dev/null ; echo " Branch = "`git rev-parse --abbrev-ref HEAD` 197 -@echo " New: PETSC_DIR = ${PETSC_DIR}" 198 -@echo " PETSC_ARCH = ${PETSC_ARCH}" 199 -@echo " Branch = "`git rev-parse --abbrev-ref HEAD` 200 -@echo "=========================================================================================" 201 -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/abicheck.py -old_dir ${PETSC_DIR_ABI_OLD} -old_arch ${PETSC_ARCH_ABI_OLD} -new_dir ${PETSC_DIR} -new_arch ${PETSC_ARCH} -report_format html 202 203# Compare ABI/API of current PETSC_ARCH/PETSC_DIR with a previous branch 204abitestcomplete: 205 -@if [[ -f "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/configure.log" ]]; then \ 206 OPTIONS=`grep -h -m 1 "Configure Options: " ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/configure.log | sed "s!Configure Options: --configModules=PETSc.Configure --optionsModule=config.compilerOptions!!g"` ;\ 207echo $${OPTIONS} ;\ 208 fi ; \ 209 if [[ "${PETSC_DIR_ABI_OLD}" != "" ]]; then \ 210 PETSC_DIR_OLD=${PETSC_DIR_ABI_OLD}; \ 211 else \ 212 PETSC_DIR_OLD=${PETSC_DIR}/../petsc-abi; \ 213 fi ; \ 214 echo "=================================================================================================" ;\ 215 echo "Doing ABI/API comparison between" ${branch} " and " `git rev-parse --abbrev-ref HEAD` "using " $${OPTIONS} ;\ 216 echo "=================================================================================================" ;\ 217 if [[ ! -d $${PETSC_DIR_OLD} ]]; then \ 218 git clone ${PETSC_DIR} $${PETSC_DIR_OLD} ; \ 219 else \ 220 cd $${PETSC_DIR_OLD} ; \ 221 git pull ; \ 222 fi ; \ 223 cd $${PETSC_DIR_OLD} ; \ 224 git checkout ${branch} ; \ 225 PETSC_DIR=`pwd` PETSC_ARCH=arch-branch-`git rev-parse ${branch}` ./configure $${OPTIONS} ; \ 226 PETSC_DIR=`pwd` PETSC_ARCH=arch-branch-`git rev-parse ${branch}` make all test ; \ 227 cd ${PETSC_DIR} ; \ 228 ./configure $${OPTIONS}; \ 229 make all test ; \ 230 PETSC_DIR_ABI_OLD=$${PETSC_DIR_OLD} PETSC_ARCH_ABI_OLD=arch-branch-`git rev-parse ${branch}` make abitest 231 232# Deletes PETSc libraries 233deletelibs: 234 -${RM} -rf ${PETSC_LIB_DIR}/libpetsc*.* 235deletemods: 236 -${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod 237 238allclean: 239 -@${OMAKE} -f gmakefile clean 240 241clean:: allclean 242 243distclean: chk_petscdir 244 @if [ -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ]; then \ 245 echo "*** Preserving ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py in ${PETSC_DIR} ***"; \ 246 mv -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ${PETSC_DIR}/; fi 247 @echo "*** Deleting all build files in ${PETSC_DIR}/${PETSC_ARCH} ***" 248 -${RM} -rf ${PETSC_DIR}/${PETSC_ARCH}/ 249 250 251# 252reconfigure: 253 @unset MAKEFLAGS && ${PYTHON} ${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py 254# 255install: 256 @${PYTHON} ./config/install.py -destDir=${DESTDIR} 257 +${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} mpi4py-install petsc4py-install libmesh-install slepc-install mfem-install 258 259streams: 260 -@echo "running streams in src/benchmarks/streams" 261 +@cd src/benchmarks/streams; ${OMAKE} PATH="${PETSC_DIR}/${PETSC_ARCH}/lib:${PATH}" PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} streams 262 263stream: 264 -@echo "running stream in src/benchmarks/streams" 265 +@cd src/benchmarks/streams; ${OMAKE} PATH="${PETSC_DIR}/${PETSC_ARCH}/lib:${PATH}" PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} stream 266 267# ------------------------------------------------------------------ 268# 269# All remaining actions are intended for PETSc developers only. 270# PETSc users should not generally need to use these commands. 271# 272# See the users manual for how the tags files may be used from Emacs and Vi/Vim 273# 274alletags: 275 -@${PYTHON} lib/petsc/bin/maint/generateetags.py 276 -@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON 277 278# obtain gtags from http://www.gnu.org/s/global/ 279allgtags: 280 -@find ${PETSC_DIR}/include ${PETSC_DIR}/src ${PETSC_DIR}/bin -regex '\(.*makefile\|.*\.\(cc\|hh\|cpp\|C\|hpp\|c\|h\|cu\|m\)$$\)' | grep -v ftn-auto | gtags -f - 281 282allfortranstubs: 283 -@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir 284 @${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} 285 -@${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} 286 -@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir 287deletefortranstubs: 288 -@find . -type d -name ftn-auto | xargs rm -rf 289 290# Builds all the documentation - should be done every night 291alldoc: allcite allpdf alldoc1 alldoc2 docsetdate 292 293# Build just citations 294allcite: chk_loc deletemanualpages 295 -${PYTHON} lib/petsc/bin/maint/countpetsccits.py 296 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 297 -@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap 298 -@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap 299 300# Build just PDF manuals + prerequisites 301allpdf: chk_loc allcite 302 -cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 303 -cd src/docs/tex/manual; ${OMAKE} developers.pdf LOC=${LOC} 304 -cd src/docs/tao_tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 305 306# Build just manual pages + prerequisites 307allmanpages: chk_loc allcite 308 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 309 310# Build just manual examples + prerequisites 311allmanexamples: chk_loc allmanpages 312 -${OMAKE} ACTION=manexamples tree_basic LOC=${LOC} 313 314# Build everything that goes into 'doc' dir except html sources 315alldoc1: chk_loc chk_concepts_dir allcite allmanpages allmanexamples 316 -${OMAKE} manimplementations LOC=${LOC} 317 -${PYTHON} lib/petsc/bin/maint/wwwindex.py ${PETSC_DIR} ${LOC} 318 -${OMAKE} manconcepts LOC=${LOC} 319 -${OMAKE} ACTION=getexlist tree_basic LOC=${LOC} 320 -${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC} 321 -${PYTHON} lib/petsc/bin/maint/helpindex.py ${PETSC_DIR} ${LOC} 322 323# Builds .html versions of the source 324# html overwrites some stuff created by update-docs - hence this is done later. 325alldoc2: chk_loc 326 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 327 -${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} 328# 329# Makes links for all manual pages in $LOC/docs/manualpages/all 330allman: 331 @cd ${LOC}/docs/manualpages; rm -rf all ; mkdir all ; find * -type d -wholename all -prune -o -name index.html -prune -o -type f -name \*.html -exec ln -s -f ../{} all \; 332 333DOCSETDATE_PRUNE_LIST=-o -type f -wholename share/petsc/saws/linearsolveroptions.html -prune -o -type f -wholename tutorials/HandsOnExercise.html -prune -o -type f -wholename tutorials/TAOHandsOnExercise.html -prune 334 335# modify all generated html files and add in version number, date, canonical URL info. 336docsetdate: chk_petscdir 337 @echo "Updating generated html files with petsc version, date, canonical URL info";\ 338 version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 339 version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 340 version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 341 version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 342 if [ $${version_release} = 0 ]; then \ 343 petscversion=petsc-master; \ 344 export petscversion; \ 345 elif [ $${version_release} = 1 ]; then \ 346 petscversion=petsc-$${version_major}.$${version_minor}.$${version_subminor}; \ 347 export petscversion; \ 348 else \ 349 echo "Unknown PETSC_VERSION_RELEASE: $${version_release}"; \ 350 exit; \ 351 fi; \ 352 datestr=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1`; \ 353 export datestr; \ 354 gitver=`git describe --match "v*"`; \ 355 export gitver; \ 356 find * -type d -wholename src/docs/website \ 357 -prune -o -type d -wholename src/benchmarks/results \ 358 -prune -o -type d -wholename config/BuildSystem/docs/website \ 359 -prune -o -type d -wholename include/web \ 360 -prune -o -type d -wholename 'arch-*' \ 361 -prune -o -type d -wholename lib/petsc/bin/maint \ 362 -prune -o -type d -wholename externalpackages \ 363 -prune ${DOCSETDATE_PRUNE_LIST} -o -type f -name \*.html \ 364 -exec perl -pi -e 's^(<body.*>)^$$1\n <div id=\"version\" align=right><b>$$ENV{petscversion} $$ENV{datestr}</b></div>\n <div id="bugreport" align=right><a href="mailto:petsc-maint\@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: $$ENV{petscversion} $$ENV{gitver} {} "><small>Report Typos and Errors</small></a></div>^i' {} \; \ 365 -exec perl -pi -e 's^(<head>)^$$1 <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/{}" />^i' {} \; ; \ 366 echo "Done fixing version number, date, canonical URL info" 367 368alldocclean: deletemanualpages allcleanhtml 369 370# Deletes man pages (HTML version) 371deletemanualpages: chk_loc 372 -@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \ 373 find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\ 374 ${RM} ${LOC}/docs/exampleconcepts ;\ 375 ${RM} ${LOC}/docs/manconcepts ;\ 376 ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\ 377 ${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\ 378 fi 379 380allcleanhtml: 381 -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 382 383chk_concepts_dir: chk_loc 384 @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 385 echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 386 387########################################################### 388# targets to build distribution and update docs 389########################################################### 390 391# Creates ${HOME}/petsc.tar.gz [and petsc-lite.tar.gz] 392dist: 393 ${PETSC_DIR}/lib/petsc/bin/maint/builddist ${PETSC_DIR} master 394 395# This target works only if you can do 'ssh petsc@login.mcs.anl.gov' 396# also copy the file over to ftp site. 397web-snapshot: 398 @if [ ! -f "${HOME}/petsc-master.tar.gz" ]; then \ 399 echo "~/petsc-master.tar.gz missing! cannot update petsc-master snapshot on mcs-web-site"; \ 400 else \ 401 echo "updating petsc-master snapshot on mcs-web-site"; \ 402 tmpdir=`mktemp -d -t petsc-doc.XXXXXXXX`; \ 403 cd $${tmpdir}; tar -xzf ${HOME}/petsc-master.tar.gz; \ 404 /usr/bin/rsync -e ssh -az --delete $${tmpdir}/petsc-master/ \ 405 petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-master ;\ 406 /bin/cp -f /home/petsc/petsc-master.tar.gz /mcs/ftp/pub/petsc/petsc-master.tar.gz;\ 407 ${RM} -rf $${tmpdir} ;\ 408 fi 409 410# build the tarfile - and then update petsc-master snapshot on mcs-web-site 411update-web-snapshot: dist web-snapshot 412 413# This target updates website main pages 414update-web: 415 @cd ${PETSC_DIR}/src/docs; make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} bib2html; \ 416 /usr/bin/rsync -az -C --exclude=documentation/index.html \ 417 --exclude=documentation/installation.html --exclude=download/index.html \ 418 ${PETSC_DIR}/src/docs/website/ petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc 419 @cd ${PETSC_DIR}/docs; /usr/bin/rsync -az developers.pdf petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/developers/ 420 @cd ${PETSC_DIR}/src/docs/tex; /usr/bin/rsync -az petscapp.bib petsc.bib petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/publications 421 422########################################################### 423# 424# See script for details 425# 426gcov: 427 -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -run_gcov 428 429mergegcov: 430 -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -merge_gcov ${LOC} *.tar.gz 431 432######################## 433# 434# Create the include dependency graph (requires graphviz to be available) 435# 436includegraph: 437 -@${PETSC_DIR}/src/contrib/style/include-graph.sh includegraph.pdf 438 -@echo Include dependency graph written to includegraph.pdf 439 440# 441# ------------------------------------------------------------------------------- 442# 443# Some macros to check if the fortran interface is up-to-date. 444# 445countfortranfunctions: 446 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 447 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 448 sed "s/_$$//" | sort > /tmp/countfortranfunctions 449 450countcfunctions: 451 -@grep PETSC_EXTERN ${PETSC_DIR}/include/*.h | grep "(" | tr -s ' ' | \ 452 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 453 tr 'A-Z' 'a-z' | sort | uniq > /tmp/countcfunctions 454 455difffortranfunctions: countfortranfunctions countcfunctions 456 -@echo -------------- Functions missing in the fortran interface --------------------- 457 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 458 -@echo ----------------- Functions missing in the C interface ------------------------ 459 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 460 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 461 462checkbadfortranstubs: 463 -@echo "=========================================" 464 -@echo "Functions with MPI_Comm as an Argument" 465 -@echo "=========================================" 466 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 467 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 468 -@echo "=========================================" 469 -@echo "Functions with a String as an Argument" 470 -@echo "=========================================" 471 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 472 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 473 -@echo "=========================================" 474 -@echo "Functions with Pointers to PETSc Objects as Argument" 475 -@echo "=========================================" 476 -@cd ${PETSC_DIR}/src/fortran/auto; \ 477 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 478 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 479 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 480 for OBJ in $$_p_OBJ; do \ 481 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 482 cut -d'(' -f1 | cut -d' ' -f1,3; \ 483 done 484 485checkpackagetests: 486 -@echo "Missing package tests" 487 -@cat config/examples/*.py > configexamples; pushd config/BuildSystem/config/packages/; packages=`ls *.py | sed "s/\\.py//g"`;popd; for i in $${packages}; do j=`echo $${i} | tr '[:upper:]' '[:lower:]'`; printf $${j} ; egrep "(with-$${j}|download-$${j})" configexamples | grep -v "=0" | wc -l ; done 488 -@echo "Missing download package tests" 489 -@cat config/examples/*.py > configexamples; pushd config/BuildSystem/config/packages/; packages=`grep -l "download " *.py | sed "s/\\.py//g"`;popd; for i in $${packages}; do j=`echo $${i} | tr '[:upper:]' '[:lower:]'`; printf $${j} ; egrep "(download-$${j})" configexamples | grep -v "=0" | wc -l ; done 490 491# 492# Automatically generates PETSc exercises in html from the tutorial examples. 493# 494# The introduction for each section is obtained from docs/manualpages-cite/header_${MANSEC} may be edited 495# (used also in introductions to the manual pages) 496# 497# DO NOT EDIT the *.htm files generated since they will be automatically replaced. 498# 499# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 500# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 501# 502exercises: 503 -@echo "=========================================" 504 -@echo "Generating HTML tutorial exercises" 505 -@${RM} docs/pageform.txt 506 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 507 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 508 -@echo "access_format=short" >> docs/pageform.txt 509 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 510 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 511 -@echo "Generating HTML for individual directories" 512 -@echo "=========================================" 513 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 514 -@echo "Completed HTML for individual directories" 515 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 516 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 517 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 518 -@echo "=========================================" 519 520.PHONY: info info_h all deletelibs allclean update \ 521 alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \ 522 allhtml allcleanhtml countfortranfunctions \ 523 start_configure configure_petsc configure_clean matlabbin install 524