Loris Bennett <[email protected]> writes:
> Hi,
> Ward Poelmans <[email protected]> writes:
>
>> Hi Loris,
>>
>> On 17/06/19 16:23, Loris Bennett wrote:
>>>
>>> Is there any particular reason why the buildopts don't just specify, say,
>>>
>>> VERSION="sopt popt ssmp psmp"
>>>
>>
>> There is no specific reason for this. I shouldn't be very hard to adjust
>> the easyblock to accept this.
>
> I have tried to implement this as a hook:
>
> def pre_build_hook(self, *args, **kwargs):
>
> if self.name == 'CP2K':
> self.cfg['buildopts'] = self.cfg['buildopts'] + ' VERSION="sopt
> popt ssmp psmp"'
>
> but this adds a modification in the wrong place:
>
> == 2019-06-25 17:16:16,153 run.py:192 INFO running cmd: make VERSION="sopt
> popt ssmp psmp" MAKE="make -j 40" ARCH=Linux-x86-64-intel VERSION=popt clean
>
> Is there a variable which contains the contents of the 'make' step to which
> I could apply a regex replace?
So I now have
def pre_configure_hook(self, *args, **kwargs):
if self.name == 'CP2K':
self.cfg['type'] = 'psmp'
self.log.info("[pre-configure hook] Adding type =\"=psmp\"")
return
which works, but I would like to build both a popt and an psmp version.
However, the Easyblock contains:
known_types = ['popt', 'psmp']
if self.cfg['type'] not in known_types:
raise EasyBuildError("Unknown build type specified: '%s', known
types are %s",
self.cfg['type'], known_types)
So it seems like I can build one or the other but not both.
What's the recommended way forward here?
Cheers,
Loris
--
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email [email protected]