[petsc-dev] Stale lib/petsc/conf/petscvariables interferes with prefix tests

Satish Balay balay at mcs.anl.gov
Thu Mar 8 20:56:16 CST 2018


On Thu, 8 Mar 2018, Jed Brown wrote:

> > Alternative would be to use /tmp - but I hesitated to do that.. [as I
> > would have to cleanly delete things I write there, worry about
> > multiple concurrent builds etc..]
> 
> That's what mktemp is for.

diff --git a/makefile b/makefile
index 4b25508aff..53f8e34865 100644
--- a/makefile
+++ b/makefile
@@ -119,7 +119,10 @@ info:
          fi
 	- at echo "-----------------------------------------"
 	- at echo "Using system modules: ${LOADEDMODULES}"
-	- at echo Using mpi.h: `echo '#include <mpi.h>' > ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/mpitest.c; ${CPP} ${PETSC_CCPPFLAGS} ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/mpitest.c |grep 'mpi\.h' |  ( head -1 ; cat > /dev/null )`
+	- at TESTFILE=`mktemp -q /tmp/petscmpi-XXXXXXXX.c` && \
+           echo '#include <mpi.h>' > $${TESTFILE} && \
+           BUF=`${CPP} ${PETSC_CCPPFLAGS} $${TESTFILE} |grep 'mpi\.h' | ( head -1 ; cat > /dev/null )` && \
+           echo Using mpi.h: $${BUF} && ${RM} $${TESTFILE}
 	- at echo "-----------------------------------------"
 	- at echo "Using libraries: ${PETSC_LIB}"
 	- at echo "------------------------------------------"

Satish


More information about the petsc-dev mailing list