1# 2# This is the makefile for compiling PETSc. See 3# http://www.mcs.anl.gov/petsc/documentation/installation.html for directions on installing PETSc. 4# See also conf for additional commands. 5# 6ALL: all 7LOCDIR = ./ 8DIRS = src include tutorials 9CFLAGS = 10FFLAGS = 11 12# next line defines PETSC_DIR and PETSC_ARCH if they are not set 13include ././${PETSC_ARCH}/conf/petscvariables 14include ${PETSC_DIR}/conf/variables 15include ${PETSC_DIR}/conf/rules 16include ${PETSC_DIR}/conf/test 17 18# 19# Basic targets to build PETSc libraries. 20# all: builds the c, fortran, and f90 libraries 21all: 22 @${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} chkpetsc_dir petscnagupgrade | tee ${PETSC_ARCH}/conf/make.log 23 @ln -sf ${PETSC_ARCH}/conf/make.log make.log 24 @if [ "${PETSC_BUILD_USING_CMAKE}" != "" ]; then \ 25 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-cmake 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log \ 26 | egrep -v '( --check-build-system |cmake -E | -o CMakeFiles/petsc[[:lower:]]*.dir/| -o lib/libpetsc|CMakeFiles/petsc[[:lower:]]*\.dir/(build|depend|requires)|-f CMakeFiles/Makefile2|Dependee .* is newer than depender |provides\.build. is up to date)'; \ 27 else \ 28 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-legacy 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log \ 29 | ${GREP} -v "has no symbols"; \ 30 fi 31 @egrep -i "( error | error: |no such file or directory)" ${PETSC_ARCH}/conf/make.log | tee ${PETSC_ARCH}/conf/error.log > /dev/null 32 @if test -s ${PETSC_ARCH}/conf/error.log; then \ 33 echo "********************************************************************" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \ 34 echo " Error during compile, check ${PETSC_ARCH}/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log; \ 35 echo " Send it and ${PETSC_ARCH}/conf/configure.log to petsc-maint@mcs.anl.gov" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log;\ 36 echo "********************************************************************" 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log;\ 37 else \ 38 ${OMAKE} shared_install PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} 2>&1 | tee -a ${PETSC_ARCH}/conf/make.log ;\ 39 fi #solaris make likes to print the whole command that gave error. So split this up into the smallest chunk below 40 @if test -s ${PETSC_ARCH}/conf/error.log; then exit 1; fi 41 42all-cmake: info cmakegen cmake 43 44all-legacy: chklib_dir info deletelibs deletemods build shared_nomesg mpi4py petsc4py 45# 46# Prints information about the system and version of PETSc being compiled 47# 48info: 49 -@echo "==========================================" 50 -@echo " " 51 -@echo "See documentation/faq.html and documentation/bugreporting.html" 52 -@echo "for help with installation problems. Please send EVERYTHING" 53 -@echo "printed out below when reporting problems" 54 -@echo " " 55 -@echo "To subscribe to the PETSc announcement list, send mail to " 56 -@echo "majordomo@mcs.anl.gov with the message: " 57 -@echo "subscribe petsc-announce" 58 -@echo " " 59 -@echo "To subscribe to the PETSc users mailing list, send mail to " 60 -@echo "majordomo@mcs.anl.gov with the message: " 61 -@echo "subscribe petsc-users" 62 -@echo " " 63 -@echo "==========================================" 64 -@echo On `date` on `hostname` 65 -@echo Machine characteristics: `uname -a` 66 -@echo "-----------------------------------------" 67 -@echo "Using PETSc directory: ${PETSC_DIR}" 68 -@echo "Using PETSc arch: ${PETSC_ARCH}" 69 -@echo "-----------------------------------------" 70 -@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//" 71 -@echo "-----------------------------------------" 72 -@echo "Using configure Options: ${CONFIGURE_OPTIONS}" 73 -@echo "Using configuration flags:" 74 -@grep "\#define " ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h 75 -@echo "-----------------------------------------" 76 -@echo "Using C/C++ compile: ${PETSC_COMPILE}" 77 -@if [ "${FC}" != "" ]; then \ 78 echo "Using Fortran compile: ${PETSC_FCOMPILE}";\ 79 fi 80 -@if [ "${CUDAC}" != "" ]; then \ 81 echo "Using CUDA compile: ${PETSC_CUCOMPILE}";\ 82 fi 83 -@echo "-----------------------------------------" 84 -@echo "Using C/C++ linker: ${PCC_LINKER}" 85 -@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}" 86 -@if [ "${FC}" != "" ]; then \ 87 echo "Using Fortran linker: ${FC_LINKER}";\ 88 echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\ 89 fi 90 -@echo "-----------------------------------------" 91 -@echo "Using libraries: ${PETSC_LIB}" 92 -@echo "------------------------------------------" 93 -@echo "Using mpiexec: ${MPIEXEC}" 94 -@echo "==========================================" 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} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 105 -@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} > tmpf 2>&1 ; ${GREP} -v "has no symbols" tmpf; ${RM} tmpf; 106 -@echo "Completed building libraries" 107 -@echo "=========================================" 108# 109# 110# Builds PETSc test examples for a given architecture 111# 112test: 113 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} test_build 2>&1 | tee ./${PETSC_ARCH}/conf/test.log 114testx: 115 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testx_build 2>&1 | tee ./${PETSC_ARCH}/conf/testx.log 116test_build: 117 -@echo "Running test examples to verify correct installation" 118 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 119 @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 120 @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex19 121 @if [ "${FC}" != "" ]; then cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testex5f; fi; 122 @cd src/snes/examples/tutorials >/dev/null; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 123 -@echo "Completed test examples" 124testx_build: 125 -@echo "Running graphics test example to verify correct X11 installation" 126 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}" 127 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 128 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} testxex19 129 @cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} clean 130 -@echo "Completed graphics test example" 131 132testexamples: info 133 -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 134 -@echo "Due to different numerical round-off on certain" 135 -@echo "machines some of the numbers may not match exactly." 136 -@echo "=========================================" 137 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C tree 138 -@echo "Completed compiling and running test examples" 139 -@echo "=========================================" 140testfortran: info 141 -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 142 -@echo "=========================================" 143 -@echo "Due to different numerical round-off on certain" 144 -@echo "machines or the way Fortran formats numbers" 145 -@echo "some of the results may not match exactly." 146 -@echo "=========================================" 147 -@if [ "${FC}" != "" ]; then \ 148 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran tree; \ 149 echo "Completed compiling and running Fortran test examples"; \ 150 else \ 151 echo "Error: No FORTRAN compiler available"; \ 152 fi 153 -@echo "=========================================" 154testexamples_uni: info 155 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 156 -@echo "Due to different numerical round-off on certain" 157 -@echo "machines some of the numbers may not match exactly." 158 -@echo "=========================================" 159 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C_X_MPIUni tree 160 -@echo "Completed compiling and running uniprocessor test examples" 161 -@echo "=========================================" 162testfortran_uni: info 163 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES" 164 -@echo "Due to different numerical round-off on certain" 165 -@echo "machines some of the numbers may not match exactly." 166 -@echo "=========================================" 167 -@if [ "${FC}" != "" ]; then \ 168 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni tree; \ 169 echo "Completed compiling and running uniprocessor fortran test examples"; \ 170 else \ 171 echo "Error: No FORTRAN compiler available"; \ 172 fi 173 -@ 174 -@echo "=========================================" 175 176# Ranlib on the libraries 177ranlib: 178 ${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX} 179 180# Deletes PETSc libraries 181deletelibs: 182 -${RM} -rf ${PETSC_LIB_DIR}/libpetsc*.* 183deletemods: 184 -${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod 185 186# Cleans up build 187allclean: deletelibs deletemods 188 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree 189# 190reconfigure: 191 @${PYTHON} ${PETSC_ARCH}/conf/reconfigure-${PETSC_ARCH}.py 192# 193install: 194 @${PYTHON} ./config/install.py -destDir=${DESTDIR} 195 196newall: 197 -@cd src/sys; @${PYTHON} ${PETSC_DIR}/config/builder.py 198 -@cd src/vec; @${PYTHON} ${PETSC_DIR}/config/builder.py 199 -@cd src/mat; @${PYTHON} ${PETSC_DIR}/config/builder.py 200 -@cd src/dm; @${PYTHON} ${PETSC_DIR}/config/builder.py 201 -@cd src/ksp; @${PYTHON} ${PETSC_DIR}/config/builder.py 202 -@cd src/snes; @${PYTHON} ${PETSC_DIR}/config/builder.py 203 -@cd src/ts; @${PYTHON} ${PETSC_DIR}/config/builder.py 204 205streams: 206 cd src/benchmarks/streams; ${OMAKE} test 207# ------------------------------------------------------------------ 208# 209# All remaining actions are intended for PETSc developers only. 210# PETSc users should not generally need to use these commands. 211# 212# See the users manual for how the tags files may be used from Emacs and Vi/Vim 213# 214alletags: 215 -@${PYTHON} bin/maint/generateetags.py 216 -@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON 217 218allfortranstubs: 219 -@${RM} -rf include/finclude/ftn-auto/*-tmpdir 220 -@${PYTHON} bin/maint/generatefortranstubs.py ${BFORT} ${VERBOSE} 221 -@${PYTHON} bin/maint/generatefortranstubs.py -merge ${VERBOSE} 222 -@${RM} -rf include/finclude/ftn-auto/*-tmpdir 223deletefortranstubs: 224 -@find . -type d -name ftn-auto | xargs rm -rf 225cmakegen: 226 -@${PYTHON} config/cmakegen.py 227# 228# These are here for the target allci and allco, and etags 229# 230 231BMAKEFILES = conf/variables conf/rules conf/test bmake/adic.init bmake/adicmf.init 232SCRIPTS = bin/maint/builddist bin/maint/wwwman bin/maint/xclude bin/maint/bugReport.py bin/maint/buildconfigtest bin/maint/builddistlite \ 233 bin/maint/buildtest bin/maint/checkBuilds.py bin/maint/copylognightly bin/maint/copylognightly.tao bin/maint/countfiles bin/maint/findbadfiles \ 234 bin/maint/fixinclude bin/maint/getexlist bin/maint/getpdflabels.py bin/maint/helpindex.py bin/maint/hosts.local bin/maint/hosts.solaris \ 235 bin/maint/lex.py bin/maint/mapnameslatex.py bin/maint/startnightly bin/maint/startnightly.tao bin/maint/submitPatch.py \ 236 bin/maint/update-docs.py bin/maint/wwwindex.py bin/maint/xcludebackup bin/maint/xcludecblas bin/maint/zap bin/maint/zapall \ 237 config/PETSc/Configure.py config/PETSc/Options.py \ 238 config/PETSc/packages/*.py config/PETSc/utilities/*.py 239 240 241# Builds all the documentation - should be done every night 242alldoc: alldoc1 alldoc2 alldoc3 docsetdate 243 244# Build everything that goes into 'doc' dir except html sources 245alldoc1: chk_loc deletemanualpages chk_concepts_dir 246 -${PYTHON} bin/maint/countpetsccits.py 247 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 248 -@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap 249 -@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap 250 -cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 251 -cd src/docs/tex/manual; ${OMAKE} developers.pdf LOC=${LOC} 252 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 253 -${PYTHON} bin/maint/wwwindex.py ${PETSC_DIR} ${LOC} 254 -${OMAKE} ACTION=manexamples tree_basic LOC=${LOC} 255 -${OMAKE} manconcepts LOC=${LOC} 256 -${OMAKE} ACTION=getexlist tree_basic LOC=${LOC} 257 -${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC} 258 -${PYTHON} bin/maint/helpindex.py ${PETSC_DIR} ${LOC} 259 260# Builds .html versions of the source 261# html overwrites some stuff created by update-docs - hence this is done later. 262alldoc2: chk_loc 263 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC} 264 -${PYTHON} bin/maint/update-docs.py ${PETSC_DIR} ${LOC} 265# 266# Builds HTML versions of Matlab scripts 267alldoc3: chk_loc 268 if [ "${MATLAB_COMMAND}" != "" ]; then\ 269 export MATLABPATH=${MATLABPATH}:${PETSC_DIR}/bin/matlab; \ 270 cd ${PETSC_DIR}/bin/matlab; ${MATLAB_COMMAND} -nodisplay -nodesktop -r "generatehtml;exit" ; \ 271 cd classes; ${MATLAB_COMMAND} -nodisplay -nodesktop -r "generatehtml;exit" ; \ 272 cd examples/tutorials; ${MATLAB_COMMAND} -nodisplay -nodesktop -r "generatehtml;exit" ; \ 273 fi 274 275# modify all generated html files and add in version number, date, canonical URL info. 276docsetdate: chkpetsc_dir 277 @echo "Updating generated html files with petsc version, date, canonical URL info";\ 278 version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 279 version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 280 version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 281 version_patch=`grep '^#define PETSC_VERSION_PATCH ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \ 282 if [ $${version_release} = 0 ]; then \ 283 petscversion=petsc-dev; \ 284 export petscversion; \ 285 elif [ $${version_release} = 1 ]; then \ 286 petscversion=petsc-$${version_major}.$${version_minor}-p$${version_patch}; \ 287 export petscversion; \ 288 else \ 289 echo "Unknown PETSC_VERSION_RELEASE: $${version_release}"; \ 290 exit; \ 291 fi; \ 292 datestr=`hg tip --template "{date|shortdate}"`; \ 293 export datestr; \ 294 find * -type d -wholename src/docs/website -prune -o -type d -wholename src/benchmarks/results -prune -o \ 295 -type d -wholename arch-* -prune -o -type d -wholename src/tops -prune -o -type d -wholename externalpackages -prune -o \ 296 -type f -wholename tutorials/multiphysics/tutorial.html -prune -o -type f -name \*.html \ 297 -exec perl -pi -e 's^(<body.*>)^$$1\n <div id=\"version\" align=right><b>$$ENV{petscversion} $$ENV{datestr}</b></div>^i' {} \; \ 298 -exec perl -pi -e 's^(<head>)^$$1 <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/{}" />^i' {} \; ; \ 299 echo "Done fixing version number, date, canonical URL info" 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 ${PYTHON} 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@login.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@login.mcs.anl.gov:/mcs/web/research/projects/petsc/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=documentation/index.html \ 351 --exclude=documentation/installation.html --exclude=download/index.html \ 352 ${PETSC_DIR}/src/docs/website/ petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc 353 @cd ${PETSC_DIR}/docs; /usr/bin/rsync -az developers.pdf petsc@login.mcs.anl.gov:/mcs/web/research/projects/petsc/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# See script for details 364# 365gcov: 366 -@${PETSC_DIR}/bin/maint/gcov.py -run_gcov 367 368mergegcov: 369 -@${PETSC_DIR}/bin/maint/gcov.py -merge_gcov ${LOC} *.tar.gz 370 371# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28 372allrcslabel: 373 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel alltree 374# 375# The commands below are for generating ADIC versions of the code; 376# they are not currently used. 377# 378alladicignore: 379 -@${RM} ${INSTALL_LIB_DIR}/adicignore 380 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore tree 381 382alladic: 383 -@echo "Beginning to compile ADIC source code in all directories" 384 -@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}" 385 -@echo "=========================================" 386 -@cd include ; \ 387 ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petscsys.h 388 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 389 390alladiclib: 391 -@echo "Beginning to compile ADIC libraries in all directories" 392 -@echo "Using compiler: ${PCC} ${COPTFLAGS}" 393 -@echo "-----------------------------------------" 394 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 395 -@echo "-----------------------------------------" 396 -@echo "Using configuration flags:" 397 -@grep "define " ${PETSC_ARCH}/include/petscconf.h 398 -@echo "-----------------------------------------" 399 -@echo "Using include paths: ${CC_PETSC_INCLUDE}" 400 -@echo "-----------------------------------------" 401 -@echo "Using PETSc directory: ${PETSC_DIR}" 402 -@echo "Using PETSc arch: ${PETSC_ARCH}" 403 -@echo "=========================================" 404 -@${RM} -f ${INSTALL_LIB_DIR}/*adic.${AR_LIB_SUFFIX} 405 -@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 406 -@cd src/adic/src ; \ 407 ${OMAKE} PETSC_ARCH=${PETSC_ARCH} lib 408 409# ------------------------------------------------------------------------------- 410# 411# Some macros to check if the fortran interface is up-to-date. 412# 413countfortranfunctions: 414 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 415 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 416 sed "s/_$$//" | sort > /tmp/countfortranfunctions 417 418countcfunctions: 419 -@grep extern ${PETSC_DIR}/include/*.h | grep "(" | tr -s ' ' | \ 420 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 421 tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 422 423difffortranfunctions: countfortranfunctions countcfunctions 424 -@echo -------------- Functions missing in the fortran interface --------------------- 425 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 426 -@echo ----------------- Functions missing in the C interface ------------------------ 427 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 428 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 429 430checkbadfortranstubs: 431 -@echo "=========================================" 432 -@echo "Functions with MPI_Comm as an Argument" 433 -@echo "=========================================" 434 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 435 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 436 -@echo "=========================================" 437 -@echo "Functions with a String as an Argument" 438 -@echo "=========================================" 439 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 440 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 441 -@echo "=========================================" 442 -@echo "Functions with Pointers to PETSc Objects as Argument" 443 -@echo "=========================================" 444 -@cd ${PETSC_DIR}/src/fortran/auto; \ 445 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 446 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 447 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 448 for OBJ in $$_p_OBJ; do \ 449 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 450 cut -d'(' -f1 | cut -d' ' -f1,3; \ 451 done 452# 453# Automatically generates PETSc exercises in html from the tutorial examples. 454# 455# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited 456# (used also in introductions to the manual pages) 457# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited 458# The list of exercises is from TUTORIALS in each directory's makefile 459# 460# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced. 461# The pagemaker rule is in the file conf (at the bottom) 462# 463# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 464# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 465# 466exercises: 467 -@echo "=========================================" 468 -@echo "Generating HTML tutorial exercises" 469 -@${RM} docs/pageform.txt 470 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 471 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 472 -@echo "access_format=short" >> docs/pageform.txt 473 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 474 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 475 -@echo "Generating HTML for individual directories" 476 -@echo "=========================================" 477 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 478 -@echo "Completed HTML for individual directories" 479 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 480 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 481 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 482 -@echo "=========================================" 483 484.PHONY: info info_h all build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update \ 485 alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \ 486 allhtml allcleanhtml allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \ 487 start_configure configure_petsc configure_clean 488 489petscao : petscmat petscao.f90.h 490petscdm : petscksp petscdm.f90.h 491petscdraw : petsc petscdraw.f90.h 492petscis : petsc petscis.f90.h 493petscksp : petscpc petscksp.f90.h 494petsclog : petsc petsclog.f90.h 495petscmat : petscvec petscmat.f90.h 496petscmg : petscksp petscmg.f90.h 497petscpc : petscmat petscpc.f90.h 498petscsnes : petscksp petscsnes.f90.h 499petscsys : petsc petscsys.f90.h 500petscts : petscsnes petscts.f90.h 501petsc : petsc.f90.h 502petscvec : petscis petscvec.f90.h 503petscviewer : petsc petscviewer.f90.h 504petscmesh : petsc petscmesh.f90.h 505modules : petscao petscdm petscdraw petscis petscksp petsclog petscmat petscmg petscpc petscsnes petscsys petscts petsc petscvec petscviewer petscmesh 506