1# $Id: makefile,v 1.347 2001/04/05 20:41:57 balay Exp bsmith $ 2# 3# This is the makefile for installing PETSc. See the file 4# docs/installation.html for directions on installing PETSc. 5# See also bmake/common for additional commands. 6# 7ALL: all 8LOCDIR = . 9DIRS = src include docs 10 11include ${PETSC_DIR}/bmake/${PETSC_ARCH}/base 12include ${PETSC_DIR}/bmake/common_test 13 14# 15# Basic targets to build PETSc libraries. 16# all : builds the c, fortran, and f90 libraries 17all : info info_h chklib_dir deletelibs build shared 18# 19# Prints information about the system and version of PETSc being compiled 20# 21info: 22 -@echo "==========================================" 23 -@echo " " 24 -@echo "See docs/troubleshooting.html and docs/bugreporting.html" 25 -@echo "for help with installation problems. Please send EVERYTHING" 26 -@echo "printed out below when reporting problems" 27 -@echo " " 28 -@echo "To subscribe to the PETSc users mailing list, send mail to " 29 -@echo "majordomo@mcs.anl.gov with the message: " 30 -@echo "subscribe petsc-users" 31 -@echo " " 32 -@echo "==========================================" 33 -@echo On `date` on `hostname` 34 -@echo Machine characteristics: `uname -a` 35 -@echo "-----------------------------------------" 36 -@echo "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS}" 37 -@if [ -n "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \ 38 echo "C Compiler version:" ; ${C_CCV} ; fi 39 -@if [ -n "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \ 40 echo "C++ Compiler version:" ; ${CXX_CCV} ; fi 41 -@echo "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}" 42 -@if [ -n "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \ 43 echo "Fortran Compiler version:" ; ${C_FCV} ; fi 44 -@echo "-----------------------------------------" 45 -@grep PETSC_VERSION_NUMBER ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" 46 -@echo "-----------------------------------------" 47 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 48 -@echo "-----------------------------------------" 49 -@echo "Using configuration flags:" 50 -@grep "define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h 51 -@echo "-----------------------------------------" 52 -@echo "Using include paths: ${PETSC_INCLUDE}" 53 -@echo "-----------------------------------------" 54 -@echo "Using PETSc directory: ${PETSC_DIR}" 55 -@echo "Using PETSc arch: ${PETSC_ARCH}" 56 -@echo "------------------------------------------" 57 -@echo "Using C linker: ${CLINKER}" 58 -@echo "Using Fortran linker: ${FLINKER}" 59 -@echo "Using libraries: ${PETSC_LIB}" 60 -@echo "==========================================" 61# 62# 63MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h 64info_h: 65 -@$(RM) -f MINFO ${MINFO} 66 -@echo "static char *petscmachineinfo = \" " >> MINFO 67 -@echo "Libraries compiled on `date` on `hostname` " >> MINFO 68 -@echo Machine characteristics: `uname -a` "" >> MINFO 69 -@echo "Using PETSc directory: ${PETSC_DIR}" >> MINFO 70 -@echo "Using PETSc arch: ${PETSC_ARCH}" >> MINFO 71 -@echo "-----------------------------------------\"; " >> MINFO 72 -@echo "static char *petsccompilerinfo = \" " >> MINFO 73 -@echo "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO 74 -@if [ "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \ 75 echo "C Compiler version:" >> MINFO ; ${C_CCV} >> MINFO 2>&1; fi 76 -@if [ "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \ 77 echo "C++ Compiler version:" >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; fi 78 -@echo "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO 79 -@if [ "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \ 80 echo "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; fi 81 -@echo "-----------------------------------------\"; " >> MINFO 82 -@echo "static char *petsccompilerflagsinfo = \" " >> MINFO 83 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO 84 -@echo "-----------------------------------------" >> MINFO 85 -@echo "Using configuration flags:" >> MINFO 86 -@echo "-----------------------------------------" >> MINFO 87 -@echo "Using include paths: ${PETSC_INCLUDE}" >> MINFO 88 -@echo "------------------------------------------\"; " >> MINFO 89 -@echo "static char *petsclinkerinfo = \" " >> MINFO 90 -@echo "Using C linker: ${CLINKER}" >> MINFO 91 -@echo "Using Fortran linker: ${FLINKER}" >> MINFO 92 -@echo "Using libraries: ${PETSC_LIB} \"; " >> MINFO 93 -@cat MINFO | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\; \\n\\/\;/'> ${MINFO} 94 -@chmod g+w ${MINFO} 95 -@$(RM) MINFO 96# 97# Builds the PETSc libraries 98# This target also builds fortran77 and f90 interface 99# files and compiles .F files 100# 101build: 102 -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 103 -@echo "=========================================" 104 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 105 ${RANLIB} ${PETSC_LIB_DIR}/*.a 106 -@chmod g+w ${PETSC_LIB_DIR}/*.a 107 -@echo "Completed building libraries" 108 -@echo "=========================================" 109# 110# Builds PETSc test examples for a given BOPT and architecture 111# 112testexamples: info chkopts 113 -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 114 -@echo "Due to different numerical round-off on certain" 115 -@echo "machines some of the numbers may not match exactly." 116 -@echo "=========================================" 117 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1 tree 118 -@echo "Completed compiling and running test examples" 119 -@echo "=========================================" 120testfortran: info chkopts 121 -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 122 -@echo "=========================================" 123 -@echo "Due to different numerical round-off on certain" 124 -@echo "machines or the way Fortran formats numbers" 125 -@echo "some of the results may not match exactly." 126 -@echo "=========================================" 127 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3 tree 128 -@echo "Completed compiling and running Fortran test examples" 129 -@echo "=========================================" 130testexamples_uni: info chkopts 131 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 132 -@echo "Due to different numerical round-off on certain" 133 -@echo "machines some of the numbers may not match exactly." 134 -@echo "=========================================" 135 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4 tree 136 -@echo "Completed compiling and running uniprocessor test examples" 137 -@echo "=========================================" 138testfortran_uni: info chkopts 139 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES" 140 -@echo "Due to different numerical round-off on certain" 141 -@echo "machines some of the numbers may not match exactly." 142 -@echo "=========================================" 143 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9 tree 144 -@echo "Completed compiling and running uniprocessor fortran test examples" 145 -@echo "=========================================" 146 147# Ranlib on the libraries 148ranlib: 149 ${RANLIB} ${PETSC_LIB_DIR}/*.a 150 151# Deletes PETSc libraries 152deletelibs: chkopts_basic 153 -${RM} -f ${PETSC_LIB_DIR}/* 154 155# 156# Updates your PETSc version to the latest set of patches 157# 158update: 159 -@bin/petscupdate 160 161# ------------------------------------------------------------------ 162# 163# All remaining actions are intended for PETSc developers only. 164# PETSc users should not generally need to use these commands. 165# 166 167# To access the tags in EMACS, type M-x visit-tags-table and specify 168# the file petsc/TAGS. 169# 1) To move to where a PETSc function is defined, enter M-. and the 170# function name. 171# 2) To search for a string and move to the first occurrence, 172# use M-x tags-search and the string. 173# To locate later occurrences, use M-, 174# Builds all etags files 175alletags: 176 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags 177 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_complete 178 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples 179 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples 180 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles 181# Builds the basic etags file. This should be employed by most users. 182etags: 183 -${RM} ${TAGSDIR}/TAGS 184 -touch ${TAGSDIR}/TAGS 185 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree 186 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree 187 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree 188 -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree 189 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree 190 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree 191 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree 192 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree 193 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree 194 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles 195 -chmod g+w TAGS 196# Builds complete etags list; only for PETSc developers. 197etags_complete: 198 -${RM} ${TAGSDIR}/TAGS_COMPLETE 199 -touch ${TAGSDIR}/TAGS_COMPLETE 200 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcec alltree 201 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcej alltree 202 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourceh alltree 203 -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcef alltree 204 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesc alltree 205 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesf alltree 206 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesch alltree 207 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesfh alltree 208 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_makefile alltree 209 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE etags_bmakefiles 210 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_docs alltree 211 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_scripts alltree 212 -chmod g+w TAGS_COMPLETE 213# Builds the etags file that excludes the examples directories 214etags_noexamples: 215 -${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES 216 -touch ${TAGSDIR}/TAGS_NO_EXAMPLES 217 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree 218 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree 219 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree 220 -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree 221 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree 222 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles 223 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree 224 -chmod g+w TAGS_NO_EXAMPLES 225# Builds the etags file for makefiles 226etags_makefiles: 227 -${RM} ${TAGSDIR}/TAGS_MAKEFILES 228 -touch ${TAGSDIR}/TAGS_MAKEFILES 229 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree 230 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles 231 -chmod g+w TAGS_MAKEFILES 232# Builds the etags file for examples 233etags_examples: 234 -${RM} ${TAGSDIR}/TAGS_EXAMPLES 235 -touch ${TAGSDIR}/TAGS_EXAMPLES 236 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree 237 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree 238 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree 239 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree 240 -chmod g+w TAGS_EXAMPLES 241etags_fexamples: 242 -${RM} ${TAGSDIR}/TAGS_FEXAMPLES 243 -touch ${TAGSDIR}/TAGS_FEXAMPLES 244 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree 245 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree 246 -chmod g+w TAGS_FEXAMPLES 247# 248# These are here for the target allci and allco, and etags 249# 250 251BMAKEFILES = bmake/common* bmake/*/base bmake/*/base_variables bmake/*/base.site \ 252 bmake/*/petscconf.h bmake/*/petscfix.h bmake/win32/makefile.dos bmake/config/*.in \ 253 bmake/*/buildtest 254DOCS = bmake/readme bmake/petscconf.defs 255SCRIPTS = maint/addlinks maint/builddist maint/buildlinks maint/wwwman \ 256 maint/xclude maint/crontab \ 257 maint/autoftp include/foldinclude/generateincludes 258 259updatewebdocs: 260 -chmod -R ug+w /mcs/tmp/petsc-tmp 261 -chgrp -R petsc /mcs/tmp/petsc-tmp 262 -/bin/rm -rf /mcs/tmp/petscdocs 263 -/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs 264 -maint/update-docs.py /mcs/tmp/petscdocs 265 -find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \; 266 -/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs 267 -/bin/rm -rf /mcs/tmp/petscdocs 268 269# Builds all the documentation - should be done every night 270alldoc: allmanualpages 271 cd docs/tex/manual; ${OMAKE} manual.dvi manual.ps manual.html splitmanual.html 272 273# Deletes man pages (HTML version) 274deletemanualpages: 275 ${RM} -f ${LOC}/docs/manualpages/*/*.html \ 276 ${LOC}/docs/manualpages/manualpages.cit 277 278# Builds all versions of the man pages 279allmanualpages: deletemanualpages 280 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 281 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 282 -maint/wwwindex.py ${PETSC_DIR} ${LOC} 283 -${OMAKE} ACTION=manexamples tree LOC=${LOC} 284 -${OMAKE} manconcepts LOC=${LOC} 285 -${OMAKE} ACTION=getexlist tree LOC=${LOC} 286 -${OMAKE} ACTION=exampleconcepts tree LOC=${LOC} 287 -maint/helpindex.py ${PETSC_DIR} ${LOC} 288 -@chmod g+w ${LOC}/docs/manualpages/*/*.html 289 290# Builds .html versions of the source 291allhtml: 292 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} tree LOC=${LOC} 293 294allcleanhtml: 295 -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} tree 296 297# Builds Fortran stub files 298allfortranstubs: 299 -@include/foldinclude/generateincludes 300 -@${RM} -f src/fortran/auto/*.c 301 -${OMAKE} ACTION=fortranstubs tree_basic 302 -@cd src/fortran/auto; ${OMAKE} fixfortran 303 chmod g+w src/fortran/auto/*.c 304 305allci: 306 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci alltree 307 308allco: 309 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co alltree 310 311# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28 312allrcslabel: 313 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel alltree 314# 315# The commands below are for generating ADIC versions of the code; 316# they are not currently used. 317# 318alladicignore: 319 -@${RM} ${INSTALL_LIB_DIR}/adicignore 320 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore tree 321 322alladic: 323 -@echo "Beginning to compile ADIC source code in all directories" 324 -@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}" 325 -@echo "=========================================" 326 -@cd include ; \ 327 ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h 328 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 329 -@cd src/inline ; \ 330 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic 331 -@cd src/blaslapack ; \ 332 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 333 334alladiclib: 335 -@echo "Beginning to compile ADIC libraries in all directories" 336 -@echo "Using compiler: ${CC} ${COPTFLAGS}" 337 -@echo "-----------------------------------------" 338 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 339 -@echo "-----------------------------------------" 340 -@echo "Using configuration flags:" 341 -@grep "define " bmake/${PETSC_ARCH}/petscconf.h 342 -@echo "-----------------------------------------" 343 -@echo "Using include paths: ${PETSC_INCLUDE}" 344 -@echo "-----------------------------------------" 345 -@echo "Using PETSc directory: ${PETSC_DIR}" 346 -@echo "Using PETSc arch: ${PETSC_ARCH}" 347 -@echo "=========================================" 348 -@${RM} -f ${INSTALL_LIB_DIR}/*adic.a 349 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 350 -@cd src/blaslapack ; \ 351 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 352 -@cd src/adic/src ; \ 353 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib 354 355# ------------------------------------------------------------------------------- 356# 357# Some macros to check if the fortran interface is up-to-date. 358# 359countfortranfunctions: 360 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 361 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 362 sed "s/_$$//" | sort > /tmp/countfortranfunctions 363 364countcfunctions: 365 -@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \ 366 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 367 tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 368 369difffortranfunctions: countfortranfunctions countcfunctions 370 -@echo -------------- Functions missing in the fortran interface --------------------- 371 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 372 -@echo ----------------- Functions missing in the C interface ------------------------ 373 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 374 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 375 376checkbadfortranstubs: 377 -@echo "=========================================" 378 -@echo "Functions with MPI_Comm as an Argument" 379 -@echo "=========================================" 380 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 381 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 382 -@echo "=========================================" 383 -@echo "Functions with a String as an Argument" 384 -@echo "=========================================" 385 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 386 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 387 -@echo "=========================================" 388 -@echo "Functions with Pointers to PETSc Objects as Argument" 389 -@echo "=========================================" 390 -@cd ${PETSC_DIR}/src/fortran/auto; \ 391 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 392 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 393 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 394 for OBJ in $$_p_OBJ; do \ 395 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 396 cut -d'(' -f1 | cut -d' ' -f1,3; \ 397 done 398# Builds noise routines (not yet publically available) 399# Note: libfast cannot run on .F files on certain machines, so we 400# use lib and check for errors here. 401noise: info chklib_dir 402 -@echo "Beginning to compile noise routines" 403 -@echo "=========================================" 404 -@cd src/snes/interface/noise; \ 405 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib > trashz 2>&1; \ 406 grep -v clog trashz | grep -v "information sections" | \ 407 egrep -i '(Error|warning|Can)' >> /dev/null;\ 408 if [ "$$?" != 1 ]; then \ 409 cat trashz ; fi; ${RM} trashz 410 ${RANLIB} ${INSTALL_LIB_DIR}/libpetscsnes.a 411 -@chmod g+w ${INSTALL_LIB_DIR}/libpetscsnes.a 412 -@echo "Completed compiling noise routines" 413 -@echo "=========================================" 414 415# 416# Automatically generates PETSc exercises in html from the tutorial examples. 417# 418# The introduction for each section is obtained from docs/manualpages/bop.${MANSEC} is under RCS and may be edited 419# (used also in introductions to the manual pages) 420# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited 421# The list of exercises is from TUTORIALS in each directory's makefile 422# 423# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced. 424# The pagemaker rule is in the file bmake/common (at the bottom) 425# 426# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 427# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 428# 429exercises: 430 -@echo "=========================================" 431 -@echo "Generating HTML tutorial exercises" 432 -@${RM} docs/pageform.txt 433 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 434 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 435 -@echo "access_format=short" >> docs/pageform.txt 436 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 437 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 438 -@echo "Generating HTML for individual directories" 439 -@echo "=========================================" 440 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 441 -@echo "Completed HTML for individual directories" 442 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 443 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 444 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 445 -@echo "=========================================" 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462