← Back to team overview

dolfin team mailing list archive

Re: Testing for library version

 

On Sun, Sep 27, 2009 at 8:51 PM, Johan Hake <hake@xxxxxxxxx> wrote:
> On Sunday 27 September 2009 20:18:07 Garth N. Wells wrote:
>> Johan Hake wrote:
>> > On Sunday 27 September 2009 19:49:09 Garth N. Wells wrote:
>> >> Where's the appropriate place in the build system to test for the
>> >> version number of external libraries? Is it in dolfin/SConscript (using
>> >>   the simula-scons function 'checkVersion')?
>> >
>> > I do not think we have any defined sections in SConstruct/SConscript
>> > where this should be done. We have used checkVersion to check for the
>> > swig version some years ago... It is still there as out-commented code in
>> > the SConscript file.
>> >
>> > I think the function just compare a version string with another handed
>> > version string, where the numbers are delimited by '.'.
>> >
>> > Aren't there any version checks done in the pkg-config generator files?
>>
>> No, but I guess that's not the place to do it since they are unrelated
>> to DOLFIN and just produce a foo.pc file.
>>
>> I guest the right way is to use 'pkg-config --version foo.pc' rather
>> than checkVersion.
>
> Again, checkVersion is just a function that check if a version string is
> larger or equal than a passed version string. So the test might look something
> like this:
>
>  foo_version = getoutput("pkg-config --version foo.pc")
>  if scons.checkVersion(foo_version,"3.0.0"):
>      raise Error
>
>
>> Still, I don't know where this check is best performed.
>
> Not sure either. I added an extensive check for the SWIG version in
> SConscript. I have never felt good about that piece of code...
>
> With the present state of the build system it is not easy to answer questions
> like this. However it would be nice to add some functionality to the scons.cfg
> file. Instead of passing a list of strings, stating the dependencies we pass a
> dict.
>
> Something like:
>
>  OptDependencies = {'petsc':'3.0.0',
>                     'slepc':'2.3.3':
>                     'foo':None,
>                      ...}

This is already possible. After a few minor bug fixes I ended up with
the following OptDependencies in dolfin/scons.cfg:

OptDependencies = {'petsc': '3.0.0',
                   'slepc': '3.0.0',
                   'scotch': '5.1',
                   'umfpack': '5.2.0',
                   'gts': '0.7.6',
                   'trilinos': '7.0.0',
                   'cholmod': '1.6.0',
                   'mtl4': '4',
                   'parmetis': '3.1',
                   'gmp': '4.2.4',
                   'zlib': '1.2.3'}

I'm not sure what the minimum requirements should be for the different
libraries so please update them if you know.

Johannes


Follow ups

References