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 maint/bugReport.py maint/buildconfigtest maint/builddistlite \ 347 maint/buildtest maint/checkBuilds.py maint/copylognightly maint/copylognightly.tao maint/countfiles maint/findbadfiles \ 348 maint/fixinclude maint/getexlist maint/getpdflabels.py maint/helpindex.py maint/hosts.local maint/hosts.solaris killnightly \ 349 maint/lex.py maint/makepatch maint/mapnameslatex.py maint/startnightly maint/startnightly.tao maint/submitPatch.py \ 350 maint/update-docs.py maint/updatetestbk maint/wwwindex.py maint/xcludebackup maint/xcludecblas maint/zap maint/zapall \ 351 python/PETSc/Configure.py python/PETSc/Options.py \ 352 python/PETSc/packages/ADIC.py python/PETSc/packages/MPE.py python/PETSc/packages/Mathematica.py \ 353 python/PETSc/packages/PLAPACK.py python/PETSc/packages/Triangle.py python/PETSc/packages/Matlab.py \ 354 python/PETSc/packages/PVODE.py python/PETSc/packages/BlasLapack.py python/PETSc/packages/MPI.py \ 355 python/PETSc/packages/BlockSolve.py python/PETSc/packages/NetCDF.py python/PETSc/packages/ParMetis.py \ 356 python/PETSc/packages/update.py maint/confignightly/* config/*.py 357 358 359updatewebdocs: 360 -chmod -R ug+w /mcs/tmp/petsc-tmp 361 -chgrp -R petsc /mcs/tmp/petsc-tmp 362 -/bin/rm -rf /mcs/tmp/petscdocs 363 -/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs 364 -maint/update-docs.py /mcs/tmp/petscdocs 365 -find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \; 366 -/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs 367 -/bin/rm -rf /mcs/tmp/petscdocs 368 369chk_loc: 370 @if [ ${LOC}foo = foo ] ; then \ 371 echo "*********************** ERROR ************************" ; \ 372 echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \ 373 echo "******************************************************"; false; fi 374 @${MKDIR} -p ${LOC}/docs/manualpages 375 376# Builds all the documentation - should be done every night 377alldoc: alldoc1 alldoc2 378 379# Build everything that goes into 'doc' dir except html sources 380alldoc1: chk_loc deletemanualpages chk_concepts_dir 381 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 382 cd docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 383 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 384 -maint/wwwindex.py ${PETSC_DIR} ${LOC} 385 -${OMAKE} ACTION=manexamples tree LOC=${LOC} 386 -${OMAKE} manconcepts LOC=${LOC} 387 -${OMAKE} ACTION=getexlist tree LOC=${LOC} 388 -${OMAKE} ACTION=exampleconcepts tree LOC=${LOC} 389 -maint/helpindex.py ${PETSC_DIR} ${LOC} 390 391# Builds .html versions of the source 392# html overwrites some stuff created by update-docs - hence this is done later. 393alldoc2: chk_loc 394 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 395 -maint/update-docs.py ${LOC} 396 397alldocclean: deletemanualpages allcleanhtml 398 399# Deletes man pages (HTML version) 400deletemanualpages: chk_loc 401 -@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \ 402 find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\ 403 ${RM} ${LOC}/docs/exampleconcepts ;\ 404 ${RM} ${LOC}/docs/manconcepts ;\ 405 ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\ 406 maint/update-docs.py ${LOC} clean;\ 407 fi 408 409allcleanhtml: 410 -${RM} include/adic/*.h.html include/esi/petsc/*.h.html 411 -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 412 413chk_concepts_dir: chk_loc 414 @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 415 echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 416# 417# checks if should build Fortran stubs 418chk_fortranstubs: 419 -@if [ ! -f "${PETSC_DIR}/src/fortran/auto/makefile.src" -a "${C_FC}" != "" ]; then \ 420 ${OMAKE} PETSC_DIR=${PETSC_DIR} allfortranstubs ;\ 421 fi 422 423# Builds Fortran stub files 424allfortranstubs: 425 -@which ${BFORT} > /dev/null 2>&1; \ 426 if [ "$$?" != "0" ]; then \ 427 echo "No bfort available, skipping building Fortran stubs";\ 428 else \ 429 ${RM} -f ${PETSC_DIR}/src/fortran/auto/*.c ;\ 430 touch ${PETSC_DIR}/src/fortran/auto/makefile.src ;\ 431 ${OMAKE} ACTION=fortranstubs tree_basic ;\ 432 cd ${PETSC_DIR}/src/fortran/auto; ${RM} makefile.src; echo SOURCEC = ` ls *.c | tr -s '\n' ' '` > makefile.src ;\ 433 cd ${PETSC_DIR}/src/fortran/auto; ${OMAKE} fixfortran ;\ 434 fi 435 436allci: 437 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci alltree 438 439allco: 440 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co alltree 441 442# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28 443allrcslabel: 444 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel alltree 445# 446# The commands below are for generating ADIC versions of the code; 447# they are not currently used. 448# 449alladicignore: 450 -@${RM} ${INSTALL_LIB_DIR}/adicignore 451 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore tree 452 453alladic: 454 -@echo "Beginning to compile ADIC source code in all directories" 455 -@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}" 456 -@echo "=========================================" 457 -@cd include ; \ 458 ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h 459 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 460 -@cd src/inline ; \ 461 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic 462 -@cd src/blaslapack ; \ 463 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 464 465alladiclib: 466 -@echo "Beginning to compile ADIC libraries in all directories" 467 -@echo "Using compiler: ${CC} ${COPTFLAGS}" 468 -@echo "-----------------------------------------" 469 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 470 -@echo "-----------------------------------------" 471 -@echo "Using configuration flags:" 472 -@grep "define " bmake/${INLUDE_ARCH}/petscconf.h 473 -@echo "-----------------------------------------" 474 -@echo "Using include paths: ${PETSC_INCLUDE}" 475 -@echo "-----------------------------------------" 476 -@echo "Using PETSc directory: ${PETSC_DIR}" 477 -@echo "Using PETSc arch: ${PETSC_ARCH}" 478 -@echo "=========================================" 479 -@${RM} -f ${INSTALL_LIB_DIR}/*adic.${LIB_SUFFIX} 480 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 481 -@cd src/blaslapack ; \ 482 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 483 -@cd src/adic/src ; \ 484 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib 485 486# ------------------------------------------------------------------------------- 487# 488# Some macros to check if the fortran interface is up-to-date. 489# 490countfortranfunctions: 491 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 492 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 493 sed "s/_$$//" | sort > /tmp/countfortranfunctions 494 495countcfunctions: 496 -@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \ 497 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 498 tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 499 500difffortranfunctions: countfortranfunctions countcfunctions 501 -@echo -------------- Functions missing in the fortran interface --------------------- 502 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 503 -@echo ----------------- Functions missing in the C interface ------------------------ 504 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 505 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 506 507checkbadfortranstubs: 508 -@echo "=========================================" 509 -@echo "Functions with MPI_Comm as an Argument" 510 -@echo "=========================================" 511 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 512 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 513 -@echo "=========================================" 514 -@echo "Functions with a String as an Argument" 515 -@echo "=========================================" 516 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 517 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 518 -@echo "=========================================" 519 -@echo "Functions with Pointers to PETSc Objects as Argument" 520 -@echo "=========================================" 521 -@cd ${PETSC_DIR}/src/fortran/auto; \ 522 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 523 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 524 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 525 for OBJ in $$_p_OBJ; do \ 526 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 527 cut -d'(' -f1 | cut -d' ' -f1,3; \ 528 done 529# 530# Automatically generates PETSc exercises in html from the tutorial examples. 531# 532# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited 533# (used also in introductions to the manual pages) 534# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited 535# The list of exercises is from TUTORIALS in each directory's makefile 536# 537# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced. 538# The pagemaker rule is in the file bmake/common (at the bottom) 539# 540# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 541# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 542# 543exercises: 544 -@echo "=========================================" 545 -@echo "Generating HTML tutorial exercises" 546 -@${RM} docs/pageform.txt 547 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 548 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 549 -@echo "access_format=short" >> docs/pageform.txt 550 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 551 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 552 -@echo "Generating HTML for individual directories" 553 -@echo "=========================================" 554 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 555 -@echo "Completed HTML for individual directories" 556 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 557 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 558 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 559 -@echo "=========================================" 560 561# Make a tarball of all the Python code 562# This is currently used to release to the Teragrid 563petscPython.tgz: 564 @tar cvzf $@ --exclude SCCS --exclude BitKeeper --dereference python/ 565 -@scp $@ tg-login2.uc.teragrid.org:./ 566 567.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \ 568 alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \ 569 allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \ 570 start_configure configure_petsc configure_clean petscPython.tgz 571 572