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