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# all: builds the c, fortran, and f90 libraries 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 +@if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \ 33 ${OMAKE_PRINTDIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-gnumake-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \ 34 elif [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \ 35 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-cmake-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log \ 36 | egrep -v '( --check-build-system |cmake -E | -o CMakeFiles/petsc[[:lower:]]*.dir/| -o lib/libpetsc|CMakeFiles/petsc[[:lower:]]*\.dir/(build|depend|requires)|-f CMakeFiles/Makefile2|Dependee .* is newer than depender |provides\.build. is up to date)'; \ 37 else \ 38 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-legacy-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log \ 39 | ${GREP} -v "has no symbols"; \ 40 fi 41 @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 42 +@if test -s ${PETSC_ARCH}/lib/petsc/conf/error.log; then \ 43 printf ${PETSC_TEXT_HILIGHT}"**************************ERROR*************************************\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \ 44 echo " Error during compile, check ${PETSC_ARCH}/lib/petsc/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \ 45 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;\ 46 printf "********************************************************************"${PETSC_TEXT_NORMAL}"\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\ 47 else \ 48 ${OMAKE} shared_install PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log ;\ 49 fi #solaris make likes to print the whole command that gave error. So split this up into the smallest chunk below 50 @echo "Finishing make run at `date +'%a, %d %b %Y %H:%M:%S %z'`" >> ${PETSC_ARCH}/lib/petsc/conf/make.log 51 @if test -s ${PETSC_ARCH}/lib/petsc/conf/error.log; then exit 1; fi 52 53all-gnumake: 54 @if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \ 55 ${OMAKE_PRINTDIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} PETSC_BUILD_USING_CMAKE="" all;\ 56 else printf ${PETSC_TEXT_HILIGHT}"Build not configured for GNUMAKE. Quiting"${PETSC_TEXT_NORMAL}"\n"; exit 1; fi 57 58all-cmake: 59 @if [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \ 60 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} MAKE_IS_GNUMAKE="" all;\ 61 else printf ${PETSC_TEXT_HILIGHT}"Build not configured for CMAKE. Quiting"${PETSC_TEXT_NORMAL}"\n"; exit 1; fi 62 63all-legacy: 64 @${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} PETSC_BUILD_USING_CMAKE="" MAKE_IS_GNUMAKE="" all 65 66all-gnumake-local: info gnumake matlabbin mpi4py-build petsc4py-build libmesh-build slepc-build mfem-build 67 68all-cmake-local: info cmakegen cmake matlabbin mpi4py-build petsc4py-build 69 70all-legacy-local: chklib_dir info deletelibs deletemods build matlabbin shared_nomesg mpi4py-build petsc4py-build 71 72# 73# Prints information about the system and version of PETSc being compiled 74# 75info: 76 -@echo "==========================================" 77 -@echo " " 78 -@echo "See documentation/faq.html and documentation/bugreporting.html" 79 -@echo "for help with installation problems. Please send EVERYTHING" 80 -@echo "printed out below when reporting problems. Please check the" 81 -@echo "mailing list archives and consider subscribing." 82 -@echo " " 83 -@echo " http://www.mcs.anl.gov/petsc/miscellaneous/mailing-lists.html" 84 -@echo " " 85 -@echo "==========================================" 86 -@echo Starting make run on `hostname` at `date +'%a, %d %b %Y %H:%M:%S %z'` 87 -@echo Machine characteristics: `uname -a` 88 -@echo "-----------------------------------------" 89 -@echo "Using PETSc directory: ${PETSC_DIR}" 90 -@echo "Using PETSc arch: ${PETSC_ARCH}" 91 -@echo "-----------------------------------------" 92 -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" 93 -@echo "-----------------------------------------" 94 -@echo "Using configure Options: ${CONFIGURE_OPTIONS}" 95 -@echo "Using configuration flags:" 96 -@grep "\#define " ${PETSCCONF_H} 97 -@echo "-----------------------------------------" 98 -@echo "Using C/C++ compile: ${PETSC_COMPILE}" 99 -@if [ "${PETSC_LANGUAGE}" = "CONLY" -a "${MPICC_SHOW}" != "" ]; then \ 100 printf "mpicc -show: %b\n" "${MPICC_SHOW}"; \ 101 elif [ "${PETSC_LANGUAGE}" = "CXXONLY" -a "${MPICXX_SHOW}" != "" ]; then \ 102 printf "mpicxx -show: %b\n" "${MPICXX_SHOW}"; \ 103 fi; 104 -@if [ "${FC}" != "" ]; then \ 105 echo "Using Fortran compile: ${PETSC_FCOMPILE}";\ 106 if [ "${MPIFC_SHOW}" != "" ]; then \ 107 printf "mpif90 -show: %b\n" "${MPIFC_SHOW}"; \ 108 fi; \ 109 fi 110 -@if [ "${CUDAC}" != "" ]; then \ 111 echo "Using CUDA compile: ${PETSC_CUCOMPILE}";\ 112 fi 113 -@echo "-----------------------------------------" 114 -@echo "Using C/C++ linker: ${PCC_LINKER}" 115 -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" 116 -@if [ "${FC}" != "" ]; then \ 117 echo "Using Fortran linker: ${FC_LINKER}";\ 118 echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ 119 fi 120 -@echo "-----------------------------------------" 121 -@echo "Using system modules: ${LOADEDMODULES}" 122 -@if [ "${MPI_IS_MPIUNI}" = "1" ]; then \ 123 echo Using mpi.h: mpiuni; \ 124 else \ 125 TESTDIR=`mktemp -q -d -t petscmpi-XXXXXXXX` && \ 126 echo '#include <mpi.h>' > $${TESTDIR}/mpitest.c && \ 127 BUF=`${CPP} ${PETSC_CCPPFLAGS} $${TESTDIR}/mpitest.c |grep 'mpi\.h' | ( head -1 ; cat > /dev/null )` && \ 128 echo Using mpi.h: $${BUF}; ${RM} -rf $${TESTDIR}; \ 129 fi 130 -@echo "-----------------------------------------" 131 -@echo "Using libraries: ${PETSC_LIB}" 132 -@echo "------------------------------------------" 133 -@echo "Using mpiexec: ${MPIEXEC}" 134 -@echo "------------------------------------------" 135 -@echo "Using MAKEFLAGS: -j$(MAKE_NP) -l$(MAKE_LOAD) $(MAKEFLAGS)" 136 -@echo "==========================================" 137 138# 139# Builds the PETSc libraries 140# This target also builds fortran77 and f90 interface 141# files and compiles .F files 142# 143build: 144 -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 145 -@echo "=========================================" 146 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 147 -@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} > tmpf 2>&1 ; ${GREP} -v "has no symbols" tmpf; ${RM} tmpf; 148 -@echo "Completed building libraries" 149 -@echo "=========================================" 150# 151# Build MatLab binaries 152# 153matlabbin: 154 -@if [ "${MATLAB_MEX}" != "" -a "${MATLAB_SOCKET}" != "" -a "${PETSC_SCALAR}" = "real" -a "${PETSC_PRECISION}" = "double" ]; then \ 155 echo "BEGINNING TO COMPILE MATLAB INTERFACE"; \ 156 if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc; fi; \ 157 if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab; fi; \ 158 cd src/sys/classes/viewer/impls/socket/matlab && ${OMAKE} matlabcodes PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR}; \ 159 echo "========================================="; \ 160 fi 161# 162# Builds PETSc test examples for a given architecture 163# 164test_install: test 165check: test 166test: 167 -+@${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 168testx: 169 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testx_build 2>&1 | tee ./${PETSC_ARCH}/lib/petsc/conf/testx.log 170test_build: 171 -@echo "Running test examples to verify correct installation" 172 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 173 +@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 174 +@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex19 175 +@if [ "${HYPRE_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 176 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; \ 177 fi; 178 +@if [ "${MUMPS_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 179 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; \ 180 fi; 181 +@if [ "${SUPERLU_DIST_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 182 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; \ 183 fi; 184 +@if ( [ "${ML_LIB}" != "" ] || [ "${TRILINOS_LIB}" != "" ] ) && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 185 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; \ 186 fi; 187 +@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ex19.rm 188 +@if [ "${PETSC4PY}" = "yes" ]; then \ 189 cd src/ksp/ksp/examples/tutorials >/dev/null; \ 190 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean; \ 191 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex100; \ 192 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean; \ 193 fi; 194 +@egrep "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ 195 if test -s .ftn.log; then \ 196 cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex5f; \ 197 fi; ${RM} .ftn.log; 198 +@cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 199 -@echo "Completed test examples" 200testx_build: 201 -@echo "Running graphics test example to verify correct X11 installation" 202 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 203 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 204 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testxex19 205 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 206 -@echo "Completed graphics test example" 207 208# Ranlib on the libraries 209ranlib: 210 ${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} 211 212# Deletes PETSc libraries 213deletelibs: 214 -${RM} -rf ${PETSC_LIB_DIR}/libpetsc*.* 215deletemods: 216 -${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod 217 218# Cleans up build 219allclean-legacy: deletelibs deletemods 220 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean-legacy tree 221allclean-cmake: 222 -@cd ${PETSC_ARCH} && ${OMAKE} clean 223allclean-gnumake: 224 -@${OMAKE} -f gmakefile clean 225 226allclean: 227 @if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \ 228 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-gnumake; \ 229 elif [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \ 230 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-cmake; \ 231 else \ 232 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-legacy; \ 233 fi 234 235clean:: allclean 236 237distclean: chk_petscdir 238 @if [ -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ]; then \ 239 echo "*** Preserving ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py in ${PETSC_DIR} ***"; \ 240 mv -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ${PETSC_DIR}/; fi 241 @echo "*** Deleting all build files in ${PETSC_DIR}/${PETSC_ARCH} ***" 242 -${RM} -rf ${PETSC_DIR}/${PETSC_ARCH}/ 243 244 245# 246reconfigure: 247 @unset MAKEFLAGS && ${PYTHON} ${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py 248# 249install: 250 @${PYTHON} ./config/install.py -destDir=${DESTDIR} 251 +${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} mpi4py-install petsc4py-install libmesh-install slepc-install mfem-install 252 253newall: 254 -@cd src/sys; @${PYTHON} ${PETSC_DIR}/config/builder.py 255 -@cd src/vec; @${PYTHON} ${PETSC_DIR}/config/builder.py 256 -@cd src/mat; @${PYTHON} ${PETSC_DIR}/config/builder.py 257 -@cd src/dm; @${PYTHON} ${PETSC_DIR}/config/builder.py 258 -@cd src/ksp; @${PYTHON} ${PETSC_DIR}/config/builder.py 259 -@cd src/snes; @${PYTHON} ${PETSC_DIR}/config/builder.py 260 -@cd src/ts; @${PYTHON} ${PETSC_DIR}/config/builder.py 261 262streams: 263 -@echo "running streams in src/benchmarks/streams" 264 +@cd src/benchmarks/streams; ${OMAKE} PATH="${PETSC_DIR}/${PETSC_ARCH}/lib:${PATH}" PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} streams 265 266stream: 267 -@echo "running stream in src/benchmarks/streams" 268 +@cd src/benchmarks/streams; ${OMAKE} PATH="${PETSC_DIR}/${PETSC_ARCH}/lib:${PATH}" PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} stream 269 270# ------------------------------------------------------------------ 271# 272# All remaining actions are intended for PETSc developers only. 273# PETSc users should not generally need to use these commands. 274# 275# See the users manual for how the tags files may be used from Emacs and Vi/Vim 276# 277alletags: 278 -@${PYTHON} lib/petsc/bin/maint/generateetags.py 279 -@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON 280 281# obtain gtags from http://www.gnu.org/s/global/ 282allgtags: 283 -@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 - 284 285allfortranstubs: 286 -@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir 287 @${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} 288 -@${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} 289 -@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir 290deletefortranstubs: 291 -@find . -type d -name ftn-auto | xargs rm -rf 292cmakegen: 293 -@${PYTHON} config/cmakegen.py 294# 295# These are here for the target allci and allco, and etags 296# 297 298BMAKEFILES = conf/variables conf/rules conf/test 299SCRIPTS = lib/petsc/bin/maint/builddist lib/petsc/bin/maint/wwwman lib/petsc/bin/maint/xclude lib/petsc/bin/maint/bugReport.py lib/petsc/bin/maint/buildconfigtest lib/petsc/bin/maint/builddistlite \ 300 lib/petsc/bin/maint/buildtest lib/petsc/bin/maint/checkBuilds.py lib/petsc/bin/maint/copylognightly lib/petsc/bin/maint/copylognightly.tao lib/petsc/bin/maint/countfiles lib/petsc/bin/maint/findbadfiles \ 301 lib/petsc/bin/maint/fixinclude lib/petsc/bin/maint/getexlist lib/petsc/bin/maint/getpdflabels.py lib/petsc/bin/maint/helpindex.py lib/petsc/bin/maint/hosts.local lib/petsc/bin/maint/hosts.solaris \ 302 lib/petsc/bin/maint/lex.py lib/petsc/bin/maint/mapnameslatex.py lib/petsc/bin/maint/startnightly lib/petsc/bin/maint/startnightly.tao lib/petsc/bin/maint/submitPatch.py \ 303 lib/petsc/bin/maint/update-docs.py lib/petsc/bin/maint/wwwindex.py lib/petsc/bin/maint/xcludebackup lib/petsc/bin/maint/xcludecblas lib/petsc/bin/maint/zap lib/petsc/bin/maint/zapall \ 304 config/PETSc/Configure.py config/PETSc/Options.py \ 305 config/PETSc/utilities/*.py 306 307 308# Builds all the documentation - should be done every night 309alldoc: allcite allpdf alldoc1 alldoc2 docsetdate 310 311# Build just citations 312allcite: chk_loc deletemanualpages 313 -${PYTHON} lib/petsc/bin/maint/countpetsccits.py 314 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 315 -@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap 316 -@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap 317 318# Build just PDF manuals + prerequisites 319allpdf: chk_loc allcite 320 -cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 321 -cd src/docs/tex/manual; ${OMAKE} developers.pdf LOC=${LOC} 322 -cd src/docs/tao_tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 323 324# Build just manual pages + prerequisites 325allmanpages: chk_loc allcite 326 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 327 328# Build just manual examples + prerequisites 329allmanexamples: chk_loc allmanpages 330 -${OMAKE} ACTION=manexamples tree_basic LOC=${LOC} 331 332# Build everything that goes into 'doc' dir except html sources 333alldoc1: chk_loc chk_concepts_dir allcite allmanpages allmanexamples 334 -${OMAKE} manimplementations LOC=${LOC} 335 -${PYTHON} lib/petsc/bin/maint/wwwindex.py ${PETSC_DIR} ${LOC} 336 -${OMAKE} manconcepts LOC=${LOC} 337 -${OMAKE} ACTION=getexlist tree_basic LOC=${LOC} 338 -${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC} 339 -${PYTHON} lib/petsc/bin/maint/helpindex.py ${PETSC_DIR} ${LOC} 340 341# Builds .html versions of the source 342# html overwrites some stuff created by update-docs - hence this is done later. 343alldoc2: chk_loc 344 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 345 -${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} 346# 347# Makes links for all manual pages in $LOC/docs/manualpages/all 348allman: 349 @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 \; 350 351DOCSETDATE_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 352 353# modify all generated html files and add in version number, date, canonical URL info. 354docsetdate: chk_petscdir 355 @echo "Updating generated html files with petsc version, date, canonical URL info";\ 356 version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 357 version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 358 version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 359 version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 360 if [ $${version_release} = 0 ]; then \ 361 petscversion=petsc-master; \ 362 export petscversion; \ 363 elif [ $${version_release} = 1 ]; then \ 364 petscversion=petsc-$${version_major}.$${version_minor}.$${version_subminor}; \ 365 export petscversion; \ 366 else \ 367 echo "Unknown PETSC_VERSION_RELEASE: $${version_release}"; \ 368 exit; \ 369 fi; \ 370 datestr=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1`; \ 371 export datestr; \ 372 gitver=`git describe --match "v*"`; \ 373 export gitver; \ 374 find * -type d -wholename src/docs/website -prune -o -type d -wholename src/benchmarks/results -prune -o \ 375 -type d -wholename config/BuildSystem/docs/website -prune -o -type d -wholename include/web -prune -o \ 376 -type d -wholename 'arch-*' -prune -o -type d -wholename src/tops -prune -o -type d -wholename externalpackages -prune ${DOCSETDATE_PRUNE_LIST} -o \ 377 -type f -name \*.html \ 378 -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' {} \; \ 379 -exec perl -pi -e 's^(<head>)^$$1 <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/{}" />^i' {} \; ; \ 380 echo "Done fixing version number, date, canonical URL info" 381 382alldocclean: deletemanualpages allcleanhtml 383 384# Deletes man pages (HTML version) 385deletemanualpages: chk_loc 386 -@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \ 387 find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\ 388 ${RM} ${LOC}/docs/exampleconcepts ;\ 389 ${RM} ${LOC}/docs/manconcepts ;\ 390 ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\ 391 ${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\ 392 fi 393 394allcleanhtml: 395 -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 396 397chk_concepts_dir: chk_loc 398 @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 399 echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 400 401########################################################### 402# targets to build distribution and update docs 403########################################################### 404 405# Creates ${HOME}/petsc.tar.gz [and petsc-lite.tar.gz] 406dist: 407 ${PETSC_DIR}/lib/petsc/bin/maint/builddist ${PETSC_DIR} master 408 409# This target works only if you can do 'ssh petsc@login.mcs.anl.gov' 410# also copy the file over to ftp site. 411web-snapshot: 412 @if [ ! -f "${HOME}/petsc-master.tar.gz" ]; then \ 413 echo "~/petsc-master.tar.gz missing! cannot update petsc-master snapshot on mcs-web-site"; \ 414 else \ 415 echo "updating petsc-master snapshot on mcs-web-site"; \ 416 tmpdir=`mktemp -d -t petsc-doc.XXXXXXXX`; \ 417 cd $${tmpdir}; tar -xzf ${HOME}/petsc-master.tar.gz; \ 418 /usr/bin/rsync -e ssh -az --delete $${tmpdir}/petsc-master/ \ 419 petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-master ;\ 420 /bin/cp -f /home/petsc/petsc-master.tar.gz /mcs/ftp/pub/petsc/petsc-master.tar.gz;\ 421 ${RM} -rf $${tmpdir} ;\ 422 fi 423 424# build the tarfile - and then update petsc-master snapshot on mcs-web-site 425update-web-snapshot: dist web-snapshot 426 427# This target updates website main pages 428update-web: 429 @cd ${PETSC_DIR}/src/docs; make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} bib2html; \ 430 /usr/bin/rsync -az -C --exclude=documentation/index.html \ 431 --exclude=documentation/installation.html --exclude=download/index.html \ 432 ${PETSC_DIR}/src/docs/website/ petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc 433 @cd ${PETSC_DIR}/docs; /usr/bin/rsync -az developers.pdf petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/developers/ 434 @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 435 436# 437# builds a single list of files for each PETSc library so they may all be built in parallel 438# without a recursive set of make calls 439createfastbuild: 440 cd src/vec; ${RM} -f files; /bin/echo -n "SOURCEC = " > files; make tree ACTION=sourcelist BASE_DIR=${PETSC_DIR}/src/vec 441 442########################################################### 443# 444# See script for details 445# 446gcov: 447 -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -run_gcov 448 449mergegcov: 450 -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -merge_gcov ${LOC} *.tar.gz 451 452######################## 453# 454# Create the include dependency graph (requires graphviz to be available) 455# 456includegraph: 457 -@${PETSC_DIR}/src/contrib/style/include-graph.sh includegraph.pdf 458 -@echo Include dependency graph written to includegraph.pdf 459 460# 461# ------------------------------------------------------------------------------- 462# 463# Some macros to check if the fortran interface is up-to-date. 464# 465countfortranfunctions: 466 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 467 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 468 sed "s/_$$//" | sort > /tmp/countfortranfunctions 469 470countcfunctions: 471 -@grep PETSC_EXTERN ${PETSC_DIR}/include/*.h | grep "(" | tr -s ' ' | \ 472 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 473 tr 'A-Z' 'a-z' | sort | uniq > /tmp/countcfunctions 474 475difffortranfunctions: countfortranfunctions countcfunctions 476 -@echo -------------- Functions missing in the fortran interface --------------------- 477 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 478 -@echo ----------------- Functions missing in the C interface ------------------------ 479 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 480 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 481 482checkbadfortranstubs: 483 -@echo "=========================================" 484 -@echo "Functions with MPI_Comm as an Argument" 485 -@echo "=========================================" 486 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 487 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 488 -@echo "=========================================" 489 -@echo "Functions with a String as an Argument" 490 -@echo "=========================================" 491 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 492 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 493 -@echo "=========================================" 494 -@echo "Functions with Pointers to PETSc Objects as Argument" 495 -@echo "=========================================" 496 -@cd ${PETSC_DIR}/src/fortran/auto; \ 497 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 498 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 499 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 500 for OBJ in $$_p_OBJ; do \ 501 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 502 cut -d'(' -f1 | cut -d' ' -f1,3; \ 503 done 504 505checkpackagetests: 506 -@echo "Missing package tests" 507 -@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 508 -@echo "Missing download package tests" 509 -@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 510 511# 512# Automatically generates PETSc exercises in html from the tutorial examples. 513# 514# The introduction for each section is obtained from docs/manualpages-cite/header_${MANSEC} may be edited 515# (used also in introductions to the manual pages) 516# 517# DO NOT EDIT the *.htm files generated since they will be automatically replaced. 518# 519# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 520# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 521# 522exercises: 523 -@echo "=========================================" 524 -@echo "Generating HTML tutorial exercises" 525 -@${RM} docs/pageform.txt 526 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 527 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 528 -@echo "access_format=short" >> docs/pageform.txt 529 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 530 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 531 -@echo "Generating HTML for individual directories" 532 -@echo "=========================================" 533 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 534 -@echo "Completed HTML for individual directories" 535 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 536 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 537 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 538 -@echo "=========================================" 539 540.PHONY: info info_h all build ranlib deletelibs allclean update \ 541 alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \ 542 allhtml allcleanhtml allci allco allrcslabel countfortranfunctions \ 543 start_configure configure_petsc configure_clean matlabbin install 544 545petscao : petscmat petscao.f90.h 546petscdm : petscksp petscdm.f90.h 547petscdraw : petsc petscdraw.f90.h 548petscis : petsc petscis.f90.h 549petscksp : petscpc petscksp.f90.h 550petsclog : petsc petsclog.f90.h 551petscmat : petscvec petscmat.f90.h 552petscmg : petscksp petscmg.f90.h 553petscpc : petscmat petscpc.f90.h 554petscsnes : petscksp petscsnes.f90.h 555petscsys : petsc petscsys.f90.h 556petscts : petscsnes petscts.f90.h 557petsc : petsc.f90.h 558petscvec : petscis petscvec.f90.h 559petscviewer : petsc petscviewer.f90.h 560petscmesh : petsc petscmesh.f90.h 561modules : petscao petscdm petscdraw petscis petscksp petsclog petscmat petscmg petscpc petscsnes petscsys petscts petsc petscvec petscviewer petscmesh 562