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