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