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 20*fa2665b1SJed Brown# This makefile contains a lot of PHONY targets with improperly specified prerequisites 21*fa2665b1SJed Brown# where correct execution instead depends on the targets being processed in the correct 22*fa2665b1SJed Brown# order. This is gross, but this makefile doesn't really do any work. Sub-makes still 23*fa2665b1SJed Brown# benefit from parallelism. 24*fa2665b1SJed Brown.NOTPARALLEL: 25*fa2665b1SJed 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 71*fa2665b1SJed 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}" 122ac8fb971SBarry Smith -@echo Using mpi.h: `echo '#include <mpi.h>' > ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/mpitest.c; ${CPP} ${PETSC_CCPPFLAGS} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/mpitest.c |grep 'mpi\.h' | ( head -1 ; cat > /dev/null )` 1231d2d58a3SSatish Balay -@echo "-----------------------------------------" 124753a1a87SJed Brown -@echo "Using libraries: ${PETSC_LIB}" 125753a1a87SJed Brown -@echo "------------------------------------------" 126753a1a87SJed Brown -@echo "Using mpiexec: ${MPIEXEC}" 127753a1a87SJed Brown -@echo "==========================================" 128753a1a87SJed Brown 129753a1a87SJed Brown# 130753a1a87SJed Brown# Builds the PETSc libraries 131753a1a87SJed Brown# This target also builds fortran77 and f90 interface 132753a1a87SJed Brown# files and compiles .F files 133753a1a87SJed Brown# 134dd8585cdSJed Brownbuild: 135753a1a87SJed Brown -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 136753a1a87SJed Brown -@echo "=========================================" 137753a1a87SJed Brown -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 138753a1a87SJed Brown -@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} > tmpf 2>&1 ; ${GREP} -v "has no symbols" tmpf; ${RM} tmpf; 139753a1a87SJed Brown -@echo "Completed building libraries" 140753a1a87SJed Brown -@echo "=========================================" 141753a1a87SJed Brown# 142d2b3add8SSatish Balay# Build MatLab binaries 143d2b3add8SSatish Balay# 144d2b3add8SSatish Balaymatlabbin: 14526e98103SSatish Balay -@if [ "${MATLAB_MEX}" != "" -a "${PETSC_SCALAR}" = "real" -a "${PETSC_PRECISION}" = "double" ]; then \ 146d2b3add8SSatish Balay echo "BEGINNING TO COMPILE MATLAB INTERFACE"; \ 147d2b3add8SSatish Balay if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc; fi; \ 148d2b3add8SSatish Balay if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab; fi; \ 149d2b3add8SSatish Balay cd src/sys/classes/viewer/impls/socket/matlab && ${OMAKE} matlabcodes PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR}; \ 150d2b3add8SSatish Balay echo "========================================="; \ 151d2b3add8SSatish Balay fi 152753a1a87SJed Brown# 153753a1a87SJed Brown# Builds PETSc test examples for a given architecture 154753a1a87SJed Brown# 1553cfc63a1SBarry Smithtest_install: test 15656879a31SBarry Smithcheck: test 157753a1a87SJed Browntest: 158de3d9997SSatish 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 1595f6f18d4SSatish Balay -@if [ "${PETSC_WITH_BATCH}" = "" ]; then \ 1605f6f18d4SSatish Balay printf "=========================================\n"; \ 1615f6f18d4SSatish Balay printf "Now to evaluate the computer systems you plan use - do:\n"; \ 162dc32dc79SSatish Balay printf "make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} streams\n"; \ 1635f6f18d4SSatish Balay fi 164753a1a87SJed Browntestx: 165af0996ceSBarry Smith -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testx_build 2>&1 | tee ./${PETSC_ARCH}/lib/petsc/conf/testx.log 166753a1a87SJed Browntest_build: 167753a1a87SJed Brown -@echo "Running test examples to verify correct installation" 168753a1a87SJed Brown -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 169227c2ee5SSatish Balay @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 170227c2ee5SSatish Balay @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex19 171e5d08945SBarry Smith @if [ "${HYPRE_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 172c3a89c15SBarry 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; \ 173e5d08945SBarry Smith fi; 174e5d08945SBarry Smith @if [ "${MUMPS_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 175c3a89c15SBarry 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; \ 176e5d08945SBarry Smith fi; 177e5d08945SBarry Smith @if [ "${SUPERLU_DIST_LIB}" != "" ] && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 178c3a89c15SBarry 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; \ 179e5d08945SBarry Smith fi; 180e5d08945SBarry Smith @if ( [ "${ML_LIB}" != "" ] || [ "${TRILINOS_LIB}" != "" ] ) && [ "${PETSC_WITH_BATCH}" = "" ]; then \ 181c3a89c15SBarry 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; \ 182e5d08945SBarry Smith fi; 183e5d08945SBarry Smith @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ex19.rm 1845061939cSBarry Smith @if [ "${PETSC4PY}" = "yes" ]; then \ 1859c049d36SBarry Smith cd src/ksp/ksp/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex100; \ 1865061939cSBarry Smith fi; 1877cab4194SSatish Balay @egrep "^#define PETSC_HAVE_FORTRAN 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null; \ 188cb297985SSatish Balay if test -s .ftn.log; then \ 189cb297985SSatish Balay cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex5f; \ 190cb297985SSatish Balay fi; ${RM} .ftn.log; 191227c2ee5SSatish Balay @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 192753a1a87SJed Brown -@echo "Completed test examples" 193753a1a87SJed Browntestx_build: 194753a1a87SJed Brown -@echo "Running graphics test example to verify correct X11 installation" 195753a1a87SJed Brown -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 196227c2ee5SSatish Balay @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 197227c2ee5SSatish Balay @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testxex19 198227c2ee5SSatish Balay @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 199753a1a87SJed Brown -@echo "Completed graphics test example" 200753a1a87SJed Brown 201753a1a87SJed Browntestexamples: info 202753a1a87SJed Brown -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 203753a1a87SJed Brown -@echo "Due to different numerical round-off on certain" 204753a1a87SJed Brown -@echo "machines some of the numbers may not match exactly." 205753a1a87SJed Brown -@echo "=========================================" 206753a1a87SJed Brown -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C tree 207753a1a87SJed Brown -@echo "Completed compiling and running test examples" 208753a1a87SJed Brown -@echo "=========================================" 209753a1a87SJed Browntestfortran: info 210753a1a87SJed Brown -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 211753a1a87SJed Brown -@echo "=========================================" 212753a1a87SJed Brown -@echo "Due to different numerical round-off on certain" 213753a1a87SJed Brown -@echo "machines or the way Fortran formats numbers" 214753a1a87SJed Brown -@echo "some of the results may not match exactly." 215753a1a87SJed Brown -@echo "=========================================" 216753a1a87SJed Brown -@if [ "${FC}" != "" ]; then \ 217753a1a87SJed Brown ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran tree; \ 218753a1a87SJed Brown echo "Completed compiling and running Fortran test examples"; \ 219753a1a87SJed Brown else \ 220753a1a87SJed Brown echo "Error: No FORTRAN compiler available"; \ 221753a1a87SJed Brown fi 222753a1a87SJed Brown -@echo "=========================================" 223753a1a87SJed Browntestexamples_uni: info 224753a1a87SJed Brown -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 225753a1a87SJed Brown -@echo "Due to different numerical round-off on certain" 226753a1a87SJed Brown -@echo "machines some of the numbers may not match exactly." 227753a1a87SJed Brown -@echo "=========================================" 228753a1a87SJed Brown -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C_X_MPIUni tree 229753a1a87SJed Brown -@echo "Completed compiling and running uniprocessor test examples" 230753a1a87SJed Brown -@echo "=========================================" 231753a1a87SJed Browntestfortran_uni: info 232753a1a87SJed Brown -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES" 233753a1a87SJed Brown -@echo "Due to different numerical round-off on certain" 234753a1a87SJed Brown -@echo "machines some of the numbers may not match exactly." 235753a1a87SJed Brown -@echo "=========================================" 236753a1a87SJed Brown -@if [ "${FC}" != "" ]; then \ 237753a1a87SJed Brown ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni tree; \ 238753a1a87SJed Brown echo "Completed compiling and running uniprocessor fortran test examples"; \ 239753a1a87SJed Brown else \ 240753a1a87SJed Brown echo "Error: No FORTRAN compiler available"; \ 241753a1a87SJed Brown fi 242753a1a87SJed Brown -@ 243753a1a87SJed Brown -@echo "=========================================" 244753a1a87SJed Brown 245753a1a87SJed Brown# Ranlib on the libraries 246753a1a87SJed Brownranlib: 247753a1a87SJed Brown ${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} 248753a1a87SJed Brown 249753a1a87SJed Brown# Deletes PETSc libraries 250dd8585cdSJed Browndeletelibs: 251753a1a87SJed Brown -${RM} -rf ${PETSC_LIB_DIR}/libpetsc*.* 252dd8585cdSJed Browndeletemods: 253753a1a87SJed Brown -${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod 254753a1a87SJed Brown 255753a1a87SJed Brown# Cleans up build 25658080eacSSatish Balayallclean-legacy: deletelibs deletemods 25759d63732SSatish Balay -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean-legacy tree 25858080eacSSatish Balayallclean-cmake: 25958080eacSSatish Balay -@cd ${PETSC_ARCH} && ${OMAKE} clean 26058080eacSSatish Balayallclean-gnumake: 26158080eacSSatish Balay -@${OMAKE} -f gmakefile clean 26258080eacSSatish Balay 26358080eacSSatish Balayallclean: 26458080eacSSatish Balay @if [ "${MAKE_IS_GNUMAKE}" != "" ]; then \ 26558080eacSSatish Balay ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-gnumake; \ 26658080eacSSatish Balay elif [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \ 26758080eacSSatish Balay ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-cmake; \ 26858080eacSSatish Balay else \ 26958080eacSSatish Balay ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} allclean-legacy; \ 27058080eacSSatish Balay fi 27159d63732SSatish Balay 27259d63732SSatish Balayclean:: allclean 27359d63732SSatish Balay 27459d63732SSatish Balaydistclean: chk_petscdir 275af0996ceSBarry Smith @if [ -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ]; then \ 276af0996ceSBarry Smith echo "*** Preserving ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py in ${PETSC_DIR} ***"; \ 277af0996ceSBarry Smith mv -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ${PETSC_DIR}/; fi 27859d63732SSatish Balay @echo "*** Deleting all build files in ${PETSC_DIR}/${PETSC_ARCH} ***" 27959d63732SSatish Balay -${RM} -rf ${PETSC_DIR}/${PETSC_ARCH}/ 28059d63732SSatish Balay 28159d63732SSatish Balay 282753a1a87SJed Brown# 283753a1a87SJed Brownreconfigure: 284af0996ceSBarry Smith @${PYTHON} ${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py 285753a1a87SJed Brown# 286753a1a87SJed Browninstall: 2870ee81e68SLisandro Dalcin @${PYTHON} ./config/install.py -destDir=${DESTDIR} 28850a4861cSBarry Smith ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} mpi4py-install petsc4py-install libmesh-install slepc-install 289753a1a87SJed Brown 290753a1a87SJed Brownnewall: 291753a1a87SJed Brown -@cd src/sys; @${PYTHON} ${PETSC_DIR}/config/builder.py 292753a1a87SJed Brown -@cd src/vec; @${PYTHON} ${PETSC_DIR}/config/builder.py 293753a1a87SJed Brown -@cd src/mat; @${PYTHON} ${PETSC_DIR}/config/builder.py 294753a1a87SJed Brown -@cd src/dm; @${PYTHON} ${PETSC_DIR}/config/builder.py 295753a1a87SJed Brown -@cd src/ksp; @${PYTHON} ${PETSC_DIR}/config/builder.py 296753a1a87SJed Brown -@cd src/snes; @${PYTHON} ${PETSC_DIR}/config/builder.py 297753a1a87SJed Brown -@cd src/ts; @${PYTHON} ${PETSC_DIR}/config/builder.py 298753a1a87SJed Brown 299753a1a87SJed Brownstreams: 300bfc31b0fSJed Brown cd src/benchmarks/streams; ${OMAKE} PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} streams 3015fabf859SBarry Smith 3025fabf859SBarry Smithstream: 303bfc31b0fSJed Brown cd src/benchmarks/streams; ${OMAKE} PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} stream 304753a1a87SJed Brown# ------------------------------------------------------------------ 305753a1a87SJed Brown# 306753a1a87SJed Brown# All remaining actions are intended for PETSc developers only. 307753a1a87SJed Brown# PETSc users should not generally need to use these commands. 308753a1a87SJed Brown# 309753a1a87SJed Brown# See the users manual for how the tags files may be used from Emacs and Vi/Vim 310753a1a87SJed Brown# 311753a1a87SJed Brownalletags: 312c3a89c15SBarry Smith -@${PYTHON} lib/petsc/bin/maint/generateetags.py 313753a1a87SJed Brown -@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON 314753a1a87SJed Brown 315762ef373SBarry Smith# obtain gtags from http://www.gnu.org/s/global/ 316762ef373SBarry Smithallgtags: 317a4ae4b6dSToby 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 - 318762ef373SBarry Smith 319753a1a87SJed Brownallfortranstubs: 3201b266c99SBarry Smith -@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir 321c3a89c15SBarry Smith @${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} 322c3a89c15SBarry Smith -@${PYTHON} lib/petsc/bin/maint/generatefortranstubs.py -merge ${VERBOSE} 323a318115bSBarry Smith -@${RM} -rf ${PETSC_ARCH}/include/petsc/finclude/ftn-auto/*-tmpdir 324753a1a87SJed Browndeletefortranstubs: 325753a1a87SJed Brown -@find . -type d -name ftn-auto | xargs rm -rf 326753a1a87SJed Browncmakegen: 327753a1a87SJed Brown -@${PYTHON} config/cmakegen.py 328753a1a87SJed Brown# 329753a1a87SJed Brown# These are here for the target allci and allco, and etags 330753a1a87SJed Brown# 331753a1a87SJed Brown 332bcaeba4dSBarry SmithBMAKEFILES = conf/variables conf/rules conf/test 333c3a89c15SBarry 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 \ 334c3a89c15SBarry 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 \ 335c3a89c15SBarry 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 \ 336c3a89c15SBarry 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 \ 337c3a89c15SBarry 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 \ 338753a1a87SJed Brown config/PETSc/Configure.py config/PETSc/Options.py \ 33906e08bc7SBarry Smith config/PETSc/utilities/*.py 340753a1a87SJed Brown 341753a1a87SJed Brown 342753a1a87SJed Brown# Builds all the documentation - should be done every night 343f4da3331SVáclav Haplaalldoc: allcite allpdf alldoc1 alldoc2 alldoc3 docsetdate 344753a1a87SJed Brown 345f4da3331SVáclav Hapla# Build just citations 346f4da3331SVáclav Haplaallcite: chk_loc deletemanualpages 347c3a89c15SBarry Smith -${PYTHON} lib/petsc/bin/maint/countpetsccits.py 348753a1a87SJed Brown -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 349753a1a87SJed Brown -@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap 350753a1a87SJed Brown -@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap 351f4da3331SVáclav Hapla 352f4da3331SVáclav Hapla# Build just PDF manuals + prerequisites 353f4da3331SVáclav Haplaallpdf: chk_loc allcite 354753a1a87SJed Brown -cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 355753a1a87SJed Brown -cd src/docs/tex/manual; ${OMAKE} developers.pdf LOC=${LOC} 356f5b986e4SVáclav Hapla -cd src/docs/tao_tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 357f4da3331SVáclav Hapla 358f4da3331SVáclav Hapla# Build just manual pages + prerequisites 359f4da3331SVáclav Haplaallmanpages: chk_loc allcite 360753a1a87SJed Brown -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 361f4da3331SVáclav Hapla 362f4da3331SVáclav Hapla# Build just manual examples + prerequisites 363f4da3331SVáclav Haplaallmanexamples: chk_loc allmanpages 364753a1a87SJed Brown -${OMAKE} ACTION=manexamples tree_basic LOC=${LOC} 365f4da3331SVáclav Hapla 366f4da3331SVáclav Hapla# Build everything that goes into 'doc' dir except html sources 367f4da3331SVáclav Haplaalldoc1: chk_loc chk_concepts_dir allcite allmanpages allmanexamples 36821fcc2ddSBarry Smith -${OMAKE} manimplementations LOC=${LOC} 369c3a89c15SBarry Smith -${PYTHON} lib/petsc/bin/maint/wwwindex.py ${PETSC_DIR} ${LOC} 370753a1a87SJed Brown -${OMAKE} manconcepts LOC=${LOC} 371753a1a87SJed Brown -${OMAKE} ACTION=getexlist tree_basic LOC=${LOC} 372753a1a87SJed Brown -${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC} 373c3a89c15SBarry Smith -${PYTHON} lib/petsc/bin/maint/helpindex.py ${PETSC_DIR} ${LOC} 374753a1a87SJed Brown 375753a1a87SJed Brown# Builds .html versions of the source 376753a1a87SJed Brown# html overwrites some stuff created by update-docs - hence this is done later. 377753a1a87SJed Brownalldoc2: chk_loc 3787070facaSSatish Balay -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 379c3a89c15SBarry Smith -${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} 380753a1a87SJed Brown# 381753a1a87SJed Brown# Builds HTML versions of Matlab scripts 382753a1a87SJed Brownalldoc3: chk_loc 383753a1a87SJed Brown if [ "${MATLAB_COMMAND}" != "" ]; then\ 384502b79f1SSatish Balay export MATLABPATH=${MATLABPATH}:${PETSC_DIR}/share/petsc/matlab; \ 385502b79f1SSatish Balay cd ${PETSC_DIR}/share/petsc/matlab; ${MATLAB_COMMAND} -nodisplay -nodesktop -r "generatehtml;exit" ; \ 386753a1a87SJed Brown fi 387753a1a87SJed Brown 388d9dc08c3SBarry Smith# 389d9dc08c3SBarry Smith# Makes links for all manual pages in $LOC/docs/manualpages/all 390d9dc08c3SBarry Smithallman: 391d9dc08c3SBarry 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 \; 392d9dc08c3SBarry Smith 393de86d973SSatish 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 394f304b780SSatish Balay 395753a1a87SJed Brown# modify all generated html files and add in version number, date, canonical URL info. 396ad5c76d5SBarry Smithdocsetdate: chk_petscdir 397753a1a87SJed Brown @echo "Updating generated html files with petsc version, date, canonical URL info";\ 398753a1a87SJed Brown version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 399753a1a87SJed Brown version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 400753a1a87SJed Brown version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 401e4643290SSatish Balay version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 402753a1a87SJed Brown if [ $${version_release} = 0 ]; then \ 403cc5a9e26SSatish Balay petscversion=petsc-master; \ 404753a1a87SJed Brown export petscversion; \ 405753a1a87SJed Brown elif [ $${version_release} = 1 ]; then \ 406e4643290SSatish Balay petscversion=petsc-$${version_major}.$${version_minor}.$${version_subminor}; \ 407753a1a87SJed Brown export petscversion; \ 408753a1a87SJed Brown else \ 409753a1a87SJed Brown echo "Unknown PETSC_VERSION_RELEASE: $${version_release}"; \ 410753a1a87SJed Brown exit; \ 411753a1a87SJed Brown fi; \ 4129c5cad75SSatish Balay datestr=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1`; \ 413753a1a87SJed Brown export datestr; \ 4142c3da995SSatish Balay gitver=`git describe --match "v*"`; \ 4153408a366SSatish Balay export gitver; \ 416753a1a87SJed Brown find * -type d -wholename src/docs/website -prune -o -type d -wholename src/benchmarks/results -prune -o \ 417e6b20741SSatish Balay -type d -wholename config/BuildSystem/docs/website -prune -o -type d -wholename include/web -prune -o \ 418f304b780SSatish Balay -type d -wholename 'arch-*' -prune -o -type d -wholename src/tops -prune -o -type d -wholename externalpackages -prune ${DOCSETDATE_PRUNE_LIST} -o \ 419536d436eSSatish Balay -type f -name \*.html \ 4203408a366SSatish 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' {} \; \ 421753a1a87SJed Brown -exec perl -pi -e 's^(<head>)^$$1 <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/{}" />^i' {} \; ; \ 422753a1a87SJed Brown echo "Done fixing version number, date, canonical URL info" 423753a1a87SJed Brown 424753a1a87SJed Brownalldocclean: deletemanualpages allcleanhtml 425753a1a87SJed Brown 426753a1a87SJed Brown# Deletes man pages (HTML version) 427753a1a87SJed Browndeletemanualpages: chk_loc 428753a1a87SJed Brown -@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \ 429753a1a87SJed Brown find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\ 430753a1a87SJed Brown ${RM} ${LOC}/docs/exampleconcepts ;\ 431753a1a87SJed Brown ${RM} ${LOC}/docs/manconcepts ;\ 432753a1a87SJed Brown ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\ 433c3a89c15SBarry Smith ${PYTHON} lib/petsc/bin/maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\ 434753a1a87SJed Brown fi 435753a1a87SJed Brown 436753a1a87SJed Brownallcleanhtml: 437753a1a87SJed Brown -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 438753a1a87SJed Brown 439753a1a87SJed Brownchk_concepts_dir: chk_loc 440753a1a87SJed Brown @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 441753a1a87SJed Brown echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 442753a1a87SJed Brown 443753a1a87SJed Brown########################################################### 444753a1a87SJed Brown# targets to build distribution and update docs 445753a1a87SJed Brown########################################################### 446753a1a87SJed Brown 447753a1a87SJed Brown# Creates ${HOME}/petsc.tar.gz [and petsc-lite.tar.gz] 448753a1a87SJed Browndist: 449c3a89c15SBarry Smith ${PETSC_DIR}/lib/petsc/bin/maint/builddist ${PETSC_DIR} master 450753a1a87SJed Brown 451753a1a87SJed Brown# This target works only if you can do 'ssh petsc@login.mcs.anl.gov' 452753a1a87SJed Brown# also copy the file over to ftp site. 453753a1a87SJed Brownweb-snapshot: 454cc5a9e26SSatish Balay @if [ ! -f "${HOME}/petsc-master.tar.gz" ]; then \ 455cc5a9e26SSatish Balay echo "~/petsc-master.tar.gz missing! cannot update petsc-master snapshot on mcs-web-site"; \ 456753a1a87SJed Brown else \ 457cc5a9e26SSatish Balay echo "updating petsc-master snapshot on mcs-web-site"; \ 458753a1a87SJed Brown tmpdir=`mktemp -d -t petsc-doc.XXXXXXXX`; \ 459cc5a9e26SSatish Balay cd $${tmpdir}; tar -xzf ${HOME}/petsc-master.tar.gz; \ 460cc5a9e26SSatish Balay /usr/bin/rsync -e ssh -az --delete $${tmpdir}/petsc-master/ \ 461cc5a9e26SSatish Balay petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-master ;\ 462cc5a9e26SSatish Balay /bin/cp -f /home/petsc/petsc-master.tar.gz /mcs/ftp/pub/petsc/petsc-master.tar.gz;\ 463753a1a87SJed Brown ${RM} -rf $${tmpdir} ;\ 464753a1a87SJed Brown fi 465753a1a87SJed Brown 466cc5a9e26SSatish Balay# build the tarfile - and then update petsc-master snapshot on mcs-web-site 467753a1a87SJed Brownupdate-web-snapshot: dist web-snapshot 468753a1a87SJed Brown 469753a1a87SJed Brown# This target updates website main pages 470753a1a87SJed Brownupdate-web: 471753a1a87SJed Brown @cd ${PETSC_DIR}/src/docs; make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} bib2html; \ 472753a1a87SJed Brown /usr/bin/rsync -az -C --exclude=documentation/index.html \ 473753a1a87SJed Brown --exclude=documentation/installation.html --exclude=download/index.html \ 474753a1a87SJed Brown ${PETSC_DIR}/src/docs/website/ petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc 475753a1a87SJed Brown @cd ${PETSC_DIR}/docs; /usr/bin/rsync -az developers.pdf petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/developers/ 47692df35d2SSatish 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 477753a1a87SJed Brown 478753a1a87SJed Brown# 479753a1a87SJed Brown# builds a single list of files for each PETSc library so they may all be built in parallel 480753a1a87SJed Brown# without a recursive set of make calls 481753a1a87SJed Browncreatefastbuild: 4822d507118SSatish Balay cd src/vec; ${RM} -f files; /bin/echo -n "SOURCEC = " > files; make tree ACTION=sourcelist BASE_DIR=${PETSC_DIR}/src/vec 483753a1a87SJed Brown 484753a1a87SJed Brown########################################################### 485753a1a87SJed Brown# 486753a1a87SJed Brown# See script for details 487753a1a87SJed Brown# 488753a1a87SJed Browngcov: 4894344ef9dSJed Brown -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -run_gcov 490753a1a87SJed Brown 491753a1a87SJed Brownmergegcov: 4924344ef9dSJed Brown -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py -merge_gcov ${LOC} *.tar.gz 493753a1a87SJed Brown 4949eed5432SKarl Rupp######################## 495235fd6e6SBarry Smith# 4969eed5432SKarl Rupp# Create the include dependency graph (requires graphviz to be available) 4979eed5432SKarl Rupp# 4989eed5432SKarl Ruppincludegraph: 4999eed5432SKarl Rupp -@${PETSC_DIR}/src/contrib/style/include-graph.sh includegraph.pdf 5009eed5432SKarl Rupp -@echo Include dependency graph written to includegraph.pdf 501235fd6e6SBarry Smith 502753a1a87SJed Brown# 503753a1a87SJed Brown# ------------------------------------------------------------------------------- 504753a1a87SJed Brown# 505753a1a87SJed Brown# Some macros to check if the fortran interface is up-to-date. 506753a1a87SJed Brown# 507753a1a87SJed Browncountfortranfunctions: 508753a1a87SJed Brown -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 509753a1a87SJed Brown cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 510753a1a87SJed Brown sed "s/_$$//" | sort > /tmp/countfortranfunctions 511753a1a87SJed Brown 512753a1a87SJed Browncountcfunctions: 513068711b4SBarry Smith -@grep PETSC_EXTERN ${PETSC_DIR}/include/*.h | grep "(" | tr -s ' ' | \ 514753a1a87SJed Brown cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 515068711b4SBarry Smith tr 'A-Z' 'a-z' | sort | uniq > /tmp/countcfunctions 516753a1a87SJed Brown 517753a1a87SJed Browndifffortranfunctions: countfortranfunctions countcfunctions 518753a1a87SJed Brown -@echo -------------- Functions missing in the fortran interface --------------------- 519753a1a87SJed Brown -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 520753a1a87SJed Brown -@echo ----------------- Functions missing in the C interface ------------------------ 521753a1a87SJed Brown -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 522753a1a87SJed Brown -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 523753a1a87SJed Brown 524753a1a87SJed Browncheckbadfortranstubs: 525753a1a87SJed Brown -@echo "=========================================" 526753a1a87SJed Brown -@echo "Functions with MPI_Comm as an Argument" 527753a1a87SJed Brown -@echo "=========================================" 528753a1a87SJed Brown -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 529753a1a87SJed Brown tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 530753a1a87SJed Brown -@echo "=========================================" 531753a1a87SJed Brown -@echo "Functions with a String as an Argument" 532753a1a87SJed Brown -@echo "=========================================" 533753a1a87SJed Brown -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 534753a1a87SJed Brown tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 535753a1a87SJed Brown -@echo "=========================================" 536753a1a87SJed Brown -@echo "Functions with Pointers to PETSc Objects as Argument" 537753a1a87SJed Brown -@echo "=========================================" 538753a1a87SJed Brown -@cd ${PETSC_DIR}/src/fortran/auto; \ 539753a1a87SJed Brown _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 540753a1a87SJed Brown cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 541753a1a87SJed Brown sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 542753a1a87SJed Brown for OBJ in $$_p_OBJ; do \ 543753a1a87SJed Brown grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 544753a1a87SJed Brown cut -d'(' -f1 | cut -d' ' -f1,3; \ 545753a1a87SJed Brown done 546a3269974SBarry Smith 547a3269974SBarry Smithcheckpackagetests: 548a3269974SBarry Smith -@echo "Missing package tests" 549a3269974SBarry 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 550a3269974SBarry Smith -@echo "Missing download package tests" 551a3269974SBarry 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 552a3269974SBarry Smith 553753a1a87SJed Brown# 554753a1a87SJed Brown# Automatically generates PETSc exercises in html from the tutorial examples. 555753a1a87SJed Brown# 5561b266c99SBarry Smith# The introduction for each section is obtained from docs/manualpages-cite/header_${MANSEC} may be edited 557753a1a87SJed Brown# (used also in introductions to the manual pages) 558753a1a87SJed Brown# 5591b266c99SBarry Smith# DO NOT EDIT the *.htm files generated since they will be automatically replaced. 560753a1a87SJed Brown# 561753a1a87SJed Brown# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 562753a1a87SJed Brown# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 563753a1a87SJed Brown# 564753a1a87SJed Brownexercises: 565753a1a87SJed Brown -@echo "=========================================" 566753a1a87SJed Brown -@echo "Generating HTML tutorial exercises" 567753a1a87SJed Brown -@${RM} docs/pageform.txt 568753a1a87SJed Brown -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 569753a1a87SJed Brown -@echo "access_title=Exercise Sections" >> docs/pageform.txt 570753a1a87SJed Brown -@echo "access_format=short" >> docs/pageform.txt 571753a1a87SJed Brown -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 572753a1a87SJed Brown -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 573753a1a87SJed Brown -@echo "Generating HTML for individual directories" 574753a1a87SJed Brown -@echo "=========================================" 575753a1a87SJed Brown -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 576753a1a87SJed Brown -@echo "Completed HTML for individual directories" 577753a1a87SJed Brown -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 578753a1a87SJed Brown -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 579753a1a87SJed Brown /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 580753a1a87SJed Brown -@echo "=========================================" 581753a1a87SJed Brown 582753a1a87SJed Brown.PHONY: info info_h all build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update \ 583753a1a87SJed Brown alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \ 584bcaeba4dSBarry Smith allhtml allcleanhtml allci allco allrcslabel countfortranfunctions \ 585416ff897SSatish Balay start_configure configure_petsc configure_clean matlabbin install 586753a1a87SJed Brown 587753a1a87SJed Brownpetscao : petscmat petscao.f90.h 588753a1a87SJed Brownpetscdm : petscksp petscdm.f90.h 589753a1a87SJed Brownpetscdraw : petsc petscdraw.f90.h 590753a1a87SJed Brownpetscis : petsc petscis.f90.h 591753a1a87SJed Brownpetscksp : petscpc petscksp.f90.h 592753a1a87SJed Brownpetsclog : petsc petsclog.f90.h 593753a1a87SJed Brownpetscmat : petscvec petscmat.f90.h 594753a1a87SJed Brownpetscmg : petscksp petscmg.f90.h 595753a1a87SJed Brownpetscpc : petscmat petscpc.f90.h 596753a1a87SJed Brownpetscsnes : petscksp petscsnes.f90.h 597753a1a87SJed Brownpetscsys : petsc petscsys.f90.h 598753a1a87SJed Brownpetscts : petscsnes petscts.f90.h 599753a1a87SJed Brownpetsc : petsc.f90.h 600753a1a87SJed Brownpetscvec : petscis petscvec.f90.h 601753a1a87SJed Brownpetscviewer : petsc petscviewer.f90.h 602753a1a87SJed Brownpetscmesh : petsc petscmesh.f90.h 603753a1a87SJed Brownmodules : petscao petscdm petscdraw petscis petscksp petsclog petscmat petscmg petscpc petscsnes petscsys petscts petsc petscvec petscviewer petscmesh 604