On 20/04/16 19:41, Andreas Hilboll wrote:
Hi Kenneth,

Kenneth Hoste writes:

Someone warned me about this change, but I haven't had time to look at
this yet (and I haven't had a pressing need to bump the WRF version yet
either).
However, it's probably not as bad as it sounds...

run_cmd_qa has support for answering a question where the answer to be
given is a part of the question text (for example, picking a number).
This is already done for versions prior to v3.8, cfr.
https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/w/wrf.py#L135

It basically boils down to defining the build_type_question regular
expression 'a bit' for version 3.8 (and up).

How good are you with Python and regular expressions? ;-)
My Python is pretty good, I'd say, but with regular expressions I'd
classify as (almost absolute) beginner.  But I'm sure I can somehow get
there.

How would the decision which easyblock version to use be done properly?
I'd somehow have to add support for WRF >= 3.8 without taking away
support for earlier versions.  Would that go via subclassing the EB_WRF
class?  If so, how would I ensure that EasyBuild automatically picks the
correct easyblock depending on the version?

You would insert a check like:

if LooseVersion(self.version) >= LooseVersion('3.8'):
    # new regexp
else:
    # old regexp

But maybe I should start working on the right regexp ... ;)

Let me know if you nee help with this, because these can be daunting...

The key is to include a 'named group' in the regex with the label 'nr', which will indicate the actual number that would be used, as is also the case now in the existing value for build_type_question with (?P<nr>[0-9]+) .

You'll need to provide new definitions for build_type_option for the newer WRF versions, based on the compiler family (see existing code), and then construct build_type_question differently using both build_type_option and bt (the build type being selected, e.g. dmpar).

Taking a look at the way in which WRF 3.6 and earlier prints the list of options would help a great deal probably.

If you need help, maybe you should consider jumping into the #easybuild IRC channel on the FreeNode IRC network...


regards,

Kenneth

Reply via email to