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