[petsc-dev] Stale lib/petsc/conf/petscvariables interferes with prefix tests
Jed Brown
jed at jedbrown.org
Thu Mar 8 21:09:01 CST 2018
Satish Balay <balay at mcs.anl.gov> writes:
> 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}
$(RM) $${TESTFILE}
should probably be executed regardless of whether the other stuff succeeds.
> - at echo "-----------------------------------------"
> - at echo "Using libraries: ${PETSC_LIB}"
> - at echo "------------------------------------------"
>
> Satish
More information about the petsc-dev
mailing list