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