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