script to query PETSc makefile variables?

Boyana Norris norris at mcs.anl.gov
Thu Jan 22 18:06:01 CST 2009



Matthew Knepley wrote:
> On Thu, Jan 22, 2009 at 5:31 PM, Boyana Norris <norris at mcs.anl.gov> wrote:
>   
>> Ah, ok, that explains it -- it's not in the installed version (the one after
>> make install). Should it be? I really would like to avoid depending on the
>> PETSc source directories.
>>     
>
> Technically,
>
>   1) BuildSystem is a separate project. It has its own repository
>   

And a nice one it is. Can it be installed in its own prefix? Sorry, I 
never have, so I don't know the proper incantations -- I don't see a 
setup.py, but I haven't investigated further.
>   2) script is superfluous for getting the variables
>   

Yes, we could all write in assembly, too. Not to be too whiny, but 
expecting everyone to do interesting things with sed in their makefiles 
as a matter of course is not very reasonable. Some users don't even know 
how to write a makefile. And very few know how to extract a few values 
from a file from within a makefile without relying on an external 
script. I do, but I'm thinking about others who'd have to do similar 
things in the future (e.g., have a pile of code in which petsc is one of 
many external dependencies).

Boyana

>    Matt
>
>   
>> Boyana
>>
>> Matthew Knepley wrote:
>>     
>>> On Thu, Jan 22, 2009 at 5:15 PM, Boyana Norris <norris at mcs.anl.gov> wrote:
>>>
>>>       
>>>> Thank you both -- I'd prefer to use configVars.py, but it seems to depend
>>>> on
>>>> the script module, which is not standard in at least Python 2.5. Googling
>>>> for "python script module" is a joke, as you can imagine. Is this a PETSc
>>>> thing or a general module I can get somewhere?
>>>>
>>>>         
>>> That module is in PETSc,
>>>
>>>  $PETSC_DIR/config/BuildSystem
>>>
>>>    Matt
>>>
>>>
>>>       
>>>> Thanks!
>>>> Boyana
>>>>
>>>> Matthew Knepley wrote:
>>>>
>>>>         
>>>>> Check out $PETSC_DIR/bin/configVars.py
>>>>>
>>>>>  Matt
>>>>>
>>>>> On Thu, Jan 22, 2009 at 4:38 PM, Satish Balay <balay at mcs.anl.gov> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> On Thu, 22 Jan 2009, Boyana Norris wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Is there a script that can be used to query the values of various
>>>>>>> variables
>>>>>>> defined in petscvariables makefile snippets (similar to lots of linux
>>>>>>> tools'
>>>>>>> pkg-config scripts)?
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> [don't have canned code for this but] I've previously recommended
>>>>>> doing the following in the packages configure.. [facets now has this
>>>>>> in their configure to detect petsc]
>>>>>>
>>>>>>
>>>>>> - petsc_arch and petsc_dir are inputs to configure
>>>>>> - Create a dummy makefile on the fly
>>>>>> - run this makefile to echo relavent stuff..
>>>>>>
>>>>>>
>>>>>> For eg:
>>>>>> asterix:/home/balay/download-pine>cat configpetsc.sh
>>>>>> #!/bin/sh
>>>>>>
>>>>>> PETSC_ARCH=asterix64
>>>>>> PETSC_DIR=/home/balay/spetsc
>>>>>>
>>>>>> cat <<EOF > petscmake
>>>>>> PETSC_ARCH = ${PETSC_ARCH}
>>>>>> PETSC_DIR  = ${PETSC_DIR}
>>>>>> include ${PETSC_DIR}/conf/base
>>>>>> EOF
>>>>>>
>>>>>> PETSC_INC=`make -f petscmake getincludedirs`
>>>>>> PETSC_LIB=`make -f petscmake getlinklibs`
>>>>>>
>>>>>> echo '**** PETSC_INC ***'
>>>>>> echo ${PETSC_INC}
>>>>>> echo '**** PETSC_LIB ***'
>>>>>> echo ${PETSC_LIB}
>>>>>>
>>>>>>
>>>>>> Satish
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>
>>>>>           
>>>> --
>>>> Boyana Norris, Computer Scientist    |   Email: norris at mcs.anl.gov
>>>> Argonne National Laboratory          |   Phone: +1 (630) 252 7908
>>>> http://www.mcs.anl.gov/~norris/      |   Fax:   +1 (630) 252 5986
>>>>
>>>>
>>>>         
>>>
>>>
>>>       
>> --
>> Boyana Norris, Computer Scientist    |   Email: norris at mcs.anl.gov
>> Argonne National Laboratory          |   Phone: +1 (630) 252 7908
>> http://www.mcs.anl.gov/~norris/      |   Fax:   +1 (630) 252 5986
>>
>>     
>
>
>
>   

-- 
Boyana Norris, Computer Scientist    |   Email: norris at mcs.anl.gov 

Argonne National Laboratory          |   Phone: +1 (630) 252 7908 

http://www.mcs.anl.gov/~norris/      |   Fax:   +1 (630) 252 5986 




More information about the petsc-dev mailing list