1 2# 3# This is the makefile for compiling PETSc. See 4# http://www.mcs.anl.gov/petsc/petsc-as/documentation/installation.html for directions on installing PETSc. 5# See also conf for additional commands. 6# 7ALL: all 8LOCDIR = ./ 9DIRS = src include tutorials 10CFLAGS = 11FFLAGS = 12 13# next line defines PETSC_DIR and PETSC_ARCH if they are not set 14include ./${PETSC_ARCH}/conf/petscvariables 15include ${PETSC_DIR}/conf/variables 16include ${PETSC_DIR}/conf/rules 17include ${PETSC_DIR}/conf/test 18 19# 20# Basic targets to build PETSc libraries. 21# all: builds the c, fortran, and f90 libraries 22all: 23 @${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} chkpetsc_dir 24 -@${OMAKE} all_build PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} 2>&1 | tee ${PETSC_ARCH}/conf/make.log 25 -@if [ -L make.log ]; then ${RM} make.log; fi; ln -s ${PETSC_ARCH}/conf/make.log make.log 26 -@egrep -i "( error | error:)" ${PETSC_ARCH}/conf/make.log > /dev/null; if [ "$$?" = "0" ]; then \ 27 echo "********************************************************************" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \ 28 echo " Error during compile, check ${PETSC_ARCH}/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \ 29 echo " Send it and ${PETSC_ARCH}/conf/configure.log to petsc-maint@mcs.anl.gov" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log;\ 30 echo "********************************************************************" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \ 31 exit 1; \ 32 else \ 33 ${OMAKE} shared_install PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log ;\ 34 fi 35 36# 37# Notes: the shared_nomesg and petsc4py should NOT be built if --prefix was used 38# the rules for shared_nomesg_noinstall petsc4py_noinstall are generated automatically 39# by config/PETSc/Configure.py and config/PETSc/packages/petsc4py.py based on the existance 40all_build: chk_petsc_dir chklib_dir info info_h deletelibs deletemods build shared_nomesg_noinstall mpi4py_noinstall petsc4py_noinstall 41# 42# Prints information about the system and version of PETSc being compiled 43# 44info: 45 -@echo "==========================================" 46 -@echo " " 47 -@echo "See documentation/faq.html and documentation/bugreporting.html" 48 -@echo "for help with installation problems. Please send EVERYTHING" 49 -@echo "printed out below when reporting problems" 50 -@echo " " 51 -@echo "To subscribe to the PETSc announcement list, send mail to " 52 -@echo "majordomo@mcs.anl.gov with the message: " 53 -@echo "subscribe petsc-announce" 54 -@echo " " 55 -@echo "To subscribe to the PETSc users mailing list, send mail to " 56 -@echo "majordomo@mcs.anl.gov with the message: " 57 -@echo "subscribe petsc-users" 58 -@echo " " 59 -@echo "==========================================" 60 -@echo On `date` on `hostname` 61 -@echo Machine characteristics: `uname -a` 62 -@echo "-----------------------------------------" 63 -@echo "Using PETSc directory: ${PETSC_DIR}" 64 -@echo "Using PETSc arch: ${PETSC_ARCH}" 65 -@echo "-----------------------------------------" 66 -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" 67 -@echo "-----------------------------------------" 68 -@echo "Using configure Options: ${CONFIGURE_OPTIONS}" 69 -@echo "Using configuration flags:" 70 -@grep "\#define " ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h 71 -@echo "-----------------------------------------" 72 -@echo "Using include paths: ${PETSC_INCLUDE}" 73 -@echo "------------------------------------------" 74 -@echo "Using C/C++ compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}" 75 -@echo "C/C++ Compiler version: " `${CCV}` 76 -@if [ "${FC}" != "" ]; then \ 77 echo "Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}";\ 78 echo "Fortran Compiler version: " `${FCV}`;\ 79 fi 80 -@echo "-----------------------------------------" 81 -@echo "Using C/C++ linker: ${PCC_LINKER}" 82 -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" 83 -@if [ "${FC}" != "" ]; then \ 84 echo "Using Fortran linker: ${FC_LINKER}";\ 85 echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ 86 fi 87 -@echo "-----------------------------------------" 88 -@echo "Using libraries: ${PETSC_LIB}" 89 -@echo "------------------------------------------" 90 -@echo "Using mpiexec: ${MPIEXEC}" 91 -@echo "==========================================" 92# 93# 94MINFO = ${PETSC_DIR}/${PETSC_ARCH}/include/petscmachineinfo.h 95info_h: 96 -@$(RM) -f ${MINFO} MINFO 97 -@echo "static const char *petscmachineinfo = \"\__n__\"" >> MINFO 98 -@echo "\"-----------------------------------------\__n__\"" >> MINFO 99 -@if [ -f /usr/bin/cygcheck.exe ]; then \ 100 echo "\"Libraries compiled on `date` on `hostname|/usr/bin/dos2unix` \__n__\"" >> MINFO; \ 101 else \ 102 echo "\"Libraries compiled on `date` on `hostname` \__n__\"" >> MINFO; \ 103 fi 104 -@echo "\"Machine characteristics: `uname -a` \__n__\"" >> MINFO 105 -@echo "\"Using PETSc directory: ${PETSC_DIR}\__n__\"" >> MINFO 106 -@echo "\"Using PETSc arch: ${PETSC_ARCH}\__n__\"" >> MINFO 107 -@echo "\"-----------------------------------------\"; " >> MINFO 108 -@echo "static const char *petsccompilerinfo = \"\__n__\"" >> MINFO 109 -@echo "\"Using C compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}\__n__\"" >> MINFO 110 -@echo "\"Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}\__n__\"" >> MINFO 111 -@echo "\"-----------------------------------------\"; " >> MINFO 112 -@echo "static const char *petsccompilerflagsinfo = \"\__n__\"" >> MINFO 113 -@echo "\"Using include paths: ${PETSC_INCLUDE}\__n__\"" >> MINFO 114 -@echo "\"------------------------------------------\"; " >> MINFO 115 -@echo "static const char *petsclinkerinfo = \"\__n__\"" >> MINFO 116 -@echo "\"Using C linker: ${CLINKER}\__n__\"" >> MINFO 117 -@echo "\"Using Fortran linker: ${FLINKER}\__n__\"" >> MINFO 118 -@echo "\"Using libraries: ${PETSC_LIB} \__n__\"" >> MINFO 119 -@echo "\"------------------------------------------\"; " >> MINFO 120 -@cat MINFO | ${SED} -e 's/\\ /\\\\ /g' | ${SED} -e 's/__n__/n/g' > ${MINFO} 121 -@ if [ -f /usr/bin/cygcheck.exe ]; then /usr/bin/dos2unix ${MINFO} 2> /dev/null; fi 122 -@$(RM) -f MINFO 123 124# 125# Builds the PETSc libraries 126# This target also builds fortran77 and f90 interface 127# files and compiles .F files 128# 129build: 130 -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 131 -@echo "=========================================" 132 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 133 -@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} > tmpf 2>&1 ; ${GREP} -v "has no symbols" tmpf; ${RM} tmpf; 134 -@echo "Completed building libraries" 135 -@echo "=========================================" 136# 137# 138# Builds PETSc test examples for a given architecture 139# 140test: 141 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} test_build 2>&1 | tee ./${PETSC_ARCH}/conf/test.log 142testx11: 143 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testx11_build 2>&1 | tee ./${PETSC_ARCH}/conf/testx11.log 144test_build: 145 -@echo "Running test examples to verify correct installation" 146 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 147 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex19 148 @if [ "${FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex5f; fi; 149 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 150 -@echo "Completed test examples" 151testx11_build: 152 -@echo "Running graphics test example to verify correct X11 installation" 153 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 154 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testx11ex19 155 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 156 -@echo "Completed graphics test example" 157 158testexamples: info 159 -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 160 -@echo "Due to different numerical round-off on certain" 161 -@echo "machines some of the numbers may not match exactly." 162 -@echo "=========================================" 163 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C tree 164 -@echo "Completed compiling and running test examples" 165 -@echo "=========================================" 166testfortran: info 167 -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 168 -@echo "=========================================" 169 -@echo "Due to different numerical round-off on certain" 170 -@echo "machines or the way Fortran formats numbers" 171 -@echo "some of the results may not match exactly." 172 -@echo "=========================================" 173 -@if [ "${FC}" != "" ]; then \ 174 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran tree; \ 175 echo "Completed compiling and running Fortran test examples"; \ 176 else \ 177 echo "Error: No FORTRAN compiler available"; \ 178 fi 179 -@echo "=========================================" 180testexamples_uni: info 181 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 182 -@echo "Due to different numerical round-off on certain" 183 -@echo "machines some of the numbers may not match exactly." 184 -@echo "=========================================" 185 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C_X11_MPIUni tree 186 -@echo "Completed compiling and running uniprocessor test examples" 187 -@echo "=========================================" 188testfortran_uni: info 189 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES" 190 -@echo "Due to different numerical round-off on certain" 191 -@echo "machines some of the numbers may not match exactly." 192 -@echo "=========================================" 193 -@if [ "${FC}" != "" ]; then \ 194 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni tree; \ 195 echo "Completed compiling and running uniprocessor fortran test examples"; \ 196 else \ 197 echo "Error: No FORTRAN compiler available"; \ 198 fi 199 -@ 200 -@echo "=========================================" 201 202# Ranlib on the libraries 203ranlib: 204 ${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} 205 206# Deletes PETSc libraries 207deletelibs: 208 -${RM} -f ${PETSC_LIB_DIR}/libpetsc*.* 209deletemods: 210 -${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod 211 212# Cleans up build 213allclean: deletelibs deletemods 214 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree 215 216 217# 218# Check if PETSC_DIR variable specified is valid 219# 220chk_petsc_dir: 221 @if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \ 222 echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \ 223 echo "You need to use / to separate directories, not \\!"; \ 224 echo "Aborting build"; \ 225 false; fi 226# 227# 228install: 229 -@./config/install.py 230 231newall: 232 -@cd src/sys; ${PETSC_DIR}/config/builder.py 233 -@cd src/vec; ${PETSC_DIR}/config/builder.py 234 -@cd src/mat; ${PETSC_DIR}/config/builder.py 235 -@cd src/dm; ${PETSC_DIR}/config/builder.py 236 -@cd src/ksp; ${PETSC_DIR}/config/builder.py 237 -@cd src/snes; ${PETSC_DIR}/config/builder.py 238 -@cd src/ts; ${PETSC_DIR}/config/builder.py 239# ------------------------------------------------------------------ 240# 241# All remaining actions are intended for PETSc developers only. 242# PETSc users should not generally need to use these commands. 243# 244 245# To access the tags in EMACS, type M-x visit-tags-table and specify 246# the file petsc/TAGS. 247# 1) To move to where a PETSc function is defined, enter M-. and the 248# function name. 249# 2) To search for a string and move to the first occurrence, 250# use M-x tags-search and the string. 251# To locate later occurrences, use M-, 252# Builds all etags files 253alletags: 254 -@bin/maint/generateetags.py 255 -@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON 256 257allfortranstubs: 258 -@bin/maint/generatefortranstubs.py ${BFORT} 259deletefortranstubs: 260 -@find . -type d -name ftn-auto | xargs rm -rf 261# 262# These are here for the target allci and allco, and etags 263# 264 265BMAKEFILES = conf/variables conf/rules conf/test bmake/adic.init bmake/adicmf.init 266SCRIPTS = bin/maint/builddist bin/maint/wwwman bin/maint/xclude bin/maint/bugReport.py bin/maint/buildconfigtest bin/maint/builddistlite \ 267 bin/maint/buildtest bin/maint/checkBuilds.py bin/maint/copylognightly bin/maint/copylognightly.tao bin/maint/countfiles bin/maint/findbadfiles \ 268 bin/maint/fixinclude bin/maint/getexlist bin/maint/getpdflabels.py bin/maint/helpindex.py bin/maint/hosts.local bin/maint/hosts.solaris \ 269 bin/maint/lex.py bin/maint/mapnameslatex.py bin/maint/startnightly bin/maint/startnightly.tao bin/maint/submitPatch.py \ 270 bin/maint/update-docs.py bin/maint/wwwindex.py bin/maint/xcludebackup bin/maint/xcludecblas bin/maint/zap bin/maint/zapall \ 271 config/PETSc/Configure.py config/PETSc/Options.py \ 272 config/PETSc/packages/*.py config/PETSc/utilities/*.py 273 274 275# Builds all the documentation - should be done every night 276alldoc: alldoc1 alldoc2 277 278# Build everything that goes into 'doc' dir except html sources 279alldoc1: chk_loc deletemanualpages chk_concepts_dir 280 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 281 -@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap 282 -@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap 283 -cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 284 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 285 -bin/maint/wwwindex.py ${PETSC_DIR} ${LOC} 286 -${OMAKE} ACTION=manexamples tree_basic LOC=${LOC} 287 -${OMAKE} manconcepts LOC=${LOC} 288 -${OMAKE} ACTION=getexlist tree_basic LOC=${LOC} 289 -${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC} 290 -bin/maint/helpindex.py ${PETSC_DIR} ${LOC} 291 -grep -h Polymorphic include/*.h | grep -v '#define ' | sed "s?PetscPolymorphic[a-zA-Z]*(??g" | cut -f1 -d"{" > tmppoly 292 -bin/maint/processpoly.py ${PETSC_DIR} ${LOC} 293 -${RM} tmppoly 294 295# Builds .html versions of the source 296# html overwrites some stuff created by update-docs - hence this is done later. 297alldoc2: chk_loc 298 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 299 -bin/maint/update-docs.py ${PETSC_DIR} ${LOC} 300 301alldocclean: deletemanualpages allcleanhtml 302 303# Deletes man pages (HTML version) 304deletemanualpages: chk_loc 305 -@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \ 306 find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\ 307 ${RM} ${LOC}/docs/exampleconcepts ;\ 308 ${RM} ${LOC}/docs/manconcepts ;\ 309 ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\ 310 bin/maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\ 311 fi 312 313allcleanhtml: 314 -${RM} include/adic/*.h.html 315 -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree 316 317chk_concepts_dir: chk_loc 318 @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 319 echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 320 321########################################################### 322# targets to build distribution and update docs 323########################################################### 324 325# Creates ${HOME}/petsc.tar.gz [and petsc-lite.tar.gz] 326dist: 327 ${PETSC_DIR}/bin/maint/builddist ${PETSC_DIR} 328 329# This target works only if you can do 'ssh petsc@harley.mcs.anl.gov' 330# also copy the file over to ftp site. 331web-snapshot: 332 @if [ ! -f "${HOME}/petsc-dev.tar.gz" ]; then \ 333 echo "~/petsc-dev.tar.gz missing! cannot update petsc-dev snapshot on mcs-web-site"; \ 334 else \ 335 echo "updating petsc-dev snapshot on mcs-web-site"; \ 336 tmpdir=`mktemp -d -t petsc-doc.XXXXXXXX`; \ 337 cd $${tmpdir}; tar -xzf ${HOME}/petsc-dev.tar.gz; \ 338 /usr/bin/rsync -e ssh -az --delete $${tmpdir}/petsc-dev/ \ 339 petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as/snapshots/petsc-dev ;\ 340 /bin/cp -f /home/petsc/petsc-dev.tar.gz /mcs/ftp/pub/petsc/petsc-dev.tar.gz;\ 341 ${RM} -rf $${tmpdir} ;\ 342 fi 343 344# build the tarfile - and then update petsc-dev snapshot on mcs-web-site 345update-web-snapshot: dist web-snapshot 346 347# This target updates website main pages 348update-web: 349 @cd ${PETSC_DIR}/src/docs; make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} bib2html; \ 350 /usr/bin/rsync -az -C --exclude=BitKeeper --exclude=documentation/installation.html \ 351 ${PETSC_DIR}/src/docs/website/ petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as 352 @cd ${PETSC_DIR}/src/docs/tex/manual; make developers.pdf PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} LOC=${PETSC_DIR}; \ 353 /usr/bin/rsync -az developers.pdf petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as/developers/ 354 355# 356# builds a single list of files for each PETSc library so they may all be built in parallel 357# without a recursive set of make calls 358createfastbuild: 359 cd src/vec; ${RM} -f files; /bin/echo -n "SOURCEC = " > files; make tree ACTION=sourcelist BASE_DIR=${PETSC_DIR}/src/vec; /bin/echo -n "OBJSC = $${SOURCEC:.c=.o} " >> files 360 361########################################################### 362 363# 364# makes .lines files for all source code 365# 366allgcov: 367 -@${RM} -rf /tmp/gcov-${USER} 368 -@mkdir /tmp/gcov-${USER} 369 -${OMAKE} ACTION=gcov PETSC_DIR=${PETSC_DIR} tree 370 -cd /tmp/gcov-${USER}; tar -czf ${PETSC_DIR}/gcov.tar.gz *.lines 371 -${RM) -rf /tmp/gcov-${USER} 372 373# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28 374allrcslabel: 375 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel alltree 376# 377# The commands below are for generating ADIC versions of the code; 378# they are not currently used. 379# 380alladicignore: 381 -@${RM} ${INSTALL_LIB_DIR}/adicignore 382 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore tree 383 384alladic: 385 -@echo "Beginning to compile ADIC source code in all directories" 386 -@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}" 387 -@echo "=========================================" 388 -@cd include ; \ 389 ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h 390 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 391 392alladiclib: 393 -@echo "Beginning to compile ADIC libraries in all directories" 394 -@echo "Using compiler: ${PCC} ${COPTFLAGS}" 395 -@echo "-----------------------------------------" 396 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 397 -@echo "-----------------------------------------" 398 -@echo "Using configuration flags:" 399 -@grep "define " ${PETSC_ARCH}/include/petscconf.h 400 -@echo "-----------------------------------------" 401 -@echo "Using include paths: ${PETSC_INCLUDE}" 402 -@echo "-----------------------------------------" 403 -@echo "Using PETSc directory: ${PETSC_DIR}" 404 -@echo "Using PETSc arch: ${PETSC_ARCH}" 405 -@echo "=========================================" 406 -@${RM} -f ${INSTALL_LIB_DIR}/*adic.${AR_LIB_SUFFIX} 407 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 408 -@cd src/adic/src ; \ 409 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} lib 410 411# ------------------------------------------------------------------------------- 412# 413# Some macros to check if the fortran interface is up-to-date. 414# 415countfortranfunctions: 416 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 417 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 418 sed "s/_$$//" | sort > /tmp/countfortranfunctions 419 420countcfunctions: 421 -@grep extern ${PETSC_DIR}/include/*.h | grep "(" | tr -s ' ' | \ 422 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 423 tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 424 425difffortranfunctions: countfortranfunctions countcfunctions 426 -@echo -------------- Functions missing in the fortran interface --------------------- 427 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 428 -@echo ----------------- Functions missing in the C interface ------------------------ 429 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 430 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 431 432checkbadfortranstubs: 433 -@echo "=========================================" 434 -@echo "Functions with MPI_Comm as an Argument" 435 -@echo "=========================================" 436 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 437 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 438 -@echo "=========================================" 439 -@echo "Functions with a String as an Argument" 440 -@echo "=========================================" 441 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 442 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 443 -@echo "=========================================" 444 -@echo "Functions with Pointers to PETSc Objects as Argument" 445 -@echo "=========================================" 446 -@cd ${PETSC_DIR}/src/fortran/auto; \ 447 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 448 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 449 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 450 for OBJ in $$_p_OBJ; do \ 451 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 452 cut -d'(' -f1 | cut -d' ' -f1,3; \ 453 done 454# 455# Automatically generates PETSc exercises in html from the tutorial examples. 456# 457# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited 458# (used also in introductions to the manual pages) 459# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited 460# The list of exercises is from TUTORIALS in each directory's makefile 461# 462# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced. 463# The pagemaker rule is in the file conf (at the bottom) 464# 465# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 466# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 467# 468exercises: 469 -@echo "=========================================" 470 -@echo "Generating HTML tutorial exercises" 471 -@${RM} docs/pageform.txt 472 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 473 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 474 -@echo "access_format=short" >> docs/pageform.txt 475 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 476 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 477 -@echo "Generating HTML for individual directories" 478 -@echo "=========================================" 479 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 480 -@echo "Completed HTML for individual directories" 481 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 482 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 483 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 484 -@echo "=========================================" 485 486.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \ 487 alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \ 488 allhtml allcleanhtml allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \ 489 start_configure configure_petsc configure_clean 490 491getsigs: 492 -@if [ ! -d src/sigs ]; then mkdir -p sigs; fi 493 -@echo ${PETSC_INCLUDE} > sigs/petsc_include 494 -@echo "#include \"petscvec.h\"" > sigs/vec.sigs.h 495 -@grep -h "enum " include/petscsys.h include/petscvec.h >> sigs/vec.sigs.h 496 -@grep " Vec[a-zA-Z][a-zA-Z]*(Vec," include/petscvec.h | grep EXTERN | grep -v "(\*)" | grep -v IS |grep -v VecType | sed "s/EXTERN PetscErrorCode PETSCVEC_DLLEXPORT//g" >> sigs/vec.sigs.h 497 -@echo "#include \"petscmat.h\"" > sigs/mat.sigs.h 498 -@grep "enum " include/petscmat.h | grep } >> sigs/mat.sigs.h 499 -@grep " Mat[a-zA-Z][a-zA-Z]*(Mat," include/petscmat.h | grep EXTERN | grep -v "(\*)" | grep -v IS |grep -v MatType | sed "s/EXTERN PetscErrorCode PETSCMAT_DLLEXPORT//g" >> sigs/mat.sigs.h 500 -@echo "#include \"petscpc.h\"" > sigs/pc.sigs.h 501 -@grep "enum " include/petscpc.h | grep } >> sigs/pc.sigs.h 502 -@grep " PC[a-zA-Z][a-zA-Z]*(PC," include/petscpc.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v PCType | sed "s/EXTERN PetscErrorCode PETSCKSP_DLLEXPORT//g" >> sigs/pc.sigs.h 503 -@echo "#include \"petscksp.h\"" > sigs/ksp.sigs.h 504 -@grep "enum " include/petscksp.h | grep } >> sigs/ksp.sigs.h 505 -@grep " KSP[a-zA-Z][a-zA-Z]*(KSP," include/petscksp.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v KSPType | sed "s/EXTERN PetscErrorCode PETSCKSP_DLLEXPORT//g" >> sigs/ksp.sigs.h 506 -@echo "#include \"petscsnes.h\"" > sigs/snes.sigs.h 507 -@grep " SNES[a-zA-Z][a-zA-Z]*(SNES," include/petscsnes.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v SNESType | sed "s/EXTERN PetscErrorCode PETSCSNES_DLLEXPORT//g" >> sigs/snes.sigs.h 508 509 510 511 512 513 514 515 516 517 518 519petscao : petscmat petscao.f90.h 520petscda : petscksp petscda.f90.h 521petscdraw : petsc petscdraw.f90.h 522petscis : petsc petscis.f90.h 523petscksp : petscpc petscksp.f90.h 524petsclog : petsc petsclog.f90.h 525petscmat : petscvec petscmat.f90.h 526petscmg : petscksp petscmg.f90.h 527petscpc : petscmat petscpc.f90.h 528petscsnes : petscksp petscsnes.f90.h 529petscsys : petsc petscsys.f90.h 530petscts : petscsnes petscts.f90.h 531petsc : petsc.f90.h 532petscvec : petscis petscvec.f90.h 533petscviewer : petsc petscviewer.f90.h 534petscmesh : petsc petscmesh.f90.h 535modules : petscao petscda petscdraw petscis petscksp petsclog petscmat petscmg petscpc petscsnes petscsys petscts petsc petscvec petscviewer petscmesh 536