1# -*- mode: makefile-gmake -*- 2-include petscdir.mk 3 4.SUFFIXES: .F .F90 .f90 ${SUFFIXES} .PETSc .C .cc .cpp .cxx .r .rm .so .html .ad .m .tex .mtex .make .fig .svg .eps .pdf .jpg .png .dvi .ps .F95 .f95 .fiat .cu .kokkos.cxx 5 6CONFIGDIR := $(PETSC_DIR)/config 7 8# TESTSRCDIR is always relative to gmakefile.test 9# This must be before includes 10mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) 11TESTSRCDIR := $(dir $(mkfile_path))src 12 13-include $(PETSC_DIR)/$(PETSC_ARCH)/lib/petsc/conf/petscvariables 14-include $(PETSC_DIR)/lib/petsc/conf/variables 15 16TESTDIR ?= ./$(PETSC_ARCH)/tests 17MODDIR := $(PETSC_DIR)/$(PETSC_ARCH)/include 18TESTLOGTAPFILE ?= $(TESTDIR)/test_$(PETSC_ARCH)_tap.log 19TESTLOGERRFILE ?= $(TESTDIR)/test_$(PETSC_ARCH)_err.log 20EXAMPLESDIR := $(TESTSRCDIR) 21 22pkgs := sys vec mat dm ksp snes ts tao 23 24petscconf := $(PETSC_DIR)/$(PETSC_ARCH)/include/petscconf.h 25petscvariables := $(PETSC_DIR)/$(PETSC_ARCH)/lib/petsc/conf/petscvariables 26generatedtest := $(TESTDIR)/testfiles 27 28.SECONDEXPANSION: # to expand $$(@D)/.DIR 29 30TESTFLAGS := # Initialize as simple variable 31 32#workarround old cygwin versions 33ifeq ($(PETSC_CYGWIN_BROKEN_PIPE),1) 34ifeq ($(shell basename $(AR)),ar) 35 V ?=1 36endif 37endif 38V ?= $(if $(findstring s,$(MAKEFLAGS)),0) 39ifeq ($(V),) # Default 40 quiet_HELP := "Use \"$(MAKE) V=1\" to see verbose compile lines, \"$(MAKE) V=0\" to suppress.\n" 41 quiet = @printf $(quiet_HELP)$(eval quiet_HELP:=)" %10s %s\n" "$1$2" "$@"; $($1) 42 quiettest = @printf " %10s %s\n" "TEST" "$(@:$(TESTDIR)/counts/%.counts=%)"; 43else ifeq ($(V),0) # Suppress entire command 44 quiet = @$($1) 45 quiettest = @ 46 TESTFLAGS += -o err_only 47else # Show the full command line 48 quiet = $($1) 49 quiettest = 50 TESTFLAGS += -v 51endif 52 53ifeq ($(FORCE),1) 54 TESTFLAGS += -f # force test execution 55endif 56ifeq ($(CUDAMEMCHECK),1) 57 TESTFLAGS += -U # Add cuda-memcheck option to the flags 58endif 59ifeq ($(VALGRIND),1) 60 TESTFLAGS += -V # Add valgrind option to the flags 61endif 62ifeq ($(REPLACE),1) 63 TESTFLAGS += -m # Replace results by passing -m to petscdiff 64endif 65ifeq ($(OUTPUT),1) 66 TESTFLAGS += -o 'err_only' # Show only the errors on stdout 67endif 68ifeq ($(ALT),1) 69 TESTFLAGS += -M # Replace alt files by passing -M to petscdiff 70endif 71PRINTONLY ?= 0 72ifeq ($(PRINTONLY),1) 73 TESTFLAGS += -p # Pass -p to petscdiff to print only command 74endif 75ifeq ($(DIFF_NUMBERS),1) 76 TESTFLAGS += -j # Pass -j to petscdiff to diff the actual numbers 77endif 78ifdef OPTIONS 79 TESTFLAGS += -a '$(OPTIONS)' # override arguments 80endif 81ifdef EXTRA_OPTIONS 82 TESTFLAGS += -e '$(EXTRA_OPTIONS)' # add extra arguments 83endif 84ifdef NP 85 TESTFLAGS += -n $(NP) # set number of processes 86endif 87# Override the default timeout that may be found at the top of config/petsc_harness.sh 88# This must be an integer. It is given in seconds. 89ifdef TIMEOUT 90 TESTFLAGS += -t $(TIMEOUT) # Override the default timeout 91endif 92 93$(generatedtest) : $(petscconf) $(petscvariables) $(CONFIGDIR)/gmakegentest.py $(TESTDIR)/.DIR | $$(@D)/.DIR 94 $(PYTHON) $(CONFIGDIR)/gmakegentest.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --testdir=$(TESTDIR) 95 96ifneq ($(filter-out clean check,$(MAKECMDGOALS:clean%=clean)),) 97include $(generatedtest) 98endif 99 100ifeq ($(PETSC_LANGUAGE),CXXONLY) 101 cc_name := CXX 102else 103 cc_name := CC 104endif 105 106PETSC_COMPILE.c = $(call quiet,$(cc_name)) -c $(PCC_FLAGS) $(PFLAGS) $(CCPPFLAGS) $(C_DEPFLAGS) 107PETSC_COMPILE.cxx = $(call quiet,CXX) -c $(CXX_FLAGS) $(CXXFLAGS) $(CXXCPPFLAGS) $(CXX_DEPFLAGS) 108ifneq ($(KOKKOS_BIN),) 109# Kokkos requires nvcc to be in PATH and the C++ compiler to be given in an environmental variable 110PETSC_COMPILE.kokkos.cxx = PATH=$(PATH):`dirname $(CUDAC)` NVCC_WRAPPER_DEFAULT_COMPILER=$(CXX_LINKER) $(KOKKOS_BIN)/nvcc_wrapper --expt-extended-lambda -c $(CXX_FLAGS) $(CXXFLAGS) $(CXXCPPFLAGS) 111PETSC_LINK.kokkos.cxx = PATH=$(PATH):`dirname $(CUDAC)` NVCC_WRAPPER_DEFAULT_COMPILER=$(CXX_LINKER) $(KOKKOS_BIN)/nvcc_wrapper --expt-extended-lambda $(CXX_LINKER_FLAGS) $(PETSC_CCPPFLAGS) $(CPPFLAGS) $(LDFLAGS) 112else 113PETSC_COMPILE.kokkos.cxx = $(call quiet,CXX) -c $(CXX_FLAGS) $(CXXFLAGS) $(CXXCPPFLAGS) $(CXX_DEPFLAGS) 114PETSC_LINK.kokkos.cxx = $(CXXLINKER) $(CXX_LINKER_FLAGS) $(CXXFLAGS) $(PETSC_CCPPFLAGS) $(CPPFLAGS) $(LDFLAGS) 115endif 116PETSC_COMPILE.cu = $(call quiet,CUDAC) -c $(CUDAC_FLAGS) $(CUFLAGS) --compiler-options="$(PCC_FLAGS) $(CXXFLAGS) $(CCPPFLAGS)" 117PETSC_COMPILE.hip.cpp = $(call quiet,HIPCC) -c $(HIPCC_FLAGS) $(HIPCCFLAGS) $(HIPCCPPFLAGS) $(HIPCC_DEPFLAGS) 118PETSC_COMPILE.sycl.cpp = $(call quiet,SYCLCPP) -c $(SYCLCPP_FLAGS) $(SYCLCPPFLAGS) $(SYCLCPPCPPFLAGS) $(SYCLCPP_DEPFLAGS) 119PETSC_GENDEPS.cu = $(call quiet,CUDAC,.dep) --generate-dependencies --output-directory=$(@D) $(CUDAC_FLAGS) $(CUFLAGS) --compiler-options="$(PCC_FLAGS) $(CXXFLAGS) $(CCPPFLAGS)" 120PETSC_COMPILE.F = $(call quiet,FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) 121 122testlangs := c cu cxx F F90 kokkos.cxx hip.cpp sycl.cpp 123$(foreach lang, $(testlangs), $(eval \ 124 testexe.$(lang) = $(foreach pkg, $(pkgs), $(testsrcs-$(pkg).$(lang):%.$(lang)=$(TESTDIR)/%)))) 125concattestlang = $(foreach lang, $(2), $(testsrcs-$(1).$(lang):%.$(lang)=$(TESTDIR)/%.o)) 126testsrcs.o := $(foreach pkg, $(pkgs), $(call concattestlang,$(pkg),$(testlangs))) 127testsrcs-rel := $(foreach pkg, $(pkgs), $(foreach lang, $(testlangs), $(testsrcs-$(pkg).$(lang)))) 128testsrcs := $(foreach sfile, $(testsrcs-rel), $(TESTSRCDIR)/$(sfile)) 129 130# workaround win32fe failure 131ifneq (,$(findstring win32fe,$(call quiet,$(cc_name)))) 132$(TESTDIR)/ts/tutorials/multirate/ex6: | $(TESTDIR)/ts/tutorials/multirate/ex5 133$(TESTDIR)/ts/tutorials/multirate/ex8: | $(TESTDIR)/ts/tutorials/multirate/ex6 134endif 135 136# Refresh testfiles when sources change, but don't balk if the source file is nonexistent (deleted) 137$(generatedtest) : $(testsrcs) 138$(testsrcs) : 139 140$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.c | $$(@D)/.DIR 141 $(PETSC_COMPILE.c) $(abspath $<) -o $@ 142 143$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.kokkos.cxx | $$(@D)/.DIR 144 $(PETSC_COMPILE.kokkos.cxx) $(abspath $<) -o $@ 145 146$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.cxx | $$(@D)/.DIR 147 $(PETSC_COMPILE.cxx) $(abspath $<) -o $@ 148 149$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.cu | $$(@D)/.DIR 150 $(PETSC_COMPILE.cu) $(abspath $<) -o $@ # Compile first so that if there is an error, it comes from a normal compile 151 @$(PETSC_GENDEPS.cu) $(abspath $<) -o $(@:%.o=%.d) # Generate the dependencies for later 152 153# Test modules go in the same directory as the target *.o 154TESTMODDIR = $(@D) 155FCMOD = cd 156$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.F | $$(@D)/.DIR 157ifeq ($(FC_MODULE_OUTPUT_FLAG),) 158 $(call quiet,FCMOD) $(TESTMODDIR) && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) -I$(dir $<) $(abspath $<) -o $(abspath $@) 159else 160 $(PETSC_COMPILE.F) -I$(dir $<) $(abspath $<) -o $@ $(FC_MODULE_OUTPUT_FLAG)$(TESTMODDIR) $(FC_MODULE_FLAG)$(TESTMODDIR) 161endif 162 -@$(GFORTRAN_DEP_CLEANUP) 163 164$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.F90 | $$(@D)/.DIR 165ifeq ($(FC_MODULE_OUTPUT_FLAG),) 166 $(call quiet,FCMOD) $(TESTMODDIR) && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) -I$(dir $<) $(abspath $<) -o $(abspath $@) 167else 168 $(PETSC_COMPILE.F) -I$(dir $<) $(abspath $<) -o $@ $(FC_MODULE_OUTPUT_FLAG)$(TESTMODDIR) $(FC_MODULE_FLAG)$(TESTMODDIR) 169endif 170 -@$(GFORTRAN_DEP_CLEANUP) 171 172# This is a hack to fix a broken gfortran. 173define GFORTRAN_DEP_CLEANUP 174 if test -e "$(@:%.o=%.d)" && head -1 "$(@:%.o=%.d)" | fgrep -q -v : ; then\ 175 echo "$(@): \\" > $(@:%.o=%.dtemp) ; \ 176 tr '\n' '@' < $(@:%.o=%.d) | cut -d: -f2- | tr '@' '\n' >> $(@:%.o=%.dtemp) ; \ 177 mv $(@:%.o=%.dtemp) $(@:%.o=%.d); \ 178 fi 179endef 180 181# link line constructed differently for gmakefile vs gmakefile.test invocation 182ifeq ($(libpetscall),) 183PETSC_TEST_LIB = $(PETSC_LIB) 184else 185PETSC_TEST_LIB = $(C_SH_LIB_PATH) $(PETSC_EXTERNAL_LIB_BASIC) 186endif 187 188# manually list some some library dependencies to check for circular dependencies 189$(TESTDIR)/sys/tests/ex9: PETSC_TEST_LIB = $(PETSC_SYS_LIB) 190$(TESTDIR)/vec/vec/tests/ex1: PETSC_TEST_LIB = $(PETSC_VEC_LIB) 191$(TESTDIR)/mat/tests/ex1: PETSC_TEST_LIB = $(PETSC_MAT_LIB) 192$(TESTDIR)/dm/tests/ex1: PETSC_TEST_LIB = $(PETSC_DM_LIB) 193$(TESTDIR)/ksp/ksp/tests/ex1: PETSC_TEST_LIB = $(PETSC_KSP_LIB) 194$(TESTDIR)/snes/tests/ex1: PETSC_TEST_LIB = $(PETSC_SNES_LIB) 195$(TESTDIR)/ts/tests/ex2: PETSC_TEST_LIB = $(PETSC_TS_LIB) 196$(TESTDIR)/tao/tutorials/ex1: PETSC_TEST_LIB = $(PETSC_TAO_LIB) 197 198# if configured --with-macos-firewall-rules, ensure mpiexec.hydra and test executable is on firewall list 199ifdef MACOS_FIREWALL_MPIEXEC 200define macos-firewall-register 201 @APP=$(call abspath, $(1)); \ 202 FW=/usr/libexec/ApplicationFirewall/socketfilterfw; \ 203 ANS=`$$FW --getappblocked $$APP`; \ 204 if ! echo $$ANS | grep "$$APP" &> /dev/null; then \ 205 if ! sudo -n true 2>/dev/null; then echo "Asking for sudo password to add new firewall rule for\n $$APP:"; fi; \ 206 sudo $$FW --add $$APP && \ 207 sudo $$FW --block $$APP; \ 208 else \ 209 echo $$ANS; \ 210 fi 211endef 212define macos-firewall-fix 213 $(call macos-firewall-register, $(MACOS_FIREWALL_MPIEXEC)) 214 $(call macos-firewall-register, $(1)) 215endef 216endif 217 218# Test executables 219$(testexe.F) $(testexe.F90) : $(TESTDIR)/% : $(TESTDIR)/%.o $$^ $(libpetscall) 220 $(call quiet,FLINKER) -o $@ $^ $(PETSC_TEST_LIB) 221 -$(call macos-firewall-fix,$@) 222 223$(testexe.c) $(testexe.cu) : $(TESTDIR)/% : $(TESTDIR)/%.o $$^ $(libpetscall) 224 $(call quiet,CLINKER) -o $@ $^ $(PETSC_TEST_LIB) 225 -$(call macos-firewall-fix,$@) 226 227$(testexe.kokkos.cxx) : $(TESTDIR)/% : $(TESTDIR)/%.o $$^ $(libpetscall) 228 $(call quiet,PETSC_LINK.kokkos.cxx) -o $@ $^ $(PETSC_TEST_LIB) 229 -$(call macos-firewall-fix,$@) 230 231$(testexe.cxx) : $(TESTDIR)/% : $(TESTDIR)/%.o $$^ $(libpetscall) 232 $(call quiet,CXXLINKER) -o $@ $^ $(PETSC_TEST_LIB) 233 -$(call macos-firewall-fix,$@) 234 235# Fortran source files need petsc*.mod, which isn't explicitly managed in the makefile. 236$(foreach pkg, $(pkgs), $(call concattestlang,$(pkg),F F90)) : $(libpetscall) 237 238# Testing convenience targets 239.PHONY: test pre-clean 240 241test: report_tests 242 243pre-clean: 244 @$(RM) -rf $(TESTDIR)/counts $(TESTLOGTAPFILE) $(TESTLOGERRFILE) 245 @touch $(TESTLOGTAPFILE) $(TESTLOGERRFILE) 246 @echo "Using MAKEFLAGS:" ${MAKEFLAGS} 247 248check-test-errors: 249 @grep '^not ok' $(TESTLOGTAPFILE) | grep -v 'Exceeded timeout' | tee $(TESTDIR)/allgtests-tap-err.log 250 @test ! -s $(TESTDIR)/allgtests-tap-err.log 251 252.PHONY: $(foreach pkg, $(pkgs), test-$(pkg) $(foreach lang, $(testlangs), test-$(pkg).$(lang) test-rm-$(pkg).$(lang))) 253testpkgs := $(foreach pkg, $(pkgs), test-$(pkg)) 254# Targets to run tests in test-$pkg.$lang and delete the executables, language by language 255$(testpkgs) : test-% : $(foreach lang, $(testlangs), test-rm-%.$(lang)) 256# List of raw test run targets 257alltesttargets := $(foreach tp, $(testpkgs), $(foreach lang, $(testlangs), $($(tp).$(lang)))) 258 259# Run targets 260$(alltesttargets) : % : $(TESTDIR)/counts/%.counts 261.PHONY: $(alltesttargets) 262 263$(TESTDIR)/counts/%.counts : 264 $(quiettest) $< $(TESTFLAGS) 265 266# Targets to run tests and remove executables, by package-lang pairs. 267# Run the tests in each batch using recursive invocation of make because 268# we need all of them to complete before removing the executables. Make 269# doesn't guarantee an exploration order for the graph. Only recursive 270# if there is something to be done. 271alltest-rm := $(foreach pkg, $(pkgs), $(foreach lang, $(testlangs), test-rm-$(pkg).$(lang))) 272$(alltest-rm) : test-rm-% : test-% 273ifneq ($(NO_RM),1) 274 $(call quiet,RM) $(addprefix $(TESTDIR)/,$(basename $($(@:test-rm-%=testsrcs-%)))) 275endif 276 277# Remove intermediate .o files 278# This only removes the files at the end which is insufficient 279#.INTERMEDIATE: $(testsrcs.o:%.o=%) 280 281# all sources should get recompiled when petscvariables changes (i.e when configure is rerun or when petscvariables is manually edited.) 282$(testsrcs.o) : $(petscvariables) 283 284%/.DIR : 285 @mkdir -p $(@D) 286 @touch $@ 287 288.PRECIOUS: %/.DIR 289 290.SUFFIXES: # Clear .SUFFIXES because we don't use implicit rules 291.DELETE_ON_ERROR: # Delete likely-corrupt target file if rule fails 292 293.PHONY: clean cleantest all 294 295cleantest: 296 ${RM} -r $(TESTDIR) $(generatedtest) 297 298clean: cleantest 299 300alltest.d := $(testsrcs.o:%.o=%.d) 301# Tell make that alltest.d are all up to date. Without this, the include 302# below has quadratic complexity, taking more than one second for a 303# do-nothing build of PETSc (much worse for larger projects) 304$(alltest.d) : ; 305 306-include $(alltest.d) 307 308# Tests can be generated by searching 309# Percent is a wildcard (only one allowed): 310# make -f gmakefile test search=sys%ex2 311# To match internal substrings (matches *ex2*): 312# make -f gmakefile test searchin=ex2 313# Search and searchin can be combined: 314# make -f gmakefile test search='sys%' searchin=ex2 315# For args: 316# make -f gmakefile test argsearch=cuda 317# For general glob-style searching using python: 318# NOTE: uses shell which is possibly slower and is possibly more brittle 319# make -f gmakefile test globsearch='sys*ex2*' 320ifdef search 321 TESTTARGETS := $(filter $(search),$(alltesttargets)) 322 ifdef searchin 323 TESTTARGETS2 := $(foreach v,$(TESTTARGETS),$(if $(findstring $(searchin),$(v)),$(v))) 324 TESTTARGETS := $(TESTTARGETS2) 325 endif 326else ifdef searchin 327 TESTTARGETS := $(foreach v,$(alltesttargets),$(if $(findstring $(searchin),$(v)),$(v))) 328else ifdef argsearch 329 TESTTARGETS := $(foreach v,$(alltesttargets),$(if $(findstring $(argsearch),$($(v)_ARGS)),$(v))) 330else ifdef globsearch 331 TESTTARGETS := $(shell $(PYTHON) config/query_tests.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) 'name' '$(globsearch)') 332else ifdef test-fail 333 TESTTARGETS := $(shell $(PETSC_ARCH)/tests/echofailures.sh) 334else ifdef query 335 TESTTARGETS := $(shell $(PYTHON) config/query_tests.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) '$(query)' '$(queryval)') 336else # No filter - run them all, but delete the executables as we go 337 TESTTARGETS := $(testpkgs) 338endif 339 340.PHONY: report_tests print-test 341 342print-test: 343 $(info $(TESTTARGETS)) 344 @true 345 346show-fail: 347 -@$(PYTHON) $(CONFIGDIR)/report_tests.py -d $(TESTDIR)/counts -f 348 349 350 351# Don't start running tests until starttime has completed 352$(alltesttargets:%=$(TESTDIR)/counts/%.counts) : starttime 353 354# Ensure that libpetsc (if it is a prerequisite) has been built and clean the counts/logs before starting timer 355starttime: pre-clean $(libpetscall) 356 @$(eval STARTTIME := $(shell date +%s)) 357 358report_tests: starttime $(TESTTARGETS) 359 @$(eval ENDTIME := $(shell date +%s)) 360 -@if test ${PRINTONLY} -ne 1; then elapsed_time=$$(($(ENDTIME)- $(STARTTIME))) && \ 361 $(PYTHON) $(CONFIGDIR)/report_tests.py -m $(MAKE) -d $(TESTDIR)/counts -t 5 -e $${elapsed_time};\ 362 fi 363 364check_output: 365 $(PYTHON) $(CONFIGDIR)/gmakegentest.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --testdir=$(TESTDIR) --check-output 366 367# Do not how how to invoke test from makefile 368HASGMAKEFILE := $(filter gmakefile,$(MAKEFILE_LIST)) 369ifeq ($(HASGMAKEFILE),gmakefile) 370helpdeps:=help-make help-targets 371makefile="gmakefile" 372other_help="To see full test help: make -f gmakefile.test help" 373else 374helpdeps:=help-make help-targets help-test 375makefile="gmakefile.test" 376other_help="" 377endif 378 379help: ${helpdeps} 380 -@echo "Above is from: ${helpdeps}" 381 -@echo "${other_help}" 382 383help-make: 384 -@echo 385 -@echo "Basic build usage:" 386 -@echo " make -f ${makefile} <options>" 387 -@echo 388 -@echo "Options:" 389 -@echo " V=0 Very quiet builds" 390 -@echo " V=1 Verbose builds" 391 -@echo 392 393help-targets: 394 -@echo "All makefile targets and their dependencies:" 395 -@grep ^[a-z] ${makefile} | grep : | grep -v = 396 -@echo 397 -@echo 398 399help-test: 400 -@echo "Basic test usage:" 401 -@echo " make -f ${makefile} test <options>" 402 -@echo 403 -@echo "Options:" 404 -@echo " NO_RM=1 Do not remove the executables after running" 405 -@echo " REPLACE=1 Replace the output in PETSC_DIR source tree (-m to test scripts)" 406 -@echo " OUTPUT=1 Show only the errors on stdout" 407 -@echo " ALT=1 Replace 'alt' output in PETSC_DIR source tree (-M to test scripts)" 408 -@echo " DIFF_NUMBERS=1 Diff the numbers in the output (-j to test scripts and petscdiff)" 409 -@echo " CUDAMEMCHECK=1 Execute the tests using cuda-memcheck (-U to test scripts)" 410 -@echo " VALGRIND=1 Execute the tests using valgrind (-V to test scripts)" 411 -@echo " NP=<num proc> Set a number of processors to pass to scripts." 412 -@echo " FORCE=1 Force SKIP or TODO tests to run" 413 -@echo " PRINTONLY=1 Print the command, but do not run. For loops print first command" 414 -@echo " TIMEOUT=<time> Test timeout limit in seconds (default in config/petsc_harness.sh)" 415 -@echo " TESTDIR='tests' Subdirectory where tests are run ($${PETSC_DIR}/$${PETSC_ARCH}/$${TESTDIR}" 416 -@echo " or $${PREFIX_DIR}/$${TESTDIR}" 417 -@echo " or $${PREFIX_DIR}/share/petsc/examples/$${TESTDIR})" 418 -@echo " TESTBASE='tests' Subdirectory where tests are run ($${PETSC_DIR}/$${PETSC_ARCH}/$${TESTDIR}" 419 -@echo " OPTIONS='<args>' Override options to scripts (-a to test scripts)" 420 -@echo " EXTRA_OPTIONS='<args>' Add options to scripts (-e to test scripts)" 421 -@echo 422 -@echo "Tests can be generated by searching:" 423 -@echo " Percent is a wildcard (only one allowed):" 424 -@echo " make -f ${makefile} test search=sys%ex2" 425 -@echo 426 -@echo " To match internal substrings (matches *ex2*):" 427 -@echo " make -f ${makefile} test searchin=ex2" 428 -@echo 429 -@echo " Search and searchin can be combined:" 430 -@echo " make -f ${makefile} test search='sys%' searchin=ex2" 431 -@echo 432 -@echo " To match patterns in the arguments:" 433 -@echo " make -f ${makefile} test argsearch=cuda" 434 -@echo 435 -@echo " For general glob-style searching using python:" 436 -@echo " NOTE: uses shell which is possibly slower and more brittle" 437 -@echo " make -f ${makefile} test globsearch='sys*ex2*'" 438 -@echo 439 -@echo " To re-run the last tests which failed:" 440 -@echo " make -f ${makefile} test test-fail='1'" 441 -@echo 442 -@echo " To search for fields from the original test definitions:" 443 -@echo " make -f ${makefile} test query='requires' queryval='*MPI_PROCESS_SHARED_MEMORY*'" 444 -@echo 445 -@echo " To see which targets match a given pattern (useful for doing a specific target):" 446 -@echo " make -f ${makefile} print-test search=sys%" 447 -@echo " which is equivalent to:" 448 -@echo " make -f ${makefile} print VAR=TESTTARGETS search='sys%'" 449 -@echo 450 -@echo " To build an executable, give full path to location:" 451 -@echo ' make -f ${makefile} $${PETSC_ARCH}/tests/sys/tests/ex1' 452 -@echo " or make the test with NO_RM=1" 453 -@echo 454