Lines Matching +full:petsc4py +full:- +full:pip
5 # * make help - useful messages on functionality
6 # * make all - compile the PETSc libraries and utilities, run after ./configure
7 # * make check - runs a quick test that the libraries are built correctly and PETSc applications can run
9 # * make install - for use with ./configure is run with the --prefix=directory option
10 # * make test - runs a comprehensive test suite (requires gnumake)
11 # * make docs - build the entire PETSc website of documentation (locally)
15 # gmakefile - manages the compiling PETSc in parallel
16 # gmakefile.test - manages running the comprehensive test suite
32 OMAKE_SELF = $(OMAKE) -f makefile
33 OMAKE_SELF_PRINTDIR = $(OMAKE_PRINTDIR) -f makefile
40 @ln -sf ${PETSC_ARCH}/lib/petsc/conf/make.log make.log
41 +@(${OMAKE_SELF_PRINTDIR} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} all-local; echo "$$?" > ${PETSC_ARCH}/lib/petsc/conf/error.log) 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log
43 grep -E '(out of memory allocating.*after a total of|gfortran: fatal error: Killed signal terminated program f951|f95: fatal error: Killed signal terminated program f951)' ${PETSC_ARCH}/lib/petsc/conf/make.log | tee ${PETSC_ARCH}/lib/petsc/conf/memoryerror.log > /dev/null;\
44 if test -s ${PETSC_ARCH}/lib/petsc/conf/memoryerror.log; then\
45 printf ${PETSC_TEXT_HILIGHT}"**************************ERROR*************************************\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
46 echo " Error during compile, you need to increase the memory allocated to the VM and rerun " 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
47 printf "********************************************************************"${PETSC_TEXT_NORMAL}"\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
49 printf ${PETSC_TEXT_HILIGHT}"**************************ERROR*************************************\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
50 echo " Error during compile, check ${PETSC_ARCH}/lib/petsc/conf/make.log" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
51 echo " Send it and ${PETSC_ARCH}/lib/petsc/conf/configure.log to petsc-maint@mcs.anl.gov" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
53 echo " Having Conda in your shell may have caused this problem, consider turning off Conda." 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
55 printf "********************************************************************"${PETSC_TEXT_NORMAL}"\n" 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log;\
58 ${OMAKE_SELF} print_mesg_after_build PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} 2>&1 | tee -a ${PETSC_ARCH}/lib/petsc/conf/make.log ;\
63 all-local: info libs matlabbin ${PETSC_POST_BUILDS}
66 @touch -t 197102020000 ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/files
69 @${MKDIR} -p ${PETSC_DIR}/${PETSC_ARCH}/tests && touch -t 197102020000 ${PETSC_DIR}/${PETSC_ARCH}/tests/testfiles
72 -@PETSC_DIR=${PETSC_DIR} ${PYTHON} ${PETSC_DIR}/lib/petsc/bin/petscnagupgrade.py
75 -@if [ "${MATLAB_MEX}" != "" -a "${MATLAB_SOCKET}" != "" -a "${PETSC_SCALAR}" = "real" -a "${PETSC_PRECISION}" = "double" ]; then\
77 if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc; fi;\
78 if [ ! -d "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab" ] ; then ${MKDIR} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab; fi;\
79 cd src/sys/classes/viewer/impls/socket/mex-scripts && ${OMAKE_SELF} mex-scripts PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR};\
84 @${PYTHON} lib/petsc/bin/generatefortranbindings.py --petsc-dir=${PETSC_DIR} --petsc-arch=${PETSC_ARCH}
89 if [ -d ${INSTALL_LIB_DIR}/$${LIBNAME}$${LIB_NAME_SUFFIX}.dylib.dSYM ]; then\
90 echo ${RM} -rf ${INSTALL_LIB_DIR}/$${LIBNAME}$${LIB_NAME_SUFFIX}.dylib.dSYM;\
91 ${RM} -rf ${INSTALL_LIB_DIR}/$${LIBNAME}$${LIB_NAME_SUFFIX}.dylib.dSYM;\
96 @if [ -f ${INSTALL_LIB_DIR}/so_locations ]; then\
102 -@find src -type d -name ftn-auto* | xargs rm -rf
103 -@if [ -n "${PETSC_ARCH}" ] && [ -d ${PETSC_ARCH} ] && [ -d ${PETSC_ARCH}/src ]; then\
104 find ${PETSC_ARCH}/src -type d -name ftn-auto* | xargs rm -rf ;\
108 @unset MAKEFLAGS && ${PYTHON} ${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py
111 -@echo "Warning: chkopts target is deprecated and can be removed from user makefiles"
126 -@echo "Running PETSc check examples to verify correct installation"
127 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}"
133 ${RM} -f check_error;\
135 if [ -f check_error ]; then\
137 ${RM} -f check_error;\
140 ${RM} -f check_error;\
144 +@cd src/snes/tutorials >/dev/null; ${RUN_TEST} clean-legacy
147 +@if [ "`grep -E '^#define PETSC_HAVE_HYPRE 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_HYPRE 1" ] && [ "${PETSC_SCALAR}" = "real" ]; then\
148 if [ "`grep -E '^#define PETSC_HAVE_CUDA 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_CUDA 1" ]; then HYPRE_TEST=runex19_hypre_cuda;\
149 elif [ "`grep -E '^#define PETSC_HAVE_HIP 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_HIP 1" ]; then HYPRE_TEST=runex19_hypre_hip;\
153 +@if [ "`grep -E '^#define PETSC_HAVE_CUDA 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_CUDA 1" ]; then\
156 +@if [ "`grep -E '^#define PETSC_HAVE_HIP 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_HIP 1" ]; then\
161 if [ "`grep -E '^#define PETSC_HAVE_KOKKOS_KERNELS 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_KOKKOS_KERNELS 1" ] && [ "${PETSC_SCALAR}" = "real" ] && [ "${PETSC_PRECISION}" = "double" ]; then\
164 if [ "`grep -E '^#define PETSC_HAVE_MUMPS 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_MUMPS 1" ]; then\
167 if [ "`grep -E '^#define PETSC_HAVE_SUITESPARSE 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_SUITESPARSE 1" ]; then\
170 if [ "`grep -E '^#define PETSC_HAVE_SUPERLU_DIST 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_SUPERLU_DIST 1" ]; then\
173 if [ "`grep -E '^#define PETSC_HAVE_ML 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_ML 1" ] || [ "`grep -E '^#define PETSC_HAVE_TRILINOS 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_TRILINOS 1" ]; then\
176 ${RUN_TEST} clean-legacy;\
177 cd - > /dev/null;\
178 if [ "`grep -E '^#define PETSC_HAVE_AMREX 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_AMREX 1" ] && [ "`grep -E '^#define PETSC_HAVE_CUDA 1' ${PETSCCONF_H}`" != "#define PETSC_HAVE_CUDA 1" ]; then\
182 ${RUN_TEST} clean-legacy;\
184 ${RUN_TEST} clean-legacy;\
185 cd - > /dev/null;\
188 +@if [ "`grep -E '^#define PETSC_HAVE_HDF5 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_HDF5 1" ]; then\
190 ${RUN_TEST} clean-legacy;\
192 ${RUN_TEST} clean-legacy;\
196 ${RUN_TEST} clean-legacy;\
198 ${RUN_TEST} clean-legacy;\
200 +@if [ "`grep -E '^#define PETSC_HAVE_PETSC4PY 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_PETSC4PY 1" ]; then\
202 ${RUN_TEST} clean-legacy;\
204 ${RUN_TEST} clean-legacy;\
206 +@if [ "`grep -E '^#define PETSC_USE_FORTRAN_BINDINGS 1' ${PETSCCONF_H}`" = "#define PETSC_USE_FORTRAN_BINDINGS 1" ]; then\
208 ${RUN_TEST} clean-legacy;\
210 ${RUN_TEST} clean-legacy;\
212 +@if [ "`grep -E '^#define PETSC_HAVE_MATLAB 1' ${PETSCCONF_H}`" = "#define PETSC_HAVE_MATLAB 1" ]; then\
214 ${RUN_TEST} clean-legacy;\
216 ${RUN_TEST} clean-legacy;\
218 -@echo "Completed PETSc check examples"
223 @${PYTHON} ./config/install.py -destDir=${DESTDIR}
224 +${OMAKE_SELF} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} PETSC_INSTALL=$@ install-builtafterpetsc
227 install-lib:
228 @${PYTHON} ./config/install.py -destDir=${DESTDIR} -no-examples
229 +${OMAKE_SELF} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} PETSC_INSTALL=$@ install-builtafterpetsc
231 install-builtafterpetsc:
235 # Creates ${HOME}/petsc.tar.gz [and petsc-with-docs.tar.gz]
246 -@${RM} -rf ${PETSC_ARCH}/lib/petsc/conf/alltests.log alltests.log
247 +@if [ -f ${PETSC_DIR}/share/petsc/examples/gmakefile.test ] ; then\
253 ln -s $${ALLTESTSLOG} alltests.log ;\
256 if [ x${ALLTESTS_CHECK_FAILURES} = xyes -a ${PETSC_PRECISION} != single ]; then\
257 cat $${ALLTESTSLOG} | grep -E '(^not ok|not remade because of errors|^# No tests run)' | wc -l | grep '^[ ]*0$$' > /dev/null;\
260 allgtests-tap: allgtest-tap
261 +@${OMAKE} -f ${ALLTESTS_MAKEFILE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} check-test-errors
263 allgtest-tap: ${PETSC_DIR}/${PETSC_ARCH}/tests/testfiles
264 +@MAKEFLAGS="-j$(MAKE_TEST_NP) -l$(MAKE_LOAD) $(MAKEFLAGS)" ${OMAKE} ${MAKE_SHUFFLE_FLG} -f ${ALLTESTS_MAKEFILE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} test OUTPUT=1
267 +@MAKEFLAGS="-j$(MAKE_TEST_NP) -l$(MAKE_LOAD) $(MAKEFLAGS)" ${OMAKE} -k -f ${ALLTESTS_MAKEFILE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} test V=0 2>&1 | grep -E -v '^(ok [^#]*(# SKIP|# TODO|$$)|[A-Za-z][A-Za-z0-9_]*\.(c|F|cxx|F90).$$)'
270 +${OMAKE} -f ${ALLTESTS_MAKEFILE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} test
272 +${OMAKE} -f ${ALLTESTS_MAKEFILE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleantest
277 -${RM} -rf ${PETSC_LIB_DIR}/libpetsc*.*
279 -${RM} -f ${PETSC_DIR}/${PETSC_ARCH}/include/petsc*.mod
282 -@${OMAKE} -f gmakefile clean
287 @if [ -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ]; then\
288 echo "*** Preserving ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py in ${PETSC_DIR} ***";\
289 mv -f ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/reconfigure-${PETSC_ARCH}.py ${PETSC_DIR}/;\
291 ${RM} -rf ${PETSC_DIR}/${PETSC_ARCH}/ ;\
297 +@${OMAKE} -f gmakefile gmakeinfo
300 -@echo "Testing compile with user makefile"
301 -@echo "Using PETSC_DIR=${PETSC_DIR} and PETSC_ARCH=${PETSC_ARCH}"
302 @cd src/snes/tutorials; ${RUN_TEST} clean-legacy
303 @cd src/snes/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${PETSC_DIR}/share/petsc/Makefile.user ex19
304 @grep -E "^#define PETSC_USE_FORTRAN_BINDINGS 1" ${PETSCCONF_H} | tee .ftn.log > /dev/null;\
305 if test -s .ftn.log; then\
306 cd src/snes/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} -f ${PETSC_DIR}/share/petsc/Makefile.user ex5f;\
308 @cd src/snes/tutorials; ${RUN_TEST} clean-legacy
309 -@echo "Completed compile with user makefile"
313 # pip install fprettify
315 @git ls-files "*.[hF]90" | xargs fprettify --indent 2 --line-length 1000 --whitespace 2 --whitespace-type F --case 1 0 1 0 --enable-replacements --c-relations
319 @files=`git ls-files "*.[hF]90"`; for i in $${files}; do fortify --tab_length 2 --lowercasing F $${i}; done
324 @if ! git diff --quiet; then\
326 git status -s --untracked-files=no ;\
332 @if ! git diff --quiet; then\
334 if [ -z "${CI_PIPELINE_ID}" ]; then\
336 git diff --stat;\
338 git diff --patch-with-stat > ${PETSC_ARCH}/lib/petsc/conf/checkclangformat.patch;\
339 git diff --patch-with-stat --color=always | head -1000;\
340 if [ `wc -l < ${PETSC_ARCH}/lib/petsc/conf/checkclangformat.patch` -gt 1000 ]; then\
349 @if ! git diff --quiet; then\
351 if [ -z "${CI_PIPELINE_ID}" ]; then\
353 git diff --stat;\
355 git diff --patch-with-stat > ${PETSC_ARCH}/lib/petsc/conf/checkfprettifyformat.patch;\
356 git diff --patch-with-stat --color=always | head -1000;\
357 if [ `wc -l < ${PETSC_ARCH}/lib/petsc/conf/checkfprettifyformat.patch` -gt 1000 ]; then\
366 @shellcheck --format=diff $$(git ls-files\*.sh) $$(file lib/petsc/bin/* lib/petsc/bin/maint/* | grep "/usr/bin/env sh" | cut -d: -f1) | patch -p1
369 # shellcheck --format=tty $$(git ls-files\*.sh) $$(file lib/petsc/bin/* lib/petsc/bin/maint/* | grep "/usr/bin/env sh" | cut -d: -f1)
371 @if ! git diff --quiet; then\
373 if [ -z "${CI_PIPELINE_ID}" ]; then\
375 git diff --stat;\
377 git diff --patch-with-stat > ${PETSC_ARCH}/lib/petsc/conf/checkshellcheck.patch;\
378 git diff --patch-with-stat --color=always | head -1000;\
379 if [ `wc -l < ${PETSC_ARCH}/lib/petsc/conf/checkshellcheck.patch` -gt 1000 ]; then\
392 -@echo "Comparing ABI/API of the following two PETSc versions (you must have already configured and built them using GCC and with -g):"
393 -@echo "========================================================================================="
394 -@echo " Old: PETSC_DIR_ABI_OLD = ${PETSC_DIR_ABI_OLD}"
395 -@echo " PETSC_ARCH_ABI_OLD = ${PETSC_ARCH_ABI_OLD}"
396 -@pushd ${PETSC_DIR_ABI_OLD} >> /dev/null ; echo " Branch = "`git rev-parse --abbrev-ref HEAD`
397 -@echo " New: PETSC_DIR = ${PETSC_DIR}"
398 -@echo " PETSC_ARCH = ${PETSC_ARCH}"
399 -@echo " Branch = "`git rev-parse --abbrev-ref HEAD`
400 -@echo "========================================================================================="
401 -@$(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/abicheck.py -old_dir ${PETSC_DIR_ABI_OLD} -old_arch ${PETSC_ARCH_ABI_OLD} -new_dir ${PETSC_DIR} -new_arch ${PETSC_ARCH} -report_format html
403 # Run fortitude Fortran linter; pip install fortitude-lint; fortitude does not support using the preprocessor so it is of only limited utility
405 -@fortitude check --line-length 1000 --ignore C003,C121,S241 --verbose --fix --preview
409 -@if [[ -f "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/configure.log" ]]; then\
410 OPTIONS=`grep -h -m 1 "Configure Options: " ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/configure.log | sed "s!Configure Options: --configModules=PETSc.Configure --optionsModule=config.compilerOptions!!g"` ;\
416 PETSC_DIR_OLD=${PETSC_DIR}/../petsc-abi;\
419 echo "Doing ABI/API comparison between" ${branch} " and " `git rev-parse --abbrev-ref HEAD` "using " $${OPTIONS} ;\
421 if [[ ! -d $${PETSC_DIR_OLD} ]]; then\
429 PETSC_DIR=`pwd` PETSC_ARCH=arch-branch-`git rev-parse ${branch}` ./configure $${OPTIONS} ;\
430 PETSC_DIR=`pwd` PETSC_ARCH=arch-branch-`git rev-parse ${branch}` make all test ;\
434 PETSC_DIR_ABI_OLD=$${PETSC_DIR_OLD} PETSC_ARCH_ABI_OLD=arch-branch-`git rev-parse ${branch}` make abitest
459 -@${PYTHON} lib/petsc/bin/maint/generateetags.py && ${CP} TAGS ${PETSC_ARCH}/
460 -@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON
464 -@find ${PETSC_DIR}/include ${PETSC_DIR}/src -regex '\(.*makefile\|.*\.\(cc\|hh\|cpp\|cxx\|C\|hpp\|c\|h\|cu\|m\)$$\)' | grep -v ftn-auto | gtags -f -
472 @if [ ! -f include/petscversion.h ]; then\
488 -@if [ -d ${LOC} -a -d ${LOC}/manualpages ]; then\
489 find ${LOC}/manualpages -type f -name "*.md" -exec ${RM} {}\; ;\
494 -${OMAKE_SELF} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} tree
499 output_file_base_name=${PETSC_ARCH}-gcovr-report.json;\
503 gcovr --json --output $${petsc_arch_dir}/$${output_file_base_name} --exclude '.*/ftn-auto/.*' --exclude '.*/petscsys.h' --exclude-lines-by-pattern '^\s*SETERR.*' --exclude-throw-branches --exclude-unreachable-branches --gcov-ignore-parse-errors -j 8 --gcov-executable "${PETSC_COVERAGE_EXEC}" --root ${PETSC_DIR} ./obj ./tests ${PETSC_GCOV_OPTIONS} &&\
504 ${RM} -f $${tar_file} &&\
505 tar --bzip2 -cf $${tar_file} -C $${petsc_arch_dir} ./$${output_file_base_name} &&\
509 $(PYTHON) ${PETSC_DIR}/lib/petsc/bin/maint/gcov.py --merge-branch `lib/petsc/bin/maint/check-merge-branch.sh` --html --xml ${PETSC_GCOV_OPTIONS}
512 -@grep PETSC_EXTERN ${PETSC_DIR}/include/*.h | grep "(" | tr -s ' ' | cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' | tr 'A-Z' 'a-z' | sort | uniq > /tmp/countcfunctions
515 -@echo "Missing package tests"
516 -@cat config/examples/*.py > configexamples; pushd config/BuildSystem/config/packages/; packages=`ls *.py | sed "s/\\.py//g"`; popd; for i in $${packages}; do j=`echo $${i} | tr '[:upper:]' '[:lower:]'`; printf $${j} ; grep -E "(with-$${j}|download-$${j})" configexamples | grep -v "=0" | wc -l ; done
517 -@echo "Missing download package tests"
518 -@cat config/examples/*.py > configexamples; pushd config/BuildSystem/config/packages/; packages=`grep -l "download " *.py | sed "s/\\.py//g"`; popd; for i in $${packages}; do j=`echo $${i} | tr '[:upper:]' '[:lower:]'`; printf $${j} ; grep -E "(download-$${j})" configexamples | grep -v "=0" | wc -l ; done
521 @${RM} -f petsc4py_rst.log
522 @echo "Checking src/binding/petsc4py/DESCRIPTION.rst"
523 @rst2html src/binding/petsc4py/DESCRIPTION.rst > /dev/null 2> petsc4py_rst.log
524 @if test -s petsc4py_rst.log; then cat petsc4py_rst.log; exit 1; fi
527 # TODO: check for PetscBeginFunctionUser in non-example source
532 # TODO: check for ill-formed manual pages
538 -@x=`python3 ../bin/extract.py | aspell list | sort -u` ;
541 -@if [ -d "${DATAFILESPATH}" ]; then\
543 cd "${DATAFILESPATH}" && git pull -q; fi