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# 139# 140MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h 141info_h: 142 -@$(RM) -f MINFO ${MINFO} 143 -@echo "static char *petscmachineinfo = \" " >> MINFO 144 -@echo "Libraries compiled on `date` on `hostname` " >> MINFO 145 -@echo Machine characteristics: `uname -a` "" >> MINFO 146 -@echo "Using PETSc directory: ${PETSC_DIR}" >> MINFO 147 -@echo "Using PETSc arch: ${PETSC_ARCH}" >> MINFO 148 -@echo "-----------------------------------------\"; " >> MINFO 149 -@echo "static char *petsccompilerinfo = \" " >> MINFO 150 -@echo "Using C compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO 151 -@if [ "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \ 152 echo "C Compiler version:" >> MINFO ; ${C_CCV} >> MINFO 2>&1; fi ; true 153 -@if [ "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \ 154 echo "C++ Compiler version:" >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; fi ; true 155 -@echo "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO 156 -@if [ "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \ 157 echo "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; fi ; true 158 -@echo "-----------------------------------------\"; " >> MINFO 159 -@echo "static char *petsccompilerflagsinfo = \" " >> MINFO 160 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO 161 -@echo "-----------------------------------------" >> MINFO 162 -@echo "Using configuration flags:" >> MINFO 163 -@echo "-----------------------------------------" >> MINFO 164 -@echo "Using include paths: ${PETSC_INCLUDE}" >> MINFO 165 -@echo "------------------------------------------\"; " >> MINFO 166 -@echo "static char *petsclinkerinfo = \" " >> MINFO 167 -@echo "Using C linker: ${CLINKER}" >> MINFO 168 -@echo "Using Fortran linker: ${FLINKER}" >> MINFO 169 -@echo "Using libraries: ${PETSC_LIB} \"; " >> MINFO 170 -@cat MINFO | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\; \\n\\/\;/'> ${MINFO} 171 -@$(RM) MINFO 172# 173# Builds the PETSc libraries 174# This target also builds fortran77 and f90 interface 175# files and compiles .F files 176# 177build: 178 -@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES" 179 -@echo "=========================================" 180 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree 181 -@${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX} 182 -@echo "Completed building libraries" 183 -@echo "=========================================" 184# 185# Builds PETSc test examples for a given BOPT and architecture 186# 187testexamples: info chkopts 188 -@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES" 189 -@echo "Due to different numerical round-off on certain" 190 -@echo "machines some of the numbers may not match exactly." 191 -@echo "=========================================" 192 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1 tree 193 -@echo "Completed compiling and running test examples" 194 -@echo "=========================================" 195testfortran: info chkopts 196 -@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES" 197 -@echo "=========================================" 198 -@echo "Due to different numerical round-off on certain" 199 -@echo "machines or the way Fortran formats numbers" 200 -@echo "some of the results may not match exactly." 201 -@echo "=========================================" 202 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3 tree 203 -@echo "Completed compiling and running Fortran test examples" 204 -@echo "=========================================" 205testexamples_uni: info chkopts 206 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES" 207 -@echo "Due to different numerical round-off on certain" 208 -@echo "machines some of the numbers may not match exactly." 209 -@echo "=========================================" 210 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4 tree 211 -@echo "Completed compiling and running uniprocessor test examples" 212 -@echo "=========================================" 213testfortran_uni: info chkopts 214 -@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES" 215 -@echo "Due to different numerical round-off on certain" 216 -@echo "machines some of the numbers may not match exactly." 217 -@echo "=========================================" 218 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9 tree 219 -@echo "Completed compiling and running uniprocessor fortran test examples" 220 -@echo "=========================================" 221 222# Ranlib on the libraries 223ranlib: 224 ${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX} 225 226# Deletes PETSc libraries 227deletelibs: chkopts_basic 228 -${RM} -f ${PETSC_LIB_DIR}/* 229 230# Cleans up build 231allclean: deletelibs 232 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree 233 234# 235# Updates your PETSc version to the latest set of patches 236# 237update: 238 -@bin/petscupdate 239 240# 241# Check if PETSC_DIR variable specified is valid 242# 243chk_petsc_dir: 244 @if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \ 245 echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \ 246 echo "You need to use / to separate directories, not \\!"; \ 247 echo "Aborting build"; \ 248 false; fi 249 250# ------------------------------------------------------------------ 251# 252# All remaining actions are intended for PETSc developers only. 253# PETSc users should not generally need to use these commands. 254# 255 256# To access the tags in EMACS, type M-x visit-tags-table and specify 257# the file petsc/TAGS. 258# 1) To move to where a PETSc function is defined, enter M-. and the 259# function name. 260# 2) To search for a string and move to the first occurrence, 261# use M-x tags-search and the string. 262# To locate later occurrences, use M-, 263# Builds all etags files 264alletags: 265 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags 266 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_complete 267 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples 268 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples 269 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles 270# Builds the basic etags file. This should be employed by most users. 271etags: 272 -${RM} ${TAGSDIR}/TAGS 273 -touch ${TAGSDIR}/TAGS 274 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree 275 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree 276 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree 277 -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree 278 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree 279 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree 280 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree 281 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree 282 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree 283 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles 284# Builds complete etags list; only for PETSc developers. 285etags_complete: 286 -${RM} ${TAGSDIR}/TAGS_COMPLETE 287 -touch ${TAGSDIR}/TAGS_COMPLETE 288 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcec alltree 289 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcej alltree 290 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourceh alltree 291 -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcef alltree 292 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesc alltree 293 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesf alltree 294 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesch alltree 295 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesfh alltree 296 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_makefile alltree 297 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE etags_bmakefiles 298 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_docs alltree 299 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_scripts alltree 300# Builds the etags file that excludes the examples directories 301etags_noexamples: 302 -${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES 303 -touch ${TAGSDIR}/TAGS_NO_EXAMPLES 304 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree 305 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree 306 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree 307 -cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree 308 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree 309 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles 310 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree 311# Builds the etags file for makefiles 312etags_makefiles: 313 -${RM} ${TAGSDIR}/TAGS_MAKEFILES 314 -touch ${TAGSDIR}/TAGS_MAKEFILES 315 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree 316 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles 317# Builds the etags file for examples 318etags_examples: 319 -${RM} ${TAGSDIR}/TAGS_EXAMPLES 320 -touch ${TAGSDIR}/TAGS_EXAMPLES 321 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree 322 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree 323 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree 324 -${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree 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# 331# These are here for the target allci and allco, and etags 332# 333 334BMAKEFILES = bmake/common/base bmake/common/test \ 335 bmake/common/bopt* bmake/*/rules bmake/*/variables bmake/*/packages \ 336 bmake/*/petscconf.h bmake/*/petscfix.h bmake/config/packages.in \ 337 bmake/config/petscfix.h.in bmake/config/rules.in bmake/config/stamp-h.in \ 338 bmake/config/variables.in \ 339 bmake/*/buildtest bmake/adic.init bmake/adicmf.init 340DOCS = bmake/readme bmake/petscconf.defs 341SCRIPTS = maint/addlinks maint/builddist maint/buildlinks maint/wwwman \ 342 maint/xclude maint/crontab \ 343 maint/autoftp 344 345updatewebdocs: 346 -chmod -R ug+w /mcs/tmp/petsc-tmp 347 -chgrp -R petsc /mcs/tmp/petsc-tmp 348 -/bin/rm -rf /mcs/tmp/petscdocs 349 -/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs 350 -maint/update-docs.py /mcs/tmp/petscdocs 351 -find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \; 352 -/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs 353 -/bin/rm -rf /mcs/tmp/petscdocs 354 355chk_loc: 356 @if [ ${LOC}foo = foo ] ; then \ 357 echo "*********************** ERROR ************************" ; \ 358 echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \ 359 echo "******************************************************"; false; fi 360# Deletes man pages (HTML version) 361deletemanualpages: chk_loc 362 find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; 363 ${RM} ${LOC}/docs/manualpages/manualpages.cit 364 365# Builds all the documentation - should be done every night 366alldoc: chk_loc deletemanualpages chk_concepts_dir 367 -${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC} 368 cd docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC} 369 -${OMAKE} ACTION=manualpages tree_basic LOC=${LOC} 370 -maint/wwwindex.py ${PETSC_DIR} ${LOC} 371 -${OMAKE} ACTION=manexamples tree LOC=${LOC} 372 -${OMAKE} manconcepts LOC=${LOC} 373 -${OMAKE} ACTION=getexlist tree LOC=${LOC} 374 -${OMAKE} ACTION=exampleconcepts tree LOC=${LOC} 375 -maint/helpindex.py ${PETSC_DIR} ${LOC} 376 377# Builds .html versions of the source 378allhtml: chk_loc 379 -${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} tree LOC=${LOC} 380 381allcleanhtml: 382 -${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} tree 383 384chk_concepts_dir: chk_loc 385 @if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \ 386 echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi 387# Builds Fortran stub files 388allfortranstubs: 389 -@${RM} -f src/fortran/auto/*.c 390 -${OMAKE} ACTION=fortranstubs tree_basic 391 -@cd src/fortran/auto; ${RM} makefile.src; echo SOURCEC = `find . -type f -name "*.c" -printf "%f "` > makefile.src 392 -@cd src/fortran/auto; ${OMAKE} fixfortran 393 394allci: 395 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci alltree 396 397allco: 398 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co alltree 399 400# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28 401allrcslabel: 402 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel alltree 403# 404# The commands below are for generating ADIC versions of the code; 405# they are not currently used. 406# 407alladicignore: 408 -@${RM} ${INSTALL_LIB_DIR}/adicignore 409 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore tree 410 411alladic: 412 -@echo "Beginning to compile ADIC source code in all directories" 413 -@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}" 414 -@echo "=========================================" 415 -@cd include ; \ 416 ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h 417 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 418 -@cd src/inline ; \ 419 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic 420 -@cd src/blaslapack ; \ 421 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic tree 422 423alladiclib: 424 -@echo "Beginning to compile ADIC libraries in all directories" 425 -@echo "Using compiler: ${CC} ${COPTFLAGS}" 426 -@echo "-----------------------------------------" 427 -@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" 428 -@echo "-----------------------------------------" 429 -@echo "Using configuration flags:" 430 -@grep "define " bmake/${INLUDE_ARCH}/petscconf.h 431 -@echo "-----------------------------------------" 432 -@echo "Using include paths: ${PETSC_INCLUDE}" 433 -@echo "-----------------------------------------" 434 -@echo "Using PETSc directory: ${PETSC_DIR}" 435 -@echo "Using PETSc arch: ${PETSC_ARCH}" 436 -@echo "=========================================" 437 -@${RM} -f ${INSTALL_LIB_DIR}/*adic.${LIB_SUFFIX} 438 -@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 439 -@cd src/blaslapack ; \ 440 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib tree 441 -@cd src/adic/src ; \ 442 ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib 443 444# ------------------------------------------------------------------------------- 445# 446# Some macros to check if the fortran interface is up-to-date. 447# 448countfortranfunctions: 449 -@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \ 450 cut -d'(' -f1 | tr -s ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \ 451 sed "s/_$$//" | sort > /tmp/countfortranfunctions 452 453countcfunctions: 454 -@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \ 455 cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | \ 456 tr 'A-Z' 'a-z' | sort > /tmp/countcfunctions 457 458difffortranfunctions: countfortranfunctions countcfunctions 459 -@echo -------------- Functions missing in the fortran interface --------------------- 460 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2 461 -@echo ----------------- Functions missing in the C interface ------------------------ 462 -@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2 463 -@${RM} /tmp/countcfunctions /tmp/countfortranfunctions 464 465checkbadfortranstubs: 466 -@echo "=========================================" 467 -@echo "Functions with MPI_Comm as an Argument" 468 -@echo "=========================================" 469 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \ 470 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 471 -@echo "=========================================" 472 -@echo "Functions with a String as an Argument" 473 -@echo "=========================================" 474 -@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \ 475 tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3 476 -@echo "=========================================" 477 -@echo "Functions with Pointers to PETSc Objects as Argument" 478 -@echo "=========================================" 479 -@cd ${PETSC_DIR}/src/fortran/auto; \ 480 _p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \ 481 cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \ 482 sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \ 483 for OBJ in $$_p_OBJ; do \ 484 grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \ 485 cut -d'(' -f1 | cut -d' ' -f1,3; \ 486 done 487# 488# Automatically generates PETSc exercises in html from the tutorial examples. 489# 490# The introduction for each section is obtained from docs/manualpages/bop.${MANSEC} is under RCS and may be edited 491# (used also in introductions to the manual pages) 492# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited 493# The list of exercises is from TUTORIALS in each directory's makefile 494# 495# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced. 496# The pagemaker rule is in the file bmake/common (at the bottom) 497# 498# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed 499# -@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker 500# 501exercises: 502 -@echo "=========================================" 503 -@echo "Generating HTML tutorial exercises" 504 -@${RM} docs/pageform.txt 505 -@echo "title=\"PETSc Exercises\"" > docs/pageform.txt 506 -@echo "access_title=Exercise Sections" >> docs/pageform.txt 507 -@echo "access_format=short" >> docs/pageform.txt 508 -@echo "startpage=../exercises/introduction.htm" >> docs/pageform.txt 509 -@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt 510 -@echo "Generating HTML for individual directories" 511 -@echo "=========================================" 512 -@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree 513 -@echo "Completed HTML for individual directories" 514 -@echo "NONE title=\"<HR>\" " >> docs/pageform.txt; 515 -@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt 516 /home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises 517 -@echo "=========================================" 518 519.PHONY: info info_h build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \ 520 alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \ 521 allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \ 522 start_configure configure_petsc configure_clean 523