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 214# ------------------------------------------------------------------ 215# 216# All remaining actions are intended for PETSc developers only. 217# PETSc users should not generally need to use these commands. 218# 219 220# To access the tags in EMACS, type M-x visit-tags-table and specify 221# the file petsc/TAGS. 222# 1) To move to where a PETSc function is defined, enter M-. and the 223# function name. 224# 2) To search for a string and move to the first occurrence, 225# use M-x tags-search and the string. 226# To locate later occurrences, use M-, 227# Builds all etags files 228alletags: 229 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags 230 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples 231 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples 232 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles 233# Builds complete etags list 234etags: 235 -${RM} ${TAGSDIR}/TAGS 236 -touch ${TAGSDIR}/TAGS 237 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree 238 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree 239 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree 240 -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree 241 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree 242 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree 243 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree 244 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree 245 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree 246 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles 247 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_docs alltree 248 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_scripts alltree 249# Builds the etags file that excludes the examples directories 250etags_noexamples: 251 -${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES 252 -touch ${TAGSDIR}/TAGS_NO_EXAMPLES 253 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree 254 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree 255 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree 256 -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree 257 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree 258 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles 259 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree 260# Builds the etags file for makefiles 261etags_makefiles: 262 -${RM} ${TAGSDIR}/TAGS_MAKEFILES 263 -touch ${TAGSDIR}/TAGS_MAKEFILES 264 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree 265 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles 266# Builds the etags file for examples 267etags_examples: 268 -${RM} ${TAGSDIR}/TAGS_EXAMPLES 269 -touch ${TAGSDIR}/TAGS_EXAMPLES 270 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree 271 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree 272 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree 273 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree 274etags_fexamples: 275 -${RM} ${TAGSDIR}/TAGS_FEXAMPLES 276 -touch ${TAGSDIR}/TAGS_FEXAMPLES 277 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree 278 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree 279# 280# These are here for the target allci and allco, and etags 281# 282 283BMAKEFILES = bmake/common/base bmake/common/test \ 284 bmake/common/bopt* bmake/*/rules bmake/*/variables bmake/*/packages \ 285 bmake/*/petscconf.h bmake/*/petscfix.h bmake/config/packages.in \ 286 bmake/config/petscfix.h.in bmake/config/rules.in \ 287 bmake/config/variables.in bmake/adic.init bmake/adicmf.init 288DOCS = bmake/readme bmake/petscconf.defs 289SCRIPTS = maint/builddist maint/wwwman maint/xclude maint/crontab python/PETSc/Configure.py python/PETSc/Options.py \ 290 python/PETSc/packages/ADIC.py python/PETSc/packages/MPE.py python/PETSc/packages/Mathematica.py \ 291 python/PETSc/packages/PLAPACK.py python/PETSc/packages/Triangle.py python/PETSc/packages/Matlab.py \ 292 python/PETSc/packages/PVODE.py python/PETSc/packages/BlasLapack.py python/PETSc/packages/MPI.py \ 293 python/PETSc/packages/BlockSolve.py python/PETSc/packages/NetCDF.py python/PETSc/packages/ParMetis.py \ 294 python/PETSc/packages/update.py maint/confignightly/* config/*.py 295 296 297updatewebdocs: 298 -chmod -R ug+w /mcs/tmp/petsc-tmp 299 -chgrp -R petsc /mcs/tmp/petsc-tmp 300 -/bin/rm -rf /mcs/tmp/petscdocs 301 -/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs 302 -maint/update-docs.py /mcs/tmp/petscdocs 303 -find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \; 304 -/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs 305 -/bin/rm -rf /mcs/tmp/petscdocs 306 307chk_loc: 308 @if [ ${LOC}foo = foo ] ; then \ 309 echo "*********************** ERROR ************************" ; \ 310 echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \ 311 echo "******************************************************"; false; fi 312 313# Builds all the documentation - should be done every night 314alldoc: alldoc1 alldoc2 315 316# Build everything that goes into 'doc' dir except html sources 317alldoc1: chk_loc deletemanualpages chk_concepts_dir 318 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 319 cd docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 320 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 321 -maint/wwwindex.py ${PETSC_DIR} ${LOC} 322 -${OMAKE} ACTION=manexamples tree LOC=${LOC} 323 -${OMAKE} manconcepts LOC=${LOC} 324 -${OMAKE} ACTION=getexlist tree LOC=${LOC} 325 -${OMAKE} ACTION=exampleconcepts tree LOC=${LOC} 326 -maint/helpindex.py ${PETSC_DIR} ${LOC} 327 328# Builds .html versions of the source 329# html overwrites some stuff created by update-docs - hence this is done later. 330alldoc2: chk_loc 331 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 332 -maint/update-docs.py ${LOC} 333 334alldocclean: deletemanualpages allcleanhtml 335 336# Deletes man pages (HTML version) 337deletemanualpages: chk_loc 338 find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; 339 ${RM} ${LOC}/docs/tex/exampleconcepts 340 ${RM} ${LOC}/docs/tex/manconcepts 341 ${RM} ${LOC}/docs/manualpages/manualpages.cit 342 -maint/update-docs.py ${LOC} clean 343 344allcleanhtml: 345 -${RM} include/adic/*.h.html include/esi/petsc/*.h.html 346 -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 347 348chk_concepts_dir: chk_loc 349 @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 350 echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 351# 352# checks if should build Fortran stubs 353chk_fortranstubs: 354 -@if [ ! -f "${PETSC_DIR}/src/fortran/auto/makefile.src" -a "${C_FC}" != "" ]; then \ 355 ${OMAKE} PETSC_DIR=${PETSC_DIR} allfortranstubs ;\ 356 fi 357 358# Builds Fortran stub files 359allfortranstubs: 360 -@which ${BFORT} > /dev/null 2>&1; \ 361 if [ "$$?" != "0" ]; then \ 362 echo "No bfort available, skipping building Fortran stubs";\ 363 else \ 364 ${RM} -f ${PETSC_DIR}/src/fortran/auto/*.c ;\ 365 touch ${PETSC_DIR}/src/fortran/auto/makefile.src ;\ 366 ${OMAKE} ACTION=fortranstubs tree_basic ;\ 367 cd ${PETSC_DIR}/src/fortran/auto; ${RM} makefile.src; echo SOURCEC = ` ls *.c | tr -s '\n' ' '` > makefile.src ;\ 368 cd ${PETSC_DIR}/src/fortran/auto; ${OMAKE} fixfortran ;\ 369 fi 370 371allci: 372 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci alltree 373 374allco: 375 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co alltree 376 377# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28 378allrcslabel: 379 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel alltree 380# 381# The commands below are for generating ADIC versions of the code; 382# they are not currently used. 383# 384alladicignore: 385 -@${RM} ${INSTALL_LIB_DIR}/adicignore 386 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore tree 387 388alladic: 389 -@echo "Beginning to compile ADIC source code in all directories" 390 -@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}" 391 -@echo "=========================================" 392 -@cd include ; \ 393 ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h 394 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 395 -@cd src/inline ; \ 396 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic 397 -@cd src/blaslapack ; \ 398 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 399 400alladiclib: 401 -@echo "Beginning to compile ADIC libraries in all directories" 402 -@echo "Using compiler: ${CC} ${COPTFLAGS}" 403 -@echo "-----------------------------------------" 404 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 405 -@echo "-----------------------------------------" 406 -@echo "Using configuration flags:" 407 -@grep "define " bmake/${INLUDE_ARCH}/petscconf.h 408 -@echo "-----------------------------------------" 409 -@echo "Using include paths: ${PETSC_INCLUDE}" 410 -@echo "-----------------------------------------" 411 -@echo "Using PETSc directory: ${PETSC_DIR}" 412 -@echo "Using PETSc arch: ${PETSC_ARCH}" 413 -@echo "=========================================" 414 -@${RM} -f ${INSTALL_LIB_DIR}/*adic.${LIB_SUFFIX} 415 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 416 -@cd src/blaslapack ; \ 417 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 418 -@cd src/adic/src ; \ 419 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib 420 421# ------------------------------------------------------------------------------- 422# 423# Some macros to check if the fortran interface is up-to-date. 424# 425countfortranfunctions: 426 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 427 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 428 sed "s/_$$//" | sort > /tmp/countfortranfunctions 429 430countcfunctions: 431 -@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \ 432 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 433 tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 434 435difffortranfunctions: countfortranfunctions countcfunctions 436 -@echo -------------- Functions missing in the fortran interface --------------------- 437 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 438 -@echo ----------------- Functions missing in the C interface ------------------------ 439 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 440 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 441 442checkbadfortranstubs: 443 -@echo "=========================================" 444 -@echo "Functions with MPI_Comm as an Argument" 445 -@echo "=========================================" 446 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 447 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 448 -@echo "=========================================" 449 -@echo "Functions with a String as an Argument" 450 -@echo "=========================================" 451 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 452 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 453 -@echo "=========================================" 454 -@echo "Functions with Pointers to PETSc Objects as Argument" 455 -@echo "=========================================" 456 -@cd ${PETSC_DIR}/src/fortran/auto; \ 457 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 458 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 459 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 460 for OBJ in $$_p_OBJ; do \ 461 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 462 cut -d'(' -f1 | cut -d' ' -f1,3; \ 463 done 464# 465# Automatically generates PETSc exercises in html from the tutorial examples. 466# 467# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited 468# (used also in introductions to the manual pages) 469# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited 470# The list of exercises is from TUTORIALS in each directory's makefile 471# 472# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced. 473# The pagemaker rule is in the file bmake/common (at the bottom) 474# 475# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 476# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 477# 478exercises: 479 -@echo "=========================================" 480 -@echo "Generating HTML tutorial exercises" 481 -@${RM} docs/pageform.txt 482 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 483 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 484 -@echo "access_format=short" >> docs/pageform.txt 485 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 486 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 487 -@echo "Generating HTML for individual directories" 488 -@echo "=========================================" 489 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 490 -@echo "Completed HTML for individual directories" 491 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 492 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 493 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 494 -@echo "=========================================" 495 496# Make a tarball of all the Python code 497# This is currently used to release to the Teragrid 498petscPython.tgz: 499 @tar cvzf $@ --exclude SCCS --exclude BitKeeper --dereference python/ 500 -@scp $@ tg-login2.uc.teragrid.org:./ 501 502.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \ 503 alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \ 504 allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \ 505 start_configure configure_petsc configure_clean petscPython.tgz 506 507