1# 2# This is the makefile for installing PETSc. See the file 3# docs/website/documentation/installation.html for directions on installing PETSc. 4# See also bmake/common for additional commands. 5# 6ALL: all 7LOCDIR = . 8DIRS = src include docs 9 10include ${PETSC_DIR}/bmake/common/base 11include ${PETSC_DIR}/bmake/common/test 12 13# 14# Basic targets to build PETSc libraries. 15# all: builds the c, fortran, and f90 libraries 16all: 17 @${OMAKE} PETSC_ARCH=${PETSC_ARCH} BOPT=${BOPT} chkpetsc_dir 18 -@${MAKE} all_build 2>&1 | tee make_log_${PETSC_ARCH}_${BOPT} 19all_build: chk_petsc_dir chk_default_bopt info info_h chklib_dir deletelibs chk_fortranstubs blaslapack mpich build shared 20# 21# Prints information about the system and version of PETSc being compiled 22# 23info: 24 -@echo "==========================================" 25 -@echo " " 26 -@echo "See docs/troubleshooting.html and docs/bugreporting.html" 27 -@echo "for help with installation problems. Please send EVERYTHING" 28 -@echo "printed out below when reporting problems" 29 -@echo " " 30 -@echo "To subscribe to the PETSc users mailing list, send mail to " 31 -@echo "majordomo@mcs.anl.gov with the message: " 32 -@echo "subscribe petsc-announce" 33 -@echo " " 34 -@echo "==========================================" 35 -@echo On `date` on `hostname` 36 -@echo Machine characteristics: `uname -a` 37 -@echo "-----------------------------------------" 38 -@echo "Using C/C++ compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS}" 39 -@echo "C/C++ Compiler version: " `${C_CCV}` 40 -@if [ "${C_FC}" != "" ]; then \ 41 echo "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}";\ 42 echo "Fortran Compiler version: " `${C_FCV}`;\ 43 fi 44 -@echo "-----------------------------------------" 45 -@grep "define PETSC_VERSION" ${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/C++ linker: ${CLINKER}" 58 -@if [ "${C_FC}" != "" ]; then \ 59 echo "Using Fortran linker: ${FLINKER}";\ 60 fi 61 -@echo "Using libraries: ${PETSC_LIB}" 62 -@echo "------------------------------------------" 63 -@echo "Using mpirun: ${MPIRUN}" 64 -@echo "==========================================" 65# 66# 67MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h 68info_h: 69 -@$(RM) -f MINFO ${MINFO} 70 -@echo "static const char *petscmachineinfo = \" " >> MINFO 71 -@echo "Libraries compiled on `date` on `hostname` " >> MINFO 72 -@echo Machine characteristics: `uname -a` "" >> MINFO 73 -@echo "Using PETSc directory: ${PETSC_DIR}" >> MINFO 74 -@echo "Using PETSc arch: ${PETSC_ARCH}" >> MINFO 75 -@echo "-----------------------------------------\"; " >> MINFO 76 -@echo "static const char *petsccompilerinfo = \" " >> MINFO 77 -@echo "Using C compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO 78 -@echo "C Compiler version:" >> MINFO ; ${C_CCV} >> MINFO 2>&1 ; true 79 -@echo "C++ Compiler version:" >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; true 80 -@echo "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO 81 -@echo "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; true 82 -@echo "-----------------------------------------\"; " >> MINFO 83 -@echo "static const char *petsccompilerflagsinfo = \" " >> MINFO 84 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO 85 -@echo "-----------------------------------------" >> MINFO 86 -@echo "Using configuration flags:" >> MINFO 87 -@echo "-----------------------------------------" >> MINFO 88 -@echo "Using include paths: ${PETSC_INCLUDE}" >> MINFO 89 -@echo "------------------------------------------\"; " >> MINFO 90 -@echo "static const char *petsclinkerinfo = \" " >> MINFO 91 -@echo "Using C linker: ${CLINKER}" >> MINFO 92 -@echo "Using Fortran linker: ${FLINKER}" >> MINFO 93 -@echo "Using libraries: ${PETSC_LIB} \"; " >> MINFO 94 -@cat MINFO | ${SED} -e 's/\ 95//g' | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\; \\n\\/\;/'> ${MINFO} 96 -@$(RM) MINFO 97 98# 99# Builds the PETSc libraries 100# This target also builds fortran77 and f90 interface 101# files and compiles .F files 102# 103build: 104 -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 105 -@echo "=========================================" 106 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 107 -@${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX} 108 -@echo "Completed building libraries" 109 -@echo "=========================================" 110# 111# Compiles the blas and lapack source code if found 112blaslapack: 113 -@if [ -d packages/f2cblaslapack/${PETSC_ARCH} -a ! -s packages/f2cblaslapack/${PETSC_ARCH}/libf2cblas.a ] ; then cd packages/f2cblaslapack;\ 114 echo "=========================================";\ 115 echo "Building C Blas/Lapack libraries";\ 116 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ;\ 117 ${MV} libf2cblas.a libf2clapack.a ${PETSC_ARCH};\ 118 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleanblaslapack ;\ 119 echo "Completed C building Blas/Lapack libraries";\ 120 echo "========================================="; fi 121 -@if [ -d packages/fblaslapack/${PETSC_ARCH} -a ! -s packages/fblaslapack/${PETSC_ARCH}/libfblas.a ] ; then cd packages/fblaslapack;\ 122 echo "=========================================";\ 123 echo "Building Fortran Blas/Lapack libraries";\ 124 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ;\ 125 ${MV} libfblas.a libflapack.a ${PETSC_ARCH};\ 126 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleanblaslapck ;\ 127 echo "Completed building Fortran Blas/Lapack libraries";\ 128 echo "========================================="; fi 129# 130# Compiles MPICH if found 131mpich: 132 -@releasename=`ls -d packages/mpich* 2> /dev/null`;\ 133 if [ -d packages/$${releasename}/${PETSC_ARCH} -a ! -d packages/$${releasename}/${PETSC_ARCH}/lib ] ; then cd packages/$${releasename} ;\ 134 echo "=========================================";\ 135 echo "Compiling and installing " $${releasename};\ 136 make; make install; \ 137 echo "=========================================";\ 138 fi; 139# 140# Builds PETSc test examples for a given BOPT and architecture 141# 142test: chkopts 143 -@echo "Running test examples to verify correct installation" 144 @cd src/snes/examples/tutorials; ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex19 145 @if [ "${C_FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex5f; fi; 146 -@echo "Completed test examples" 147 148testexamples: info chkopts 149 -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 150 -@echo "Due to different numerical round-off on certain" 151 -@echo "machines some of the numbers may not match exactly." 152 -@echo "=========================================" 153 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1 tree 154 -@echo "Completed compiling and running test examples" 155 -@echo "=========================================" 156testfortran: info chkopts 157 -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 158 -@echo "=========================================" 159 -@echo "Due to different numerical round-off on certain" 160 -@echo "machines or the way Fortran formats numbers" 161 -@echo "some of the results may not match exactly." 162 -@echo "=========================================" 163 -@if [ "${C_FC}" != "" ]; then \ 164 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3 tree; \ 165 echo "Completed compiling and running Fortran test examples"; \ 166 else \ 167 echo "Error: No FORTRAN compiler available"; \ 168 fi 169 -@echo "=========================================" 170testexamples_uni: info chkopts 171 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 172 -@echo "Due to different numerical round-off on certain" 173 -@echo "machines some of the numbers may not match exactly." 174 -@echo "=========================================" 175 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4 tree 176 -@echo "Completed compiling and running uniprocessor test examples" 177 -@echo "=========================================" 178testfortran_uni: info chkopts 179 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES" 180 -@echo "Due to different numerical round-off on certain" 181 -@echo "machines some of the numbers may not match exactly." 182 -@echo "=========================================" 183 -@if [ "${C_FC}" != "" ]; then \ 184 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9 tree; \ 185 echo "Completed compiling and running uniprocessor fortran test examples"; \ 186 else \ 187 echo "Error: No FORTRAN compiler available"; \ 188 fi 189 -@ 190 -@echo "=========================================" 191 192# Ranlib on the libraries 193ranlib: 194 ${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX} 195 196# Deletes PETSc libraries 197deletelibs: chkopts_basic 198 -${RM} -f ${PETSC_LIB_DIR}/* 199 200# Cleans up build 201allclean: deletelibs 202 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree 203 204 205# 206# Check if PETSC_DIR variable specified is valid 207# 208chk_petsc_dir: 209 @if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \ 210 echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \ 211 echo "You need to use / to separate directories, not \\!"; \ 212 echo "Aborting build"; \ 213 false; fi 214# 215# ${PETSC_DIR}/bmake/common/bopt_ is generated by configure - but if non-configure PETSC_ARCH 216# is used - create this file manually when libraries are created. 217# 218chk_default_bopt: 219 @if [ ! -f ${PETSC_DIR}/bmake/common/bopt_ ]; then \ 220 echo "BOPT=$$BOPT" > ${PETSC_DIR}/bmake/common/bopt_ ;\ 221 fi 222install: 223 -@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \ 224 echo "Install directory is current directory; nothing needs to be done";\ 225 else \ 226 echo Installing PETSc at ${INSTALL_DIR};\ 227 if [ ! -d `dirname ${INSTALL_DIR}` ]; then \ 228 mkdir `dirname ${INSTALL_DIR}` ; \ 229 fi;\ 230 if [ ! -d ${INSTALL_DIR} ]; then \ 231 mkdir ${INSTALL_DIR} ; \ 232 fi;\ 233 cp -fr include ${INSTALL_DIR};\ 234 if [ ! -d ${INSTALL_DIR}/bmake ]; then \ 235 mkdir ${INSTALL_DIR}/bmake ; \ 236 fi;\ 237 cp -f bmake/adic* bmake/variables ${INSTALL_DIR}/bmake ; \ 238 cp -fr bmake/common ${INSTALL_DIR}/bmake;\ 239 cp -fr bmake/${PETSC_ARCH} ${INSTALL_DIR}/bmake;\ 240 cp -fr bin ${INSTALL_DIR};\ 241 if [ ! -d ${INSTALL_DIR}/lib ]; then \ 242 mkdir ${INSTALL_DIR}/lib ; \ 243 fi;\ 244 for i in lib/lib*; do \ 245 bopt=`echo $${i} | ${SED} s=lib/lib==g`;\ 246 if [ ! -d ${INSTALL_DIR}/$${i} ]; then \ 247 mkdir ${INSTALL_DIR}/$${i};\ 248 fi; \ 249 if [ -d $${i}/${PETSC_ARCH} ]; then \ 250 cp -fr $${i}/${PETSC_ARCH} ${INSTALL_DIR}/$${i};\ 251 ${RANLIB} ${INSTALL_DIR}/$${i}/*.a > /dev/null 2>&1 ;\ 252 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${INSTALL_DIR} BOPT=$${bopt} shared; \ 253 fi;\ 254 done;\ 255 echo "sh/bash: PETSC_DIR="${INSTALL_DIR}"; export PETSC_DIR";\ 256 echo "csh/tcsh: setenv PETSC_DIR "${INSTALL_DIR} ;\ 257 echo "The do make test to verify correct install";\ 258 fi; 259 260install_src: 261 -@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \ 262 echo "You did not set a directory to install to";\ 263 else \ 264 echo Installing PETSc source at ${INSTALL_DIR};\ 265 if [ ! -d `dirname ${INSTALL_DIR}` ]; then \ 266 mkdir `dirname ${INSTALL_DIR}` ; \ 267 fi;\ 268 if [ ! -d ${INSTALL_DIR} ]; then \ 269 mkdir ${INSTALL_DIR} ; \ 270 fi;\ 271 cp -fr src ${INSTALL_DIR};\ 272 fi; 273 274install_docs: 275 -@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \ 276 echo "You did not set a directory to install to";\ 277 else \ 278 echo Installing PETSc documentation at ${INSTALL_DIR};\ 279 if [ ! -d `dirname ${INSTALL_DIR}` ]; then \ 280 mkdir `dirname ${INSTALL_DIR}` ; \ 281 fi;\ 282 if [ ! -d ${INSTALL_DIR} ]; then \ 283 mkdir ${INSTALL_DIR} ; \ 284 fi;\ 285 cp -fr docs ${INSTALL_DIR};\ 286 ${RM} -fr docs/tex;\ 287 fi; 288# ------------------------------------------------------------------ 289# 290# All remaining actions are intended for PETSc developers only. 291# PETSc users should not generally need to use these commands. 292# 293 294# To access the tags in EMACS, type M-x visit-tags-table and specify 295# the file petsc/TAGS. 296# 1) To move to where a PETSc function is defined, enter M-. and the 297# function name. 298# 2) To search for a string and move to the first occurrence, 299# use M-x tags-search and the string. 300# To locate later occurrences, use M-, 301# Builds all etags files 302alletags: 303 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags 304 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples 305 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples 306 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles 307# Builds complete etags list 308etags: 309 -@${RM} ${TAGSDIR}/TAGS 310 -@touch ${TAGSDIR}/TAGS 311 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION="etags_sourcec etags_sourcej etags_sourceh etags_examplesc etags_examplesf etags_examplesch etags_examplesfh etags_makefile etags_docs etags_scripts" alltree 312 -@cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree 313 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles 314# Builds the etags file that excludes the examples directories 315etags_noexamples: 316 -@${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES 317 -@touch ${TAGSDIR}/TAGS_NO_EXAMPLES 318 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION="etags_sourcec etags_sourcej etags_sourceh etags_makefile etags_docs" alltree 319 -@cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree 320 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles 321# Builds the etags file for makefiles 322etags_makefiles: 323 -@${RM} ${TAGSDIR}/TAGS_MAKEFILES 324 -@touch ${TAGSDIR}/TAGS_MAKEFILES 325 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree 326 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles 327# Builds the etags file for examples 328etags_examples: 329 -@${RM} ${TAGSDIR}/TAGS_EXAMPLES 330 -@touch ${TAGSDIR}/TAGS_EXAMPLES 331 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION="etags_examplesc etags_examplesch etags_examplesf etags_examplesfh" alltree 332etags_fexamples: 333 -@${RM} ${TAGSDIR}/TAGS_FEXAMPLES 334 -@touch ${TAGSDIR}/TAGS_FEXAMPLES 335 -@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION="etags_examplesf etags_examplesfh" alltree 336# 337# These are here for the target allci and allco, and etags 338# 339 340BMAKEFILES = bmake/common/base bmake/common/test \ 341 bmake/common/bopt* bmake/*/rules bmake/*/variables bmake/*/packages \ 342 bmake/*/petscconf.h bmake/*/petscfix.h bmake/config/packages.in \ 343 bmake/config/petscfix.h.in bmake/config/rules.in \ 344 bmake/config/variables.in bmake/adic.init bmake/adicmf.init 345DOCS = bmake/readme bmake/petscconf.defs 346SCRIPTS = maint/builddist maint/wwwman maint/xclude python/PETSc/Configure.py python/PETSc/Options.py \ 347 python/PETSc/packages/ADIC.py python/PETSc/packages/MPE.py python/PETSc/packages/Mathematica.py \ 348 python/PETSc/packages/PLAPACK.py python/PETSc/packages/Triangle.py python/PETSc/packages/Matlab.py \ 349 python/PETSc/packages/PVODE.py python/PETSc/packages/BlasLapack.py python/PETSc/packages/MPI.py \ 350 python/PETSc/packages/BlockSolve.py python/PETSc/packages/NetCDF.py python/PETSc/packages/ParMetis.py \ 351 python/PETSc/packages/update.py maint/confignightly/* config/*.py 352 353 354updatewebdocs: 355 -chmod -R ug+w /mcs/tmp/petsc-tmp 356 -chgrp -R petsc /mcs/tmp/petsc-tmp 357 -/bin/rm -rf /mcs/tmp/petscdocs 358 -/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs 359 -maint/update-docs.py /mcs/tmp/petscdocs 360 -find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \; 361 -/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs 362 -/bin/rm -rf /mcs/tmp/petscdocs 363 364chk_loc: 365 @if [ ${LOC}foo = foo ] ; then \ 366 echo "*********************** ERROR ************************" ; \ 367 echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \ 368 echo "******************************************************"; false; fi 369 370# Builds all the documentation - should be done every night 371alldoc: alldoc1 alldoc2 372 373# Build everything that goes into 'doc' dir except html sources 374alldoc1: chk_loc deletemanualpages chk_concepts_dir 375 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 376 cd docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 377 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 378 -maint/wwwindex.py ${PETSC_DIR} ${LOC} 379 -${OMAKE} ACTION=manexamples tree LOC=${LOC} 380 -${OMAKE} manconcepts LOC=${LOC} 381 -${OMAKE} ACTION=getexlist tree LOC=${LOC} 382 -${OMAKE} ACTION=exampleconcepts tree LOC=${LOC} 383 -maint/helpindex.py ${PETSC_DIR} ${LOC} 384 385# Builds .html versions of the source 386# html overwrites some stuff created by update-docs - hence this is done later. 387alldoc2: chk_loc 388 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 389 -maint/update-docs.py ${LOC} 390 391alldocclean: deletemanualpages allcleanhtml 392 393# Deletes man pages (HTML version) 394deletemanualpages: chk_loc 395 -@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \ 396 find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\ 397 ${RM} ${LOC}/docs/tex/exampleconcepts ;\ 398 ${RM} ${LOC}/docs/tex/manconcepts ;\ 399 ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\ 400 -maint/update-docs.py ${LOC} clean;\ 401 fi 402 403allcleanhtml: 404 -${RM} include/adic/*.h.html include/esi/petsc/*.h.html 405 -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 406 407chk_concepts_dir: chk_loc 408 @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 409 echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 410# 411# checks if should build Fortran stubs 412chk_fortranstubs: 413 -@if [ ! -f "${PETSC_DIR}/src/fortran/auto/makefile.src" -a "${C_FC}" != "" ]; then \ 414 ${OMAKE} PETSC_DIR=${PETSC_DIR} allfortranstubs ;\ 415 fi 416 417# Builds Fortran stub files 418allfortranstubs: 419 -@which ${BFORT} > /dev/null 2>&1; \ 420 if [ "$$?" != "0" ]; then \ 421 echo "No bfort available, skipping building Fortran stubs";\ 422 else \ 423 ${RM} -f ${PETSC_DIR}/src/fortran/auto/*.c ;\ 424 touch ${PETSC_DIR}/src/fortran/auto/makefile.src ;\ 425 ${OMAKE} ACTION=fortranstubs tree_basic ;\ 426 cd ${PETSC_DIR}/src/fortran/auto; ${RM} makefile.src; echo SOURCEC = ` ls *.c | tr -s '\n' ' '` > makefile.src ;\ 427 cd ${PETSC_DIR}/src/fortran/auto; ${OMAKE} fixfortran ;\ 428 fi 429 430allci: 431 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci alltree 432 433allco: 434 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co alltree 435 436# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28 437allrcslabel: 438 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel alltree 439# 440# The commands below are for generating ADIC versions of the code; 441# they are not currently used. 442# 443alladicignore: 444 -@${RM} ${INSTALL_LIB_DIR}/adicignore 445 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore tree 446 447alladic: 448 -@echo "Beginning to compile ADIC source code in all directories" 449 -@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}" 450 -@echo "=========================================" 451 -@cd include ; \ 452 ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h 453 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 454 -@cd src/inline ; \ 455 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic 456 -@cd src/blaslapack ; \ 457 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 458 459alladiclib: 460 -@echo "Beginning to compile ADIC libraries in all directories" 461 -@echo "Using compiler: ${CC} ${COPTFLAGS}" 462 -@echo "-----------------------------------------" 463 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 464 -@echo "-----------------------------------------" 465 -@echo "Using configuration flags:" 466 -@grep "define " bmake/${INLUDE_ARCH}/petscconf.h 467 -@echo "-----------------------------------------" 468 -@echo "Using include paths: ${PETSC_INCLUDE}" 469 -@echo "-----------------------------------------" 470 -@echo "Using PETSc directory: ${PETSC_DIR}" 471 -@echo "Using PETSc arch: ${PETSC_ARCH}" 472 -@echo "=========================================" 473 -@${RM} -f ${INSTALL_LIB_DIR}/*adic.${LIB_SUFFIX} 474 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 475 -@cd src/blaslapack ; \ 476 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 477 -@cd src/adic/src ; \ 478 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib 479 480# ------------------------------------------------------------------------------- 481# 482# Some macros to check if the fortran interface is up-to-date. 483# 484countfortranfunctions: 485 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 486 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 487 sed "s/_$$//" | sort > /tmp/countfortranfunctions 488 489countcfunctions: 490 -@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \ 491 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 492 tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 493 494difffortranfunctions: countfortranfunctions countcfunctions 495 -@echo -------------- Functions missing in the fortran interface --------------------- 496 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 497 -@echo ----------------- Functions missing in the C interface ------------------------ 498 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 499 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 500 501checkbadfortranstubs: 502 -@echo "=========================================" 503 -@echo "Functions with MPI_Comm as an Argument" 504 -@echo "=========================================" 505 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 506 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 507 -@echo "=========================================" 508 -@echo "Functions with a String as an Argument" 509 -@echo "=========================================" 510 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 511 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 512 -@echo "=========================================" 513 -@echo "Functions with Pointers to PETSc Objects as Argument" 514 -@echo "=========================================" 515 -@cd ${PETSC_DIR}/src/fortran/auto; \ 516 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 517 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 518 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 519 for OBJ in $$_p_OBJ; do \ 520 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 521 cut -d'(' -f1 | cut -d' ' -f1,3; \ 522 done 523# 524# Automatically generates PETSc exercises in html from the tutorial examples. 525# 526# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited 527# (used also in introductions to the manual pages) 528# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited 529# The list of exercises is from TUTORIALS in each directory's makefile 530# 531# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced. 532# The pagemaker rule is in the file bmake/common (at the bottom) 533# 534# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 535# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 536# 537exercises: 538 -@echo "=========================================" 539 -@echo "Generating HTML tutorial exercises" 540 -@${RM} docs/pageform.txt 541 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 542 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 543 -@echo "access_format=short" >> docs/pageform.txt 544 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 545 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 546 -@echo "Generating HTML for individual directories" 547 -@echo "=========================================" 548 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 549 -@echo "Completed HTML for individual directories" 550 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 551 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 552 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 553 -@echo "=========================================" 554 555# Make a tarball of all the Python code 556# This is currently used to release to the Teragrid 557petscPython.tgz: 558 @tar cvzf $@ --exclude SCCS --exclude BitKeeper --dereference python/ 559 -@scp $@ tg-login2.uc.teragrid.org:./ 560 561.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \ 562 alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \ 563 allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \ 564 start_configure configure_petsc configure_clean petscPython.tgz 565 566