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