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

Jed Brown jed at jedbrown.org
Thu Mar 8 15:50:11 CST 2018


Satish Balay <balay at mcs.anl.gov> writes:

> On Wed, 7 Mar 2018, Jed Brown wrote:
>
>> If the most recently run configure is different from the prefix install
>> you want to test, then incorrect variables get resolved.  For example, I
>> run
>> 
>>   make PETSC_DIR=/home/jed/usr/petsc-mpich-basic-prefix PETSC_ARCH="" test
>> 
>> and lib/petsc/conf/petscvariables contains
>> 
>>   PETSC_ARCH=ompi-opt-singlelib                                                                                                                                                                 
>>   PETSC_DIR=/home/jed/petsc
>>   include /home/jed/petsc/ompi-opt-singlelib/lib/petsc/conf/petscvariables
>> 
>> which in my case defines variables like HYPRE_LIB which should be empty
>> in the prefix install I'm trying to test.
>> 
>> I think we normally don't notice because the correct petscvariables gets
>> included later and supersedes anything defined here.  Why isn't it spelled
>> 
>>   include $(PETSC_DIR)/$(PETSC_ARCH)/lib/petsc/conf/petscvariables
>
> I guess the thought was: since we are hard-coding PETSC_ARCH and
> PETSC_DIR values in this file - we should do the same for the include
> directive.
>
> If this change doesn't break the original intent [i.e there is a
> default PETSC_ARCH/PETSC_DIR stored here - that gets used if user
> doesn't set them explicitly in env or cmd] - I think you should go
> ahead with it.

Well, the fix only works if the user explicitly sets PETSC_ARCH to the
empty string.  If instead they

  unset PETSC_ARCH
  make PETSC_DIR=/home/jed/usr/petsc-mpich-basic-prefix info

then they get an error.  That isn't nice, but I don't know what to do
about it.

Related question: if the prefix install is read-only, then this line in
"make info" fails.

	- 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 )`


Are there CPP that can't use stdin?


More information about the petsc-dev mailing list