1753a1a87SJed Brown# 2753a1a87SJed Brown# This is the makefile for compiling PETSc. See 3753a1a87SJed Brown# http://www.mcs.anl.gov/petsc/documentation/installation.html for directions on installing PETSc. 4753a1a87SJed Brown# See also conf for additional commands. 5753a1a87SJed Brown# 6753a1a87SJed BrownALL: all 7753a1a87SJed BrownLOCDIR = ./ 8e5c64ceaSJed BrownDIRS = src include tutorials interfaces 9753a1a87SJed BrownCFLAGS = 10753a1a87SJed BrownFFLAGS = 11d4f3a1abSSatish BalayCPPFLAGS = 12d4f3a1abSSatish BalayFPPFLAGS = 13753a1a87SJed Brown 14753a1a87SJed Brown# next line defines PETSC_DIR and PETSC_ARCH if they are not set 15af0996ceSBarry Smithinclude ././${PETSC_ARCH}/lib/petsc/conf/petscvariables 16af0996ceSBarry Smithinclude ${PETSC_DIR}/lib/petsc/conf/variables 17af0996ceSBarry Smithinclude ${PETSC_DIR}/lib/petsc/conf/rules 18af0996ceSBarry Smithinclude ${PETSC_DIR}/lib/petsc/conf/test 19753a1a87SJed Brown 20fa2665b1SJed Brown# This makefile contains a lot of PHONY targets with improperly specified prerequisites 21fa2665b1SJed Brown# where correct execution instead depends on the targets being processed in the correct 22fa2665b1SJed Brown# order. This is gross, but this makefile doesn't really do any work. Sub-makes still 23fa2665b1SJed Brown# benefit from parallelism. 24fa2665b1SJed Brown.NOTPARALLEL: 25fa2665b1SJed Brown 26753a1a87SJed Brown# 27753a1a87SJed Brown# Basic targets to build PETSc libraries. 28753a1a87SJed Brown# all: builds the c, fortran, and f90 libraries 29dd8585cdSJed Brownall: 30dd8585cdSJed Brown +@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} chk_petscdir chk_upgrade | tee ${PETSC_ARCH}/lib/petsc/conf/make.log 31af0996ceSBarry Smith @ln -sf ${PETSC_ARCH}/lib/petsc/conf/make.log make.log 32dd8585cdSJed Brown +@if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \ 33af0996ceSBarry Smith ${OMAKE_PRINTDIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-gnumake-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \ 349481793eSSatish Balay elif [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \ 35af0996ceSBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-cmake-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log \ 36753a1a87SJed Brown | 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)'; \ 37753a1a87SJed Brown else \ 38af0996ceSBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-legacy-local 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log \ 39753a1a87SJed Brown | ${GREP} -v "has no symbols"; \ 40753a1a87SJed Brown fi 41af0996ceSBarry Smith @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 42dd8585cdSJed Brown +@if test -s ${PETSC_ARCH}/lib/petsc/conf/error.log; then \ 43af0996ceSBarry Smith printf ${PETSC_TEXT_HILIGHT}"**************************ERROR*************************************\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \ 44af0996ceSBarry Smith echo " Error during compile, check ${PETSC_ARCH}/lib/petsc/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log; \ 45af0996ceSBarry Smith 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;\ 46af0996ceSBarry Smith printf "********************************************************************"${PETSC_TEXT_NORMAL}"\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\ 47753a1a87SJed Brown else \ 48af0996ceSBarry Smith ${OMAKE} shared_install PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log ;\ 49753a1a87SJed Brown fi #solaris make likes to print the whole command that gave error. So split this up into the smallest chunk below 50af0996ceSBarry Smith @echo "Finishing at: `date`" >> ${PETSC_ARCH}/lib/petsc/conf/make.log 51af0996ceSBarry Smith @if test -s ${PETSC_ARCH}/lib/petsc/conf/error.log; then exit 1; fi 52753a1a87SJed Brown 539481793eSSatish Balayall-gnumake: 54ac1d0f13SJed Brown @if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \ 55227c2ee5SSatish Balay ${OMAKE_PRINTDIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} PETSC_BUILD_USING_CMAKE="" all;\ 569481793eSSatish Balay else printf ${PETSC_TEXT_HILIGHT}"Build not configured for GNUMAKE. Quiting"${PETSC_TEXT_NORMAL}"\n"; exit 1; fi 579481793eSSatish Balay 584252f254SSatish Balayall-cmake: 594252f254SSatish Balay @if [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \ 60ac1d0f13SJed Brown ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} MAKE_IS_GNUMAKE="" all;\ 615484e79dSBarry Smith else printf ${PETSC_TEXT_HILIGHT}"Build not configured for CMAKE. Quiting"${PETSC_TEXT_NORMAL}"\n"; exit 1; fi 62753a1a87SJed Brown 634252f254SSatish Balayall-legacy: 64ac1d0f13SJed Brown @${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} PETSC_BUILD_USING_CMAKE="" MAKE_IS_GNUMAKE="" all 659481793eSSatish Balay 66dd8585cdSJed Brownall-gnumake-local: info gnumake matlabbin mpi4py-build petsc4py-build libmesh-build slepc-build 674252f254SSatish Balay 68dd8585cdSJed Brownall-cmake-local: info cmakegen cmake matlabbin mpi4py-build petsc4py-build 694252f254SSatish Balay 70dd8585cdSJed Brownall-legacy-local: chklib_dir info deletelibs deletemods build matlabbin shared_nomesg mpi4py-build petsc4py-build 71fa2665b1SJed Brown 72753a1a87SJed Brown# 73753a1a87SJed Brown# Prints information about the system and version of PETSc being compiled 74753a1a87SJed Brown# 75dd8585cdSJed Browninfo: 76753a1a87SJed Brown -@echo "==========================================" 77753a1a87SJed Brown -@echo " " 78753a1a87SJed Brown -@echo "See documentation/faq.html and documentation/bugreporting.html" 79753a1a87SJed Brown -@echo "for help with installation problems. Please send EVERYTHING" 80bc10b077SJed Brown -@echo "printed out below when reporting problems. Please check the" 81bc10b077SJed Brown -@echo "mailing list archives and consider subscribing." 82753a1a87SJed Brown -@echo " " 83bc10b077SJed Brown -@echo " http://www.mcs.anl.gov/petsc/miscellaneous/mailing-lists.html" 84753a1a87SJed Brown -@echo " " 85753a1a87SJed Brown -@echo "==========================================" 8644d0de36SSatish Balay -@echo Starting on `hostname` at `date` 87753a1a87SJed Brown -@echo Machine characteristics: `uname -a` 88753a1a87SJed Brown -@echo "-----------------------------------------" 89753a1a87SJed Brown -@echo "Using PETSc directory: ${PETSC_DIR}" 90753a1a87SJed Brown -@echo "Using PETSc arch: ${PETSC_ARCH}" 91753a1a87SJed Brown -@echo "-----------------------------------------" 92753a1a87SJed Brown -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" 93753a1a87SJed Brown -@echo "-----------------------------------------" 94753a1a87SJed Brown -@echo "Using configure Options: ${CONFIGURE_OPTIONS}" 95753a1a87SJed Brown -@echo "Using configuration flags:" 967cab4194SSatish Balay -@grep "\#define " ${PETSCCONF_H} 97753a1a87SJed Brown -@echo "-----------------------------------------" 98da0b7683SSatish Balay -@echo "Using C/C++ compile: ${PETSC_COMPILE}" 99607e78e0SSatish Balay -@if [ "${PETSC_LANGUAGE}" = "CONLY" -a "${MPICC_SHOW}" != "" ]; then \ 100fd0cdb26SSatish Balay printf "mpicc -show: %b\n" "${MPICC_SHOW}"; \ 101607e78e0SSatish Balay elif [ "${PETSC_LANGUAGE}" = "CXXONLY" -a "${MPICXX_SHOW}" != "" ]; then \ 102fd0cdb26SSatish Balay printf "mpicxx -show: %b\n" "${MPICXX_SHOW}"; \ 103607e78e0SSatish Balay fi; 104753a1a87SJed Brown -@if [ "${FC}" != "" ]; then \ 105da0b7683SSatish Balay echo "Using Fortran compile: ${PETSC_FCOMPILE}";\ 106607e78e0SSatish Balay if [ "${MPIFC_SHOW}" != "" ]; then \ 107fd0cdb26SSatish Balay printf "mpif90 -show: %b\n" "${MPIFC_SHOW}"; \ 108607e78e0SSatish Balay fi; \ 109da0b7683SSatish Balay fi 110da0b7683SSatish Balay -@if [ "${CUDAC}" != "" ]; then \ 111da0b7683SSatish Balay echo "Using CUDA compile: ${PETSC_CUCOMPILE}";\ 112753a1a87SJed Brown fi 113753a1a87SJed Brown -@echo "-----------------------------------------" 114753a1a87SJed Brown -@echo "Using C/C++ linker: ${PCC_LINKER}" 115753a1a87SJed Brown -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" 116753a1a87SJed Brown -@if [ "${FC}" != "" ]; then \ 117753a1a87SJed Brown echo "Using Fortran linker: ${FC_LINKER}";\ 118753a1a87SJed Brown echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ 119753a1a87SJed Brown fi 120753a1a87SJed Brown -@echo "-----------------------------------------" 1211d2d58a3SSatish Balay -@echo "Using system modules: ${LOADEDMODULES}" 122*42a47be2SSatish Balay -@TESTDIR=`mktemp -q -d -t petscmpi-XXXXXXXX` && \ 123*42a47be2SSatish Balay echo '#include <mpi.h>' > $${TESTDIR}/mpitest.c && \ 124*42a47be2SSatish Balay BUF=`${CPP} ${PETSC_CCPPFLAGS} $${TESTDIR}/mpitest.c |grep 'mpi\.h' | ( head -1 ; cat > /dev/null )` && \ 125*42a47be2SSatish Balay echo Using mpi.h: $${BUF}; ${RM} -rf $${TESTDIR} 1261d2d58a3SSatish Balay -@echo "-----------------------------------------" 127753a1a87SJed Brown -@echo "Using libraries: ${PETSC_LIB}" 128753a1a87SJed Brown -@echo "------------------------------------------" 129753a1a87SJed Brown -@echo "Using mpiexec: ${MPIEXEC}" 1304e2e1449SJed Brown -@echo "------------------------------------------" 1314e2e1449SJed Brown -@echo "Using MAKEFLAGS: -j$(MAKE_NP) $(MAKEFLAGS)" 132753a1a87SJed Brown -@echo "==========================================" 133753a1a87SJed Brown 134753a1a87SJed Brown# 135753a1a87SJed Brown# Builds the PETSc libraries 136753a1a87SJed Brown# This target also builds fortran77 and f90 interface 137753a1a87SJed Brown# files and compiles .F files 138753a1a87SJed Brown# 139dd8585cdSJed Brownbuild: 140753a1a87SJed Brown -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 141753a1a87SJed Brown -@echo "=========================================" 142753a1a87SJed Brown -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 143753a1a87SJed Brown -@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} > tmpf 2>&1 ; ${GREP} -v "has no symbols" tmpf; ${RM} tmpf; 144753a1a87SJed Brown -@echo "Completed building libraries" 145753a1a87SJed Brown -@echo "=========================================" 146753a1a87SJed Brown# 147d2b3add8SSatish Balay# Build MatLab binaries 148d2b3add8SSatish Balay# 149d2b3add8SSatish Balaymatlabbin: 15026e98103SSatish Balay -@if [ "${MATLAB_MEX}" != "" -a "${PETSC_SCALAR}" = "real" -a "${PETSC_PRECISION}" = "double" ]; then \ 151d2b3add8SSatish Balay echo "BEGINNING TO COMPILE MATLAB INTERFACE"; \ 152d2b3add8SSatish Balay if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc; fi; \ 153d2b3add8SSatish Balay if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab; fi; \ 154d2b3add8SSatish Balay cd src/sys/classes/viewer/impls/socket/matlab && ${OMAKE} matlabcodes PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR}; \ 155d2b3add8SSatish Balay echo "========================================="; \ 156d2b3add8SSatish Balay fi 157753a1a87SJed Brown# 158753a1a87SJed Brown# Builds PETSc test examples for a given architecture 159753a1a87SJed Brown# 1603cfc63a1SBarry Smithtest_install: test 16156879a31SBarry Smithcheck: test 162753a1a87SJed Browntest: 163de3d9997SSatish Balay -@${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 1645f6f18d4SSatish Balay -@if [ "${PETSC_WITH_BATCH}" = "" ]; then \ 1655f6f18d4SSatish Balay printf "=========================================\n"; \ 1665f6f18d4SSatish Balay printf "Now to evaluate the computer systems you plan use - do:\n"; \ 167dc32dc79SSatish Balay printf "make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} streams\n"; \ 1685f6f18d4SSatish Balay fi 169753a1a87SJed Browntestx: 170af0996ceSBarry Smith -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testx_build 2>&1 | tee ./${PETSC_ARCH}/lib/petsc/conf/testx.log 171753a1a87SJed Browntest_build: 172753a1a87SJed Brown -@echo "Running test examples to verify correct installation" 173753a1a87SJed Brown -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 174227c2ee5SSatish Balay @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 175227c2ee5SSatish Balay @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex19 176e5d08945SBarry Smith @if [ "${HYPRE_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 177c3a89c15SBarry Smith 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; \ 178e5d08945SBarry Smith fi; 179e5d08945SBarry Smith @if [ "${MUMPS_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 180c3a89c15SBarry Smith 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; \ 181e5d08945SBarry Smith fi; 182e5d08945SBarry Smith @if [ "${SUPERLU_DIST_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 183c3a89c15SBarry Smith 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; \ 184e5d08945SBarry Smith fi; 185e5d08945SBarry Smith @if ( [ "${ML_LIB}" != "" ] || [ "${TRILINOS_LIB}" != "" ] ) && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 186c3a89c15SBarry Smith 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; \ 187e5d08945SBarry Smith fi; 188e5d08945SBarry Smith @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ex19.rm 1895061939cSBarry Smith @if [ "${PETSC4PY}" = "yes" ]; then \ 1909c049d36SBarry Smith cd src/ksp/ksp/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex100; \ 1915061939cSBarry Smith fi; 1927cab4194SSatish Balay @egrep "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ 193cb297985SSatish Balay if test -s .ftn.log; then \ 194cb297985SSatish Balay cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex5f; \ 195cb297985SSatish Balay fi; ${RM} .ftn.log; 196227c2ee5SSatish Balay @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 197753a1a87SJed Brown -@echo "Completed test examples" 198753a1a87SJed Browntestx_build: 199753a1a87SJed Brown -@echo "Running graphics test example to verify correct X11 installation" 200753a1a87SJed Brown -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 201227c2ee5SSatish Balay @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 202227c2ee5SSatish Balay @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testxex19 203227c2ee5SSatish Balay @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 204753a1a87SJed Brown -@echo "Completed graphics test example" 205753a1a87SJed Brown 206753a1a87SJed Browntestexamples: info 207753a1a87SJed Brown -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 208753a1a87SJed Brown -@echo "Due to different numerical round-off on certain" 209753a1a87SJed Brown -@echo "machines some of the numbers may not match exactly." 210753a1a87SJed Brown -@echo "=========================================" 211753a1a87SJed Brown -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C tree 212753a1a87SJed Brown -@echo "Completed compiling and running test examples" 213753a1a87SJed Brown -@echo "=========================================" 214753a1a87SJed Browntestfortran: info 215753a1a87SJed Brown -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 216753a1a87SJed Brown -@echo "=========================================" 217753a1a87SJed Brown -@echo "Due to different numerical round-off on certain" 218753a1a87SJed Brown -@echo "machines or the way Fortran formats numbers" 219753a1a87SJed Brown -@echo "some of the results may not match exactly." 220753a1a87SJed Brown -@echo "=========================================" 221753a1a87SJed Brown -@if [ "${FC}" != "" ]; then \ 222753a1a87SJed Brown ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran tree; \ 223753a1a87SJed Brown echo "Completed compiling and running Fortran test examples"; \ 224753a1a87SJed Brown else \ 225753a1a87SJed Brown echo "Error: No FORTRAN compiler available"; \ 226753a1a87SJed Brown fi 227753a1a87SJed Brown -@echo "=========================================" 228753a1a87SJed Browntestexamples_uni: info 229753a1a87SJed Brown -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 230753a1a87SJed Brown -@echo "Due to different numerical round-off on certain" 231753a1a87SJed Brown -@echo "machines some of the numbers may not match exactly." 232753a1a87SJed Brown -@echo "=========================================" 233753a1a87SJed Brown -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C_X_MPIUni tree 234753a1a87SJed Brown -@echo "Completed compiling and running uniprocessor test examples" 235753a1a87SJed Brown -@echo "=========================================" 236753a1a87SJed Browntestfortran_uni: info 237753a1a87SJed Brown -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES" 238753a1a87SJed Brown -@echo "Due to different numerical round-off on certain" 239753a1a87SJed Brown -@echo "machines some of the numbers may not match exactly." 240753a1a87SJed Brown -@echo "=========================================" 241753a1a87SJed Brown -@if [ "${FC}" != "" ]; then \ 242753a1a87SJed Brown ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni tree; \ 243753a1a87SJed Brown echo "Completed compiling and running uniprocessor fortran test examples"; \ 244753a1a87SJed Brown else \ 245753a1a87SJed Brown echo "Error: No FORTRAN compiler available"; \ 246753a1a87SJed Brown fi 247753a1a87SJed Brown -@ 248753a1a87SJed Brown -@echo "=========================================" 249753a1a87SJed Brown 250753a1a87SJed Brown# Ranlib on the libraries 251753a1a87SJed Brownranlib: 252753a1a87SJed Brown ${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} 253753a1a87SJed Brown 254753a1a87SJed Brown# Deletes PETSc libraries 255dd8585cdSJed Browndeletelibs: 256753a1a87SJed Brown -${RM} -rf ${PETSC_LIB_DIR}/libpetsc*.* 257dd8585cdSJed Browndeletemods: 258753a1a87SJed Brown -${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod 259753a1a87SJed Brown 260753a1a87SJed Brown# Cleans up build 26158080eacSSatish Balayallclean-legacy: deletelibs deletemods 26259d63732SSatish Balay -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean-legacy tree 26358080eacSSatish Balayallclean-cmake: 26458080eacSSatish Balay -@cd ${PETSC_ARCH} && ${OMAKE} clean 26558080eacSSatish Balayallclean-gnumake: 26658080eacSSatish Balay -@${OMAKE} -f gmakefile clean 26758080eacSSatish Balay 26858080eacSSatish Balayallclean: 26958080eacSSatish Balay @if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \ 27058080eacSSatish Balay ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-gnumake; \ 27158080eacSSatish Balay elif [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \ 27258080eacSSatish Balay ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-cmake; \ 27358080eacSSatish Balay else \ 27458080eacSSatish Balay ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-legacy; \ 27558080eacSSatish Balay fi 27659d63732SSatish Balay 27759d63732SSatish Balayclean:: allclean 27859d63732SSatish Balay 27959d63732SSatish Balaydistclean: chk_petscdir 280af0996ceSBarry Smith @if [ -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ]; then \ 281af0996ceSBarry Smith echo "*** Preserving ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py in ${PETSC_DIR} ***"; \ 282af0996ceSBarry Smith mv -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ${PETSC_DIR}/; fi 28359d63732SSatish Balay @echo "*** Deleting all build files in ${PETSC_DIR}/${PETSC_ARCH} ***" 28459d63732SSatish Balay -${RM} -rf ${PETSC_DIR}/${PETSC_ARCH}/ 28559d63732SSatish Balay 28659d63732SSatish Balay 287753a1a87SJed Brown# 288753a1a87SJed Brownreconfigure: 289af0996ceSBarry Smith @${PYTHON} ${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py 290753a1a87SJed Brown# 291753a1a87SJed Browninstall: 2920ee81e68SLisandro Dalcin @${PYTHON} ./config/install.py -destDir=${DESTDIR} 29350a4861cSBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} mpi4py-install petsc4py-install libmesh-install slepc-install 294753a1a87SJed Brown 295753a1a87SJed Brownnewall: 296753a1a87SJed Brown -@cd src/sys; @${PYTHON} ${PETSC_DIR}/config/builder.py 297753a1a87SJed Brown -@cd src/vec; @${PYTHON} ${PETSC_DIR}/config/builder.py 298753a1a87SJed Brown -@cd src/mat; @${PYTHON} ${PETSC_DIR}/config/builder.py 299753a1a87SJed Brown -@cd src/dm; @${PYTHON} ${PETSC_DIR}/config/builder.py 300753a1a87SJed Brown -@cd src/ksp; @${PYTHON} ${PETSC_DIR}/config/builder.py 301753a1a87SJed Brown -@cd src/snes; @${PYTHON} ${PETSC_DIR}/config/builder.py 302753a1a87SJed Brown -@cd src/ts; @${PYTHON} ${PETSC_DIR}/config/builder.py 303753a1a87SJed Brown 304753a1a87SJed Brownstreams: 305bfc31b0fSJed Brown cd src/benchmarks/streams; ${OMAKE} PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} streams 3065fabf859SBarry Smith 3075fabf859SBarry Smithstream: 308bfc31b0fSJed Brown cd src/benchmarks/streams; ${OMAKE} PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} stream 309753a1a87SJed Brown# ------------------------------------------------------------------ 310753a1a87SJed Brown# 311753a1a87SJed Brown# All remaining actions are intended for PETSc developers only. 312753a1a87SJed Brown# PETSc users should not generally need to use these commands. 313753a1a87SJed Brown# 314753a1a87SJed Brown# See the users manual for how the tags files may be used from Emacs and Vi/Vim 315753a1a87SJed Brown# 316753a1a87SJed Brownalletags: 317c3a89c15SBarry Smith -@${PYTHON} lib/petsc/bin/maint/generateetags.py 318753a1a87SJed Brown -@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON 319753a1a87SJed Brown 320762ef373SBarry Smith# obtain gtags from http://www.gnu.org/s/global/ 321762ef373SBarry Smithallgtags: 322a4ae4b6dSToby Isaac -@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 - 323762ef373SBarry Smith 324753a1a87SJed Brownallfortranstubs: 3251b266c99SBarry Smith -@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir 326c3a89c15SBarry Smith @${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} 327c3a89c15SBarry Smith -@${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} 328a318115bSBarry Smith -@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir 329753a1a87SJed Browndeletefortranstubs: 330753a1a87SJed Brown -@find . -type d -name ftn-auto | xargs rm -rf 331753a1a87SJed Browncmakegen: 332753a1a87SJed Brown -@${PYTHON} config/cmakegen.py 333753a1a87SJed Brown# 334753a1a87SJed Brown# These are here for the target allci and allco, and etags 335753a1a87SJed Brown# 336753a1a87SJed Brown 337bcaeba4dSBarry SmithBMAKEFILES = conf/variables conf/rules conf/test 338c3a89c15SBarry SmithSCRIPTS = 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 \ 339c3a89c15SBarry Smith 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 \ 340c3a89c15SBarry Smith 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 \ 341c3a89c15SBarry Smith 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 \ 342c3a89c15SBarry Smith 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 \ 343753a1a87SJed Brown config/PETSc/Configure.py config/PETSc/Options.py \ 34406e08bc7SBarry Smith config/PETSc/utilities/*.py 345753a1a87SJed Brown 346753a1a87SJed Brown 347753a1a87SJed Brown# Builds all the documentation - should be done every night 348f4da3331SVáclav Haplaalldoc: allcite allpdf alldoc1 alldoc2 alldoc3 docsetdate 349753a1a87SJed Brown 350f4da3331SVáclav Hapla# Build just citations 351f4da3331SVáclav Haplaallcite: chk_loc deletemanualpages 352c3a89c15SBarry Smith -${PYTHON} lib/petsc/bin/maint/countpetsccits.py 353753a1a87SJed Brown -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 354753a1a87SJed Brown -@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap 355753a1a87SJed Brown -@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap 356f4da3331SVáclav Hapla 357f4da3331SVáclav Hapla# Build just PDF manuals + prerequisites 358f4da3331SVáclav Haplaallpdf: chk_loc allcite 359753a1a87SJed Brown -cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 360753a1a87SJed Brown -cd src/docs/tex/manual; ${OMAKE} developers.pdf LOC=${LOC} 361f5b986e4SVáclav Hapla -cd src/docs/tao_tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 362f4da3331SVáclav Hapla 363f4da3331SVáclav Hapla# Build just manual pages + prerequisites 364f4da3331SVáclav Haplaallmanpages: chk_loc allcite 365753a1a87SJed Brown -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 366f4da3331SVáclav Hapla 367f4da3331SVáclav Hapla# Build just manual examples + prerequisites 368f4da3331SVáclav Haplaallmanexamples: chk_loc allmanpages 369753a1a87SJed Brown -${OMAKE} ACTION=manexamples tree_basic LOC=${LOC} 370f4da3331SVáclav Hapla 371f4da3331SVáclav Hapla# Build everything that goes into 'doc' dir except html sources 372f4da3331SVáclav Haplaalldoc1: chk_loc chk_concepts_dir allcite allmanpages allmanexamples 37321fcc2ddSBarry Smith -${OMAKE} manimplementations LOC=${LOC} 374c3a89c15SBarry Smith -${PYTHON} lib/petsc/bin/maint/wwwindex.py ${PETSC_DIR} ${LOC} 375753a1a87SJed Brown -${OMAKE} manconcepts LOC=${LOC} 376753a1a87SJed Brown -${OMAKE} ACTION=getexlist tree_basic LOC=${LOC} 377753a1a87SJed Brown -${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC} 378c3a89c15SBarry Smith -${PYTHON} lib/petsc/bin/maint/helpindex.py ${PETSC_DIR} ${LOC} 379753a1a87SJed Brown 380753a1a87SJed Brown# Builds .html versions of the source 381753a1a87SJed Brown# html overwrites some stuff created by update-docs - hence this is done later. 382753a1a87SJed Brownalldoc2: chk_loc 3837070facaSSatish Balay -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 384c3a89c15SBarry Smith -${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} 385753a1a87SJed Brown# 386753a1a87SJed Brown# Builds HTML versions of Matlab scripts 387753a1a87SJed Brownalldoc3: chk_loc 388753a1a87SJed Brown if [ "${MATLAB_COMMAND}" != "" ]; then\ 389502b79f1SSatish Balay export MATLABPATH=${MATLABPATH}:${PETSC_DIR}/share/petsc/matlab; \ 390502b79f1SSatish Balay cd ${PETSC_DIR}/share/petsc/matlab; ${MATLAB_COMMAND} -nodisplay -nodesktop -r "generatehtml;exit" ; \ 391753a1a87SJed Brown fi 392753a1a87SJed Brown 393d9dc08c3SBarry Smith# 394d9dc08c3SBarry Smith# Makes links for all manual pages in $LOC/docs/manualpages/all 395d9dc08c3SBarry Smithallman: 396d9dc08c3SBarry Smith @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 \; 397d9dc08c3SBarry Smith 398de86d973SSatish BalayDOCSETDATE_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 399f304b780SSatish Balay 400753a1a87SJed Brown# modify all generated html files and add in version number, date, canonical URL info. 401ad5c76d5SBarry Smithdocsetdate: chk_petscdir 402753a1a87SJed Brown @echo "Updating generated html files with petsc version, date, canonical URL info";\ 403753a1a87SJed Brown version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 404753a1a87SJed Brown version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 405753a1a87SJed Brown version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 406e4643290SSatish Balay version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 407753a1a87SJed Brown if [ $${version_release} = 0 ]; then \ 408cc5a9e26SSatish Balay petscversion=petsc-master; \ 409753a1a87SJed Brown export petscversion; \ 410753a1a87SJed Brown elif [ $${version_release} = 1 ]; then \ 411e4643290SSatish Balay petscversion=petsc-$${version_major}.$${version_minor}.$${version_subminor}; \ 412753a1a87SJed Brown export petscversion; \ 413753a1a87SJed Brown else \ 414753a1a87SJed Brown echo "Unknown PETSC_VERSION_RELEASE: $${version_release}"; \ 415753a1a87SJed Brown exit; \ 416753a1a87SJed Brown fi; \ 4179c5cad75SSatish Balay datestr=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1`; \ 418753a1a87SJed Brown export datestr; \ 4192c3da995SSatish Balay gitver=`git describe --match "v*"`; \ 4203408a366SSatish Balay export gitver; \ 421753a1a87SJed Brown find * -type d -wholename src/docs/website -prune -o -type d -wholename src/benchmarks/results -prune -o \ 422e6b20741SSatish Balay -type d -wholename config/BuildSystem/docs/website -prune -o -type d -wholename include/web -prune -o \ 423f304b780SSatish Balay -type d -wholename 'arch-*' -prune -o -type d -wholename src/tops -prune -o -type d -wholename externalpackages -prune ${DOCSETDATE_PRUNE_LIST} -o \ 424536d436eSSatish Balay -type f -name \*.html \ 4253408a366SSatish Balay -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' {} \; \ 426753a1a87SJed Brown -exec perl -pi -e 's^(<head>)^$$1 <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/{}" />^i' {} \; ; \ 427753a1a87SJed Brown echo "Done fixing version number, date, canonical URL info" 428753a1a87SJed Brown 429753a1a87SJed Brownalldocclean: deletemanualpages allcleanhtml 430753a1a87SJed Brown 431753a1a87SJed Brown# Deletes man pages (HTML version) 432753a1a87SJed Browndeletemanualpages: chk_loc 433753a1a87SJed Brown -@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \ 434753a1a87SJed Brown find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\ 435753a1a87SJed Brown ${RM} ${LOC}/docs/exampleconcepts ;\ 436753a1a87SJed Brown ${RM} ${LOC}/docs/manconcepts ;\ 437753a1a87SJed Brown ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\ 438c3a89c15SBarry Smith ${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\ 439753a1a87SJed Brown fi 440753a1a87SJed Brown 441753a1a87SJed Brownallcleanhtml: 442753a1a87SJed Brown -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 443753a1a87SJed Brown 444753a1a87SJed Brownchk_concepts_dir: chk_loc 445753a1a87SJed Brown @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 446753a1a87SJed Brown echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 447753a1a87SJed Brown 448753a1a87SJed Brown########################################################### 449753a1a87SJed Brown# targets to build distribution and update docs 450753a1a87SJed Brown########################################################### 451753a1a87SJed Brown 452753a1a87SJed Brown# Creates ${HOME}/petsc.tar.gz [and petsc-lite.tar.gz] 453753a1a87SJed Browndist: 454c3a89c15SBarry Smith ${PETSC_DIR}/lib/petsc/bin/maint/builddist ${PETSC_DIR} master 455753a1a87SJed Brown 456753a1a87SJed Brown# This target works only if you can do 'ssh petsc@login.mcs.anl.gov' 457753a1a87SJed Brown# also copy the file over to ftp site. 458753a1a87SJed Brownweb-snapshot: 459cc5a9e26SSatish Balay @if [ ! -f "${HOME}/petsc-master.tar.gz" ]; then \ 460cc5a9e26SSatish Balay echo "~/petsc-master.tar.gz missing! cannot update petsc-master snapshot on mcs-web-site"; \ 461753a1a87SJed Brown else \ 462cc5a9e26SSatish Balay echo "updating petsc-master snapshot on mcs-web-site"; \ 463753a1a87SJed Brown tmpdir=`mktemp -d -t petsc-doc.XXXXXXXX`; \ 464cc5a9e26SSatish Balay cd $${tmpdir}; tar -xzf ${HOME}/petsc-master.tar.gz; \ 465cc5a9e26SSatish Balay /usr/bin/rsync -e ssh -az --delete $${tmpdir}/petsc-master/ \ 466cc5a9e26SSatish Balay petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-master ;\ 467cc5a9e26SSatish Balay /bin/cp -f /home/petsc/petsc-master.tar.gz /mcs/ftp/pub/petsc/petsc-master.tar.gz;\ 468753a1a87SJed Brown ${RM} -rf $${tmpdir} ;\ 469753a1a87SJed Brown fi 470753a1a87SJed Brown 471cc5a9e26SSatish Balay# build the tarfile - and then update petsc-master snapshot on mcs-web-site 472753a1a87SJed Brownupdate-web-snapshot: dist web-snapshot 473753a1a87SJed Brown 474753a1a87SJed Brown# This target updates website main pages 475753a1a87SJed Brownupdate-web: 476753a1a87SJed Brown @cd ${PETSC_DIR}/src/docs; make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} bib2html; \ 477753a1a87SJed Brown /usr/bin/rsync -az -C --exclude=documentation/index.html \ 478753a1a87SJed Brown --exclude=documentation/installation.html --exclude=download/index.html \ 479753a1a87SJed Brown ${PETSC_DIR}/src/docs/website/ petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc 480753a1a87SJed Brown @cd ${PETSC_DIR}/docs; /usr/bin/rsync -az developers.pdf petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/developers/ 48192df35d2SSatish Balay @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 482753a1a87SJed Brown 483753a1a87SJed Brown# 484753a1a87SJed Brown# builds a single list of files for each PETSc library so they may all be built in parallel 485753a1a87SJed Brown# without a recursive set of make calls 486753a1a87SJed Browncreatefastbuild: 4872d507118SSatish Balay cd src/vec; ${RM} -f files; /bin/echo -n "SOURCEC = " > files; make tree ACTION=sourcelist BASE_DIR=${PETSC_DIR}/src/vec 488753a1a87SJed Brown 489753a1a87SJed Brown########################################################### 490753a1a87SJed Brown# 491753a1a87SJed Brown# See script for details 492753a1a87SJed Brown# 493753a1a87SJed Browngcov: 4944344ef9dSJed Brown -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -run_gcov 495753a1a87SJed Brown 496753a1a87SJed Brownmergegcov: 4974344ef9dSJed Brown -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -merge_gcov ${LOC} *.tar.gz 498753a1a87SJed Brown 4999eed5432SKarl Rupp######################## 500235fd6e6SBarry Smith# 5019eed5432SKarl Rupp# Create the include dependency graph (requires graphviz to be available) 5029eed5432SKarl Rupp# 5039eed5432SKarl Ruppincludegraph: 5049eed5432SKarl Rupp -@${PETSC_DIR}/src/contrib/style/include-graph.sh includegraph.pdf 5059eed5432SKarl Rupp -@echo Include dependency graph written to includegraph.pdf 506235fd6e6SBarry Smith 507753a1a87SJed Brown# 508753a1a87SJed Brown# ------------------------------------------------------------------------------- 509753a1a87SJed Brown# 510753a1a87SJed Brown# Some macros to check if the fortran interface is up-to-date. 511753a1a87SJed Brown# 512753a1a87SJed Browncountfortranfunctions: 513753a1a87SJed Brown -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 514753a1a87SJed Brown cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 515753a1a87SJed Brown sed "s/_$$//" | sort > /tmp/countfortranfunctions 516753a1a87SJed Brown 517753a1a87SJed Browncountcfunctions: 518068711b4SBarry Smith -@grep PETSC_EXTERN ${PETSC_DIR}/include/*.h | grep "(" | tr -s ' ' | \ 519753a1a87SJed Brown cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 520068711b4SBarry Smith tr 'A-Z' 'a-z' | sort | uniq > /tmp/countcfunctions 521753a1a87SJed Brown 522753a1a87SJed Browndifffortranfunctions: countfortranfunctions countcfunctions 523753a1a87SJed Brown -@echo -------------- Functions missing in the fortran interface --------------------- 524753a1a87SJed Brown -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 525753a1a87SJed Brown -@echo ----------------- Functions missing in the C interface ------------------------ 526753a1a87SJed Brown -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 527753a1a87SJed Brown -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 528753a1a87SJed Brown 529753a1a87SJed Browncheckbadfortranstubs: 530753a1a87SJed Brown -@echo "=========================================" 531753a1a87SJed Brown -@echo "Functions with MPI_Comm as an Argument" 532753a1a87SJed Brown -@echo "=========================================" 533753a1a87SJed Brown -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 534753a1a87SJed Brown tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 535753a1a87SJed Brown -@echo "=========================================" 536753a1a87SJed Brown -@echo "Functions with a String as an Argument" 537753a1a87SJed Brown -@echo "=========================================" 538753a1a87SJed Brown -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 539753a1a87SJed Brown tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 540753a1a87SJed Brown -@echo "=========================================" 541753a1a87SJed Brown -@echo "Functions with Pointers to PETSc Objects as Argument" 542753a1a87SJed Brown -@echo "=========================================" 543753a1a87SJed Brown -@cd ${PETSC_DIR}/src/fortran/auto; \ 544753a1a87SJed Brown _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 545753a1a87SJed Brown cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 546753a1a87SJed Brown sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 547753a1a87SJed Brown for OBJ in $$_p_OBJ; do \ 548753a1a87SJed Brown grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 549753a1a87SJed Brown cut -d'(' -f1 | cut -d' ' -f1,3; \ 550753a1a87SJed Brown done 551a3269974SBarry Smith 552a3269974SBarry Smithcheckpackagetests: 553a3269974SBarry Smith -@echo "Missing package tests" 554a3269974SBarry Smith -@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 555a3269974SBarry Smith -@echo "Missing download package tests" 556a3269974SBarry Smith -@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 557a3269974SBarry Smith 558753a1a87SJed Brown# 559753a1a87SJed Brown# Automatically generates PETSc exercises in html from the tutorial examples. 560753a1a87SJed Brown# 5611b266c99SBarry Smith# The introduction for each section is obtained from docs/manualpages-cite/header_${MANSEC} may be edited 562753a1a87SJed Brown# (used also in introductions to the manual pages) 563753a1a87SJed Brown# 5641b266c99SBarry Smith# DO NOT EDIT the *.htm files generated since they will be automatically replaced. 565753a1a87SJed Brown# 566753a1a87SJed Brown# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 567753a1a87SJed Brown# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 568753a1a87SJed Brown# 569753a1a87SJed Brownexercises: 570753a1a87SJed Brown -@echo "=========================================" 571753a1a87SJed Brown -@echo "Generating HTML tutorial exercises" 572753a1a87SJed Brown -@${RM} docs/pageform.txt 573753a1a87SJed Brown -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 574753a1a87SJed Brown -@echo "access_title=Exercise Sections" >> docs/pageform.txt 575753a1a87SJed Brown -@echo "access_format=short" >> docs/pageform.txt 576753a1a87SJed Brown -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 577753a1a87SJed Brown -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 578753a1a87SJed Brown -@echo "Generating HTML for individual directories" 579753a1a87SJed Brown -@echo "=========================================" 580753a1a87SJed Brown -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 581753a1a87SJed Brown -@echo "Completed HTML for individual directories" 582753a1a87SJed Brown -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 583753a1a87SJed Brown -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 584753a1a87SJed Brown /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 585753a1a87SJed Brown -@echo "=========================================" 586753a1a87SJed Brown 587753a1a87SJed Brown.PHONY: info info_h all build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update \ 588753a1a87SJed Brown alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \ 589bcaeba4dSBarry Smith allhtml allcleanhtml allci allco allrcslabel countfortranfunctions \ 590416ff897SSatish Balay start_configure configure_petsc configure_clean matlabbin install 591753a1a87SJed Brown 592753a1a87SJed Brownpetscao : petscmat petscao.f90.h 593753a1a87SJed Brownpetscdm : petscksp petscdm.f90.h 594753a1a87SJed Brownpetscdraw : petsc petscdraw.f90.h 595753a1a87SJed Brownpetscis : petsc petscis.f90.h 596753a1a87SJed Brownpetscksp : petscpc petscksp.f90.h 597753a1a87SJed Brownpetsclog : petsc petsclog.f90.h 598753a1a87SJed Brownpetscmat : petscvec petscmat.f90.h 599753a1a87SJed Brownpetscmg : petscksp petscmg.f90.h 600753a1a87SJed Brownpetscpc : petscmat petscpc.f90.h 601753a1a87SJed Brownpetscsnes : petscksp petscsnes.f90.h 602753a1a87SJed Brownpetscsys : petsc petscsys.f90.h 603753a1a87SJed Brownpetscts : petscsnes petscts.f90.h 604753a1a87SJed Brownpetsc : petsc.f90.h 605753a1a87SJed Brownpetscvec : petscis petscvec.f90.h 606753a1a87SJed Brownpetscviewer : petsc petscviewer.f90.h 607753a1a87SJed Brownpetscmesh : petsc petscmesh.f90.h 608753a1a87SJed Brownmodules : petscao petscdm petscdraw petscis petscksp petsclog petscmat petscmg petscpc petscsnes petscsys petscts petsc petscvec petscviewer petscmesh 609